agentrust-py
Python SDK for AgentTrust Edge — runtime AI agent governance with zero-config startup and env-only rollback.
Install
pip install "agentrust-py[embedded,retry]"
30-second quickstart
from import harness, embed_gateway
# Optional: start an in-process SQLite gateway (dev / air-gap)
embed_gateway()
@harness
def my_agent(user: str, input: str) -> dict:
"""Decorated agent. Governance happens automatically after each call."""
return {"answer": "42"}
result = my_agent(user="alice", input="What is the meaning of life?")
print(result) # {"answer": "42"} — or BlockedError if policy rejects it
Note on imports: The PyPI package name is
agentrust-py; the Python module isagentrust_sdk. All imports usefrom agentrust_sdk import ....
Rollback (no code change, no image rebuild)
export AGENTRUST_ENABLED=false
# restart process — @harness becomes a no-op identity wrapper
Configuration
Every tunable is an env var — no config file required for basic usage.
| Variable | Default | Purpose |
|---|---|---|
AGENTRUST_ENABLED |
true |
Master kill-switch |
AGENTRUST_GATEWAY_URL |
http://localhost:8000 |
Gateway URL |
AGENTRUST_FAILURE_MODE |
open |
open | closed | queue |
AGENTRUST_TIMEOUT_SEC |
10 |
Request timeout |
AGENTRUST_RETRY_ATTEMPTS |
3 |
Retries (needs [retry]) |
AGENTRUST_KEY |
— | API key |
Deployment ladder (env-only)
# Dev — embedded SQLite, no external services
AGENTRUST_ENABLED=true
# (call embed_gateway() at startup)
# Staging — remote gateway, fail safe
AGENTRUST_GATEWAY_URL=https://agentrust-staging.internal:8000
AGENTRUST_KEY=at_...
AGENTRUST_FAILURE_MODE=closed
# Production
AGENTRUST_GATEWAY_URL=https://agentrust.internal:8000
AGENTRUST_FAILURE_MODE=open
AGENTRUST_RETRY_ATTEMPTS=5
App code is identical across all three environments.
Failure modes
| Mode | Gateway unreachable behaviour |
|---|---|
open (default) |
Log warning, return approve response — agent continues |
closed |
Raise GatewayUnavailableError — agent is blocked |
queue |
Write request to local SQLite buffer; return approve response |
Queue mode note: The local buffer is written but not automatically replayed in the current release. Use
agentrust exportto inspect buffered records. A background drain/replay worker is on the roadmap.
Extras
| Extra | Installs |
|---|---|
embedded |
uvicorn, fastapi — in-process gateway via embed_gateway() |
retry |
tenacity — exponential backoff |
otel |
opentelemetry-sdk, opentelemetry-api — traces + metrics |
langgraph |
LangGraph AgentTrustNode adapter |
crewai |
CrewAI AgentTrustCallback adapter |
full |
All of the above |
Tiers
| Tier | Capabilities |
|---|---|
| OSS | Local schema validation, no API key |
| Free | Evidence, tool trust, auto-decision, local audit |
| Developer | Confidence scoring, risk engine, built-in policies |
| Team | Framework adapters, custom policies, analytics, review queue |
| Enterprise | LLM judge, trust chain, SSO, self-hosted, SOC2 export |
CLI
agentrust init # create ~/.agentrust/config.yaml
agentrust status # tier + gateway reachability
agentrust export ./out.jsonl
agentrust purge --confirm
agentrust disable
License
Apache-2.0. Framework adapters and enterprise features require a paid subscription.
Metadata
Release files for agentrust-py 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentrust_py-0.0.5.tar.gz | 181.6 kB | With provenance | Details for agentrust_py-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentrust_py-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for agentrust_py-0.0.5-py3-none-any.whl |
Total release size: 355.3 kB
Release files / agentrust_py-0.0.5.tar.gz
| Download URL | agentrust_py-0.0.5.tar.gz |
|---|---|
| Size | 181.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c9a2088c6bdcd118d5d0190cf233efd646cddb8e0356d9821994e54f828bca9
|
|
BLAKE2b-256 checksum How to use checksums |
50f6a307a0bcbcbb34a63e87ddfe9969534d696ec254bfc1549012426199a68e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / agentrust_py-0.0.5-py3-none-any.whl
| Download URL | agentrust_py-0.0.5-py3-none-any.whl |
|---|---|
| Size | 173.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28cdb1252d52a049a134c4d0115569eda673048df489133fddb8c36f528f2b9d
|
|
BLAKE2b-256 checksum How to use checksums |
1203bc0dfcfa69faced649bd73e54df2a7f8ce044463b6a19c0e014984ed7915
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for agentrust-py 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agentrust_py-0.0.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.