Metadata-Version: 2.4
Name: exogram
Version: 0.1.1
Summary: Official Python Client SDK for the Exogram Authority Runtime
Project-URL: Homepage, https://exogram.ai
Project-URL: Repository, https://github.com/Richard-Ewing/exogram
Project-URL: Documentation, https://exogram.ai/docs/sdk
Author-email: Exogram Team <engineering@exogram.ai>
License: MIT
License-File: LICENSE
Keywords: agent,exogram,governance,llm,runtime,sdk,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Description-Content-Type: text/markdown

# Exogram Python Client SDK

[![PyPI](https://img.shields.io/pypi/v/exogram)](https://pypi.org/project/exogram/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

Official Python Client SDK for the **Exogram Authority Runtime**.

Evaluate action authorization before state changes, commit cryptographic execution tokens to the immutable audit ledger, and store/search records in the Exogram Encrypted Trust Vault.

## Installation

```bash
pip install exogram
```

or using `uv`:

```bash
uv add exogram
```

## Quickstart

### Synchronous Usage

```python
from exogram import Exogram

client = Exogram(token="exo_prod_your_api_key")

# 1. Evaluate authorization before state-changing operation
eval_res = client.evaluate(
    action_type="database_write",
    namespace="production",
    payload={"table": "users", "action": "update"}
)

if eval_res.allowed:
    print(f"Action Allowed! Execution Token: {eval_res.token}")
    
    # Perform database operation...
    
    # 2. Commit execution to audit trail
    client.commit(token=eval_res.token, status="success")
else:
    print(f"Action Blocked by Policy: {eval_res.policy_violation}")
```

### Function Decorator (`@client.governed`)

```python
from exogram import Exogram

client = Exogram(token="exo_prod_your_api_key")

@client.governed(action_type="user_deletion")
def delete_user(user_id: str):
    # This function automatically requests authorization from Exogram
    # before executing, and commits the execution token on completion!
    print(f"Deleting user {user_id}...")

delete_user("usr_123")
```

### Asynchronous Usage (`AsyncExogram`)

```python
import asyncio
from exogram import AsyncExogram

async def main():
    client = AsyncExogram(token="exo_prod_your_api_key")
    
    # Search encrypted trust vault
    results = await client.evaluate(action_type="api_call")
    print(results)

asyncio.run(main())
```

## Environment Variables

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `EXOGRAM_BEARER_TOKEN` | Yes | — | Your Exogram API key or bearer token |
| `EXOGRAM_API_URL` | No | `https://api.exogram.ai` | Exogram API base URL |

## License

MIT — see [LICENSE](LICENSE) for details.
