Skip to main content

Trust infrastructure for AI agent transactions

Project description

AgentTrust Python SDK

Trust infrastructure for AI agent transactions. Identity, contracts, escrow, reputation, disputes.

Install

pip install agentrust

Quick Start

from agentrust import AgentTrust

trust = AgentTrust(api_key="at_test_...", agent_id="your-agent-id")

# Verify a counterparty
peer = trust.identity.verify("seller-agent-id")
print(f"Score: {peer['reputation']['score']}")

# Create a contract
contract = trust.contracts.create(
    counterparty="seller-agent-id",
    terms={
        "items": [{"reference": "CARTON-XK200", "quantity": 10000, "unit_price_eur": 0.15, "total_eur": 1500}],
        "delivery": {"deadline_days": 5},
        "payment": {"total_eur": 1500, "method": "escrow", "currency": "EUR"},
        "penalties": {"late_delivery_pct_per_day": 2, "partial_delivery": "pro_rata_refund"},
    }
)

# Escrow payment
trust.payments.escrow(contract_id=contract["id"])

# Complete (releases funds + updates reputation)
trust.contracts.complete(contract["id"], received_quantity=10000)

9 Resources

trust.identity       # verify, register, list_agents, create_agent, suspend, reactivate
trust.contracts      # create, sign, get, complete, cancel, amend, list
trust.payments       # escrow, release, refund, get, list
trust.reputation     # get, history, compare
trust.disputes       # open, add_evidence, get, list
trust.analytics      # overview, benchmarks, leaderboard, discover, search, audit
trust.platform       # health, status, list_keys, create_key, data_export
trust.intelligence   # list_policies, create_policy, evaluate, list_alerts, graph, stream
trust.messaging      # send, inbox, conversations, list_scenarios, run_scenario

Error Handling

from agentrust import AgentTrust, AgentTrustApiError

try:
    trust.contracts.create(counterparty="bad-id", terms={})
except AgentTrustApiError as e:
    print(e.code)        # "not_found"
    print(e.status_code)  # 404
    print(e.request_id)   # "req_abc123"

Sandbox Scenarios

# Run a complete E2E scenario
result = trust.messaging.run_scenario("happy-path")
print(f"Status: {result['status']}, Duration: {result['total_duration_ms']}ms")

for step in result["steps"]:
    print(f"  {'✅' if step['status'] == 'ok' else '❌'} {step['step']} ({step['duration_ms']}ms)")

Available: happy-path, partial-delivery, non-delivery, negotiation, fraud-attempt, policy-cascade

Zero Dependencies

Uses only Python stdlib (urllib). No requests, no httpx. Works everywhere Python 3.10+ runs.

Links

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_sdk-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

agentrust_sdk-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file agentrust_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: agentrust_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for agentrust_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 13a83d1bb8e177f85c9f62721b877c60049ff5cd33303c9acee576c760568c13
MD5 c91ac210c8bd526028c7dbbce827e332
BLAKE2b-256 87d990549105e3b565962f98df9bea5a4ce5d5e07b313eadfe93dc91997e89de

See more details on using hashes here.

File details

Details for the file agentrust_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentrust_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for agentrust_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de7657f4c8f95df1db58816e493591507e37eb6b7ec511c4dae45c26cc3cd763
MD5 343640d64d14800e3242c81a6a34da7a
BLAKE2b-256 460b25b28cec658c09189041a9ae6753a63be893b0ee1f9b962e4fabcb01f36f

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