Skip to main content

AgentTrust Edge — the AI Agent Harness. One decorator, full trust enforcement.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentrust_py-0.0.2a1.tar.gz (79.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentrust_py-0.0.2a1-py3-none-any.whl (75.8 kB view details)

Uploaded Python 3

File details

Details for the file agentrust_py-0.0.2a1.tar.gz.

File metadata

  • Download URL: agentrust_py-0.0.2a1.tar.gz
  • Upload date:
  • Size: 79.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agentrust_py-0.0.2a1.tar.gz
Algorithm Hash digest
SHA256 3a40416806b5067014ab42cb66de276f10ecd0c98905fe7ac91f5383f25c3df1
MD5 40ddea834f47beefad52765db8a60e7c
BLAKE2b-256 83711c49d1fb70b4e8072f7f666106ed4efc5c327dca6bdb522e24d73356661d

See more details on using hashes here.

File details

Details for the file agentrust_py-0.0.2a1-py3-none-any.whl.

File metadata

  • Download URL: agentrust_py-0.0.2a1-py3-none-any.whl
  • Upload date:
  • Size: 75.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agentrust_py-0.0.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2436b6e9e9815ced964bea3a87cee3b2109ed0f203b81c524a386575b5a73a4
MD5 223c6dc4e9eeb72b8f9e0aad58767af2
BLAKE2b-256 e0d0ea1ca1f73cba0a2f6982f5bc5db5380b78c5b7d11db326c9b2d3ad41fc55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page