Anthropic Claude SDK with OmegaEngine governance - AI safety and compliance
Project description
anthropic-omega
Anthropic Claude Integration with OmegaEngine Governance
Documentation • Playground • Issues
✨ Features
- 🤖 Drop-in Replacement — Same API as official Anthropic SDK
- 🛡️ Pre-flight Checks — Validate prompts before sending to Claude
- 📊 Response Governance — Filter outputs against policies
- 📈 Full Audit Trail — Log every Claude interaction
- ⚡ Streaming Support — Governed streaming responses
- 🔄 Constitutional AI — Add policy constraints to any Claude call
📦 Installation
Python
pip install anthropic-omega
🚀 Quick Start (Python)
from anthropic_omega import Anthropic
# Drop-in replacement for Anthropic client
client = Anthropic(
anthropic_api_key="your-anthropic-key",
omega_api_key="your-omega-key",
policy_id="claude_policy",
)
# Same API, but governed
message = client.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=1024,
messages=[
{"role": "user", "content": "Help me write a marketing email"}
]
)
print(message.content[0].text)
# Access governance metadata
print(message.omega_decision) # "APPROVE"
print(message.omega_audit_id) # "aud_abc123"
🛡️ Pre-flight Validation
Block unsafe prompts before they reach Claude:
client = Anthropic(
anthropic_api_key="...",
omega_api_key="...",
preflight_check=True, # Validate prompts first
block_on_deny=True, # Don't send if denied
)
try:
# This will be blocked if policy denies
message = client.messages.create(
model="claude-3-5-sonnet-20241022",
messages=[{"role": "user", "content": "...potentially unsafe..."}]
)
except OmegaBlockedError as e:
print(f"Blocked: {e.reason}")
print(f"Policy tags: {e.policy_tags}")
📡 Governed Streaming
with client.messages.stream(
model="claude-3-5-sonnet-20241022",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a story"}]
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
# Final response is still validated
print(f"\nDecision: {stream.omega_decision}")
🎯 Use Cases
| Use Case | How It Helps |
|---|---|
| Customer Support Bots | Ensure Claude doesn't share internal policies |
| Content Generation | Block harmful or off-brand content |
| Code Assistants | Prevent generation of malicious code |
| Healthcare Apps | Enforce HIPAA compliance |
| Finance Apps | Ensure FINRA compliance |
📊 What Gets Logged
Every Claude call logs:
- ✅ Input messages
- ✅ Output response
- ✅ Token usage
- ✅ Model used
- ✅ Latency
- ✅ Policy evaluation
- ✅ Risk assessment
- ✅ Audit trail ID
📄 License
Licensed under the Apache License 2.0.
Built with ❤️ by the OmegaEngine team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anthropic_omega-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anthropic_omega-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e22a38e14db470340c214a678df99f885580342f87a21818e249d0da313268a7
|
|
| MD5 |
867c9f6fc87510d94048bdb64304b3d1
|
|
| BLAKE2b-256 |
a4485c2b009fb578da8ae62fe1d595a92d89861ce50b44272c9585ac154010e3
|