Skip to main content

Anthropic Claude SDK with OmegaEngine governance - AI safety and compliance

Project description

OmegaEngine Logo

anthropic-omega

Anthropic Claude Integration with OmegaEngine Governance

PyPI License

DocumentationPlaygroundIssues


✨ 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


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

If you're not sure about the file name format, learn more about wheel file names.

anthropic_omega-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file anthropic_omega-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for anthropic_omega-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e22a38e14db470340c214a678df99f885580342f87a21818e249d0da313268a7
MD5 867c9f6fc87510d94048bdb64304b3d1
BLAKE2b-256 a4485c2b009fb578da8ae62fe1d595a92d89861ce50b44272c9585ac154010e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page