Metadata-Version: 2.4
Name: covenant-ai-sdk
Version: 0.1.0
Summary: Python SDK for Covenant AI — AI Agent Governance Gateway
Home-page: https://github.com/covenant-ai/covenant-sdk-python
Author: Covenant AI
Author-email: Covenant AI <sdk@getcovenant.ai>
License-Expression: MIT
Project-URL: Homepage, https://getcovenant.ai
Project-URL: Documentation, https://docs.getcovenant.ai
Project-URL: Repository, https://github.com/covenant-ai/covenant-platform
Project-URL: Issues, https://github.com/covenant-ai/covenant-platform/issues
Keywords: ai,governance,agents,policy,enforcement,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: respx>=0.20; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Covenant AI Python SDK

Govern your AI agents in 3 lines of code.

## Install

```bash
pip install covenant-ai
```

## Quick Start

```python
from covenant_ai import CovenantClient

covenant = CovenantClient(agent_name="MyBot")

# Check if an action is allowed
result = covenant.check("wire_transfer", {"amount": 50000})
if result.allowed:
    execute_transfer()
else:
    print(f"Blocked: {result.reason} (risk: {result.risk_score})")
```

## Decorator Pattern

```python
@covenant.govern("wire_transfer", extract={"amount": "amount"})
def send_wire(amount, recipient):
    bank.transfer(amount, recipient)

send_wire(50000, "Acme Corp")  # Checks Covenant first
```

## Context Manager

```python
with covenant.governance("deploy", {"service": "api", "env": "prod"}) as g:
    if g.allowed:
        deploy_service()
    elif g.pending:
        print("Awaiting approval...")
```

## Configuration

```python
covenant = CovenantClient(
    base_url="http://localhost:8000",  # API URL
    agent_name="MyBot",               # Auto-registers if needed
    demo_mode=True,                   # Use demo endpoints (default)
    raise_on_block=False,             # Raise on block
    timeout=10,                       # Request timeout (seconds)
)
```
