Metadata-Version: 2.4
Name: anthropic-omega
Version: 0.1.0
Summary: Anthropic Claude SDK with OmegaEngine governance - AI safety and compliance
Project-URL: Homepage, https://omegaengine.ai
Project-URL: Documentation, https://omegaengine.ai/docs
Project-URL: Repository, https://github.com/TheArkhitect/Omegaengine/tree/main/open-source-repos/anthropic-omega
Author-email: OmegaEngine <team@omegaengine.ai>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai-safety,anthropic,audit,claude,compliance,governance,llm,omegaengine
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: anthropic>=0.18.0
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <img src="logo.png" alt="OmegaEngine Logo" width="200" height="200">
</p>

<h1 align="center">anthropic-omega</h1>

<p align="center">
  <strong>Anthropic Claude Integration with OmegaEngine Governance</strong>
</p>

<p align="center">
  <a href="https://pypi.org/project/anthropic-omega/"><img src="https://img.shields.io/pypi/v/anthropic-omega?color=blue&label=PyPI" alt="PyPI"></a>
  <a href="https://github.com/TheArkhitect/Omegaengine/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License"></a>
</p>

<p align="center">
  <a href="https://omegaengine.ai/docs">Documentation</a> •
  <a href="https://omegaengine.ai/playground">Playground</a> •
  <a href="https://github.com/TheArkhitect/Omegaengine/issues">Issues</a>
</p>

---

## ✨ 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
```bash
pip install anthropic-omega
```


---

## 🚀 Quick Start (Python)

```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:

```python
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

```python
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](LICENSE).

---

<p align="center">
  Built with ❤️ by the <a href="https://omegaengine.ai">OmegaEngine</a> team
</p>
