Skip to main content

agentrust-py

PyPI License Python

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 is agentrust_sdk. All imports use from 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 export to 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.6

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

Source distribution (sdist)

Source distribution for agentrust-py 0.0.6
File Size Uploaded Provenance Actions
agentrust_py-0.0.6.tar.gz 190.6 kB With provenance Details for agentrust_py-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentrust-py 0.0.6
File Interpreter ABI Platform Actions
agentrust_py-0.0.6-py3-none-any.whl Python 3 none any Details for agentrust_py-0.0.6-py3-none-any.whl

Total release size: 365.9 kB

Release files / agentrust_py-0.0.6.tar.gz

Download URL agentrust_py-0.0.6.tar.gz
Size 190.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b8a7793ec456d63740f68c8498097836e935097b549875512b1f7e19d01352e1
BLAKE2b-256 checksum
How to use checksums
1baae97670d74bb55f60ea32cc154b03db1de6b1f35497f0d3e0380e61a8e5d8
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 log

Release files / agentrust_py-0.0.6-py3-none-any.whl

Download URL agentrust_py-0.0.6-py3-none-any.whl
Size 175.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39fbd9b3c583a0b88ece5e9797ec2209148f53516584aee866cc5246235e0613
BLAKE2b-256 checksum
How to use checksums
3d6793af60050b4943e9040cb98cff832a7b2a9b66dca6cf34a899a571310f1b
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 log

Security for agentrust-py 0.0.6

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.

Select from 2 files

Attestation for agentrust_py-0.0.6.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 log

A 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.

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