ATOM AI Governance SDK — pre-execution governance for every AI call
Project description
atomlabs
Pre-execution AI governance for every model you use.
Install
pip install git+https://github.com/qstackfield/atomlabs-sdk.git
Or for local development:
git clone https://github.com/qstackfield/atomlabs-sdk.git
cd atomlabs-sdk
pip install -e .
Requires Python 3.8+ and requests>=2.28.0.
Quick Start
from atomlabs import ATOMClient, GovernanceBlockError
client = ATOMClient(
api_key="lcac_your_key_here",
tenant_id="your-tenant-id"
)
# Make a governed call
result = client.governed_call(
"Analyze this customer complaint...",
provider="groq"
)
if client.is_allowed(result):
print(client.get_output(result))
print(f"RIS Level: {client.get_ris_level(result)}")
print(f"CII Score: {client.get_cii_score(result)}")
# Raise exception if blocked
try:
output = client.governed_call_or_raise(
"Your prompt here",
provider="anthropic"
)
except GovernanceBlockError as e:
print(f"Blocked: {e.reason}")
print(f"RIS: {e.ris_level}, CII: {e.cii}")
Methods
| Method | Description |
|---|---|
governed_call() |
Make a governed AI call, returns full envelope |
governed_call_or_raise() |
Call or raise GovernanceBlockError on block |
is_allowed(result) |
Check if decision is allow |
is_blocked(result) |
Check if decision is block |
get_ris_level(result) |
Get RIS-0 through RIS-4 |
get_cii_score(result) |
Get CII float 0.0–1.0 |
get_output(result) |
Get model response text |
get_drift_score(result) |
Get semantic drift score |
get_traces() |
Get recent governance traces |
get_usage() |
Get tenant usage stats |
health() |
Check platform health |
create_agent() |
Create a governed agent |
list_agents() |
List tenant agents |
run_agent() |
Execute a governed agent run |
get_agent_policy() |
Read agent governance policy |
set_agent_policy() |
Update agent governance policy |
| get_webhooks() | List registered webhook endpoints |
| create_webhook(url, events) | Register a new webhook endpoint |
| delete_webhook(webhook_id) | Remove a webhook endpoint |
| invite_user(email, role) | Invite a team member (admin/developer/viewer/security_officer) |
| list_users() | List all team members for this tenant |
Team Management
# Invite a team member
client.invite_user("alice@company.com", role="developer")
# List current team
users = client.list_users()
for user in users:
print(f"{user['email']} — {user['role']}")
Roles: admin · developer · viewer · security_officer
Webhooks
# Register a webhook endpoint
client.create_webhook(
url="https://your-app.com/atom-webhooks",
events=["governance.block", "governance.warn", "governance.allow"]
)
# List registered webhooks
hooks = client.get_webhooks()
# Delete a webhook
client.delete_webhook(hook_id)
Payloads are signed with HMAC-SHA256. Verify the X-ATOM-Signature header.
Local Models
# Use a local GGUF model (zero data egress)
result = client.governed_call(
"Your prompt",
provider="local",
model="llama-3.2-3b-instruct.Q4_K_M.gguf"
)
Local models run on your infrastructure. No data leaves your environment.
Providers
groq · anthropic · gemini · mistral · openai · local
CLI
# Health check
python -m atomlabs health --api-key lcac_... --tenant-id your-tenant
# Make a governed call
python -m atomlabs call --input "Your prompt" --provider groq \
--api-key lcac_... --tenant-id your-tenant
# Or via environment variables
export ATOM_API_KEY=lcac_...
export ATOM_TENANT_ID=your-tenant
python -m atomlabs health
python -m atomlabs call --input "Your prompt"
python -m atomlabs traces --limit 10
python -m atomlabs agents
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atomlabs-1.0.0.tar.gz.
File metadata
- Download URL: atomlabs-1.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d53c641b5d0c328299f98772b2f7068fb8ffc2b364a3d46b14bc28a33d94dfbb
|
|
| MD5 |
3cdc0c986975b21c280f6bce88c14302
|
|
| BLAKE2b-256 |
d028bf73ae2a55d56b0f7bb065f69271eb8fcd5c9224e6894f7c36aaf95b83a5
|
File details
Details for the file atomlabs-1.0.0-py3-none-any.whl.
File metadata
- Download URL: atomlabs-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ddd5fc329cd9369cfe1acc3c90355eb197034f37e785b861697977bcccd852e
|
|
| MD5 |
43d31b6db62019f71da87eedd9638cf6
|
|
| BLAKE2b-256 |
8bf7e4f0d0603dbfb67d956095fa5611e7733327f834d76d73553d923fd5bcb3
|