AgentTrust Edge — the AI Agent Harness. One decorator, full trust enforcement.
Project description
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 agentrust_sdk 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.
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 agentrust_py-0.0.3.tar.gz.
File metadata
- Download URL: agentrust_py-0.0.3.tar.gz
- Upload date:
- Size: 78.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc35650910c5db1d3e203f1f01529f17da227d3d827e4e0842ec659250be0c3f
|
|
| MD5 |
b907aaa381ba259e63701b25f2e6ee80
|
|
| BLAKE2b-256 |
ecdfb28bca90b6bd26006209ed8ad0d33f9a3594a86b4d90a6e90e2509eb0b69
|
File details
Details for the file agentrust_py-0.0.3-py3-none-any.whl.
File metadata
- Download URL: agentrust_py-0.0.3-py3-none-any.whl
- Upload date:
- Size: 75.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab14da8864811ebc1d47bfa22da596bf14d811c8cddb2a41d22489aef0762712
|
|
| MD5 |
e4065039281eca6f3b431200d84745aa
|
|
| BLAKE2b-256 |
fad5f36d14182da05ece1bafa196253497e948af630d9755541e38741bfffcd2
|