Metadata-Version: 2.4
Name: agcms
Version: 0.1.0
Summary: Official Python SDK for AGCMS — AI Governance & Compliance Monitoring.
Author-email: AGCMS <support@agcms.com>
License: Apache-2.0
Project-URL: Homepage, https://agcms.com
Project-URL: Documentation, https://docs.agcms.com
Project-URL: Source, https://github.com/agcms/sdk-python
Project-URL: Changelog, https://github.com/agcms/sdk-python/blob/main/CHANGELOG.md
Keywords: llm,governance,compliance,openai,audit,pii
Classifier: Development Status :: 4 - Beta
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx<1.0,>=0.24
Provides-Extra: verify
Requires-Dist: cryptography>=41.0; extra == "verify"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: respx>=0.20; extra == "dev"

# AGCMS Python SDK

Official Python client for [AGCMS](https://agcms.com) — AI Governance &
Compliance Monitoring. Drop-in replacement for the OpenAI client that routes
every call through your AGCMS gateway, so you get PII redaction, prompt-injection
detection, policy enforcement, and signed audit trails for free.

## Install

```bash
pip install agcms
```

## Quickstart

```python
from agcms import AGCMSClient

client = AGCMSClient(
    base_url="https://api.your-tenant.agcms.com",
    api_key="agc_live_...",
)

resp = client.chat.completions.create(
    model="groq:llama-3.3-70b-versatile",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(resp["choices"][0]["message"]["content"])
print("audit interaction_id:", client.last_interaction_id)
```

## Wrap an existing OpenAI client (3-line integration)

```python
from openai import OpenAI
from agcms import openai_wrap

client = openai_wrap(
    OpenAI(api_key="sk-..."),
    agcms_base_url="https://api.your-tenant.agcms.com",
    agcms_api_key="agc_live_...",
)

# Use it exactly like a regular OpenAI client; AGCMS sits in the middle.
client.chat.completions.create(model="gpt-4o", messages=[...])
```

## Verify an audit bundle (CLI)

```bash
agcms verify path/to/bundle.zip
```

Validates the hash chain, Merkle root, and signing-key chain offline — no
network calls, no AGCMS credentials needed.

## License

Apache-2.0
