Skip to main content

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.

Install

pip install agcms

Quickstart

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)

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)

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:

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

Release files for agcms 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agcms 0.1.2
File Size Uploaded
agcms-0.1.2.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agcms 0.1.2
File Interpreter ABI Platform
agcms-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / agcms-0.1.2.tar.gz

Download URL agcms-0.1.2.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5d6e6123a6986a3c927a6593330fc08718713e01b10721c7a96451e04272d391
BLAKE2b-256 checksum
How to use checksums
ad18f80f54f2c0d5616f778db65fc6d1ebf729dde1549d68b181361cee52c6cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / agcms-0.1.2-py3-none-any.whl

Download URL agcms-0.1.2-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7b2f2bb6bf91e2cfddede9f44e00ac09b65d694d067cd0931b49fc362530e5f
BLAKE2b-256 checksum
How to use checksums
c8dc7eccb89a3a8ccc0275d857b82afe67704d72e4123d404036ebcb635450ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page