Metadata-Version: 2.4
Name: agcms
Version: 0.1.2
Summary: Official Python SDK for AGCMS — AI Governance & Compliance Monitoring.
Author-email: S Dheeran <dheeran.karna@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://agcms-six.vercel.app
Project-URL: Documentation, https://uip-f4b0bbe5.mintlify.app
Project-URL: Source, https://github.com/Dheeran-git/AGCMS
Project-URL: Changelog, https://github.com/Dheeran-git/AGCMS/blob/master/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
License-File: LICENSE
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"
Dynamic: license-file

# AGCMS Python SDK

Official Python client for **AGCMS** — 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 cryptographically signed audit trails for free.

- **Source:** https://github.com/Dheeran-git/AGCMS
- **Docs:** https://uip-f4b0bbe5.mintlify.app
- **Marketing:** https://agcms-six.vercel.app

## Install

```bash
pip install agcms
```

## Quickstart

```python
from agcms import AGCMSClient

client = AGCMSClient(
    base_url="http://localhost:8000",          # your AGCMS gateway
    api_key="agcms_test_key_for_development",  # or a real per-tenant key
)

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="http://localhost:8000",
    agcms_api_key="agcms_test_key_for_development",
)

# 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
python -m agcms.cli verify path/to/bundle.zip
```

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

## Run AGCMS yourself

The repo ships a 11-service `docker-compose.yml`:

```bash
git clone https://github.com/Dheeran-git/AGCMS.git
cd AGCMS && cp .env.example .env
docker compose up --build --wait
# → gateway on :8000, dashboard on :3000
```

## License

Apache-2.0
