SDK
SDK
Python and TypeScript SDK integration patterns, clients, and decorators.
Overview
The AgentTrust SDK provides multiple integration patterns for governing agent executions:
| Pattern | Best for |
|---|---|
| @harness decorator | New agent functions |
| Sync Client | Direct validate/audit calls |
| Async Client | Async frameworks |
| Auto-Instrumentation | Legacy codebases |
| Failure Modes | Production resilience |
| Queue Replay | Air-gap and offline operation |
Quick Example
from agentrust_sdk import harness, embed_gateway
embed_gateway()
@harness
def my_agent(user: str, input: str) -> dict:
return {"answer": "processed"}
result = my_agent(user="alice", input="Transfer $500")