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

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.9
File Size Uploaded Provenance Actions
agentrust_py-0.0.9.tar.gz 207.2 kB With provenance Details for agentrust_py-0.0.9.tar.gz

Built distribution (wheel)

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

Total release size: 385.8 kB

Release files / agentrust_py-0.0.9.tar.gz

Download URL agentrust_py-0.0.9.tar.gz
Size 207.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9a14c56d194200f94f83ec7508e7950465018d96e6e3cbc9f5a594024e4079b4
BLAKE2b-256 checksum
How to use checksums
2be14fd0461cb995e1a380f446b314206e4d7ad1fa6ffe1cb0fec7b417b707fc
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 29, 2026.

Transparency log

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

Download URL agentrust_py-0.0.9-py3-none-any.whl
Size 178.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6886d9cd6374eb0be41350ad993c19e397e738b15360e6ce56ce57c7ca5c593c
BLAKE2b-256 checksum
How to use checksums
81ebacdd184584dd0da96065539530bccbd694c9b46fe0926d4ea9f7382a6e0d
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 29, 2026.

Transparency log

Security for agentrust-py 0.0.9

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.9.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 29, 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