Expand description
§AgentTrust SDK
The AgentTrust SDK provides authentication and authorization for AI agents. It enables secure, auditable agent operations through identity management, capability tokens, pre-flight action checks, and telemetry reporting.
§Quick Start
use agenttrustid::{AgentTrustClient, CreateAgentRequest, IssueTokenRequest, AgentTrustGuard};
// Create a client
let client = AgentTrustClient::builder()
.base_url("http://localhost:8080")
.api_key("sk_live_xxx")
.build()
.unwrap();
// Register an agent
let agent = client.agents().create(&CreateAgentRequest {
name: "my-assistant".to_string(),
framework: "langchain".to_string(),
capabilities: vec!["files:read".to_string()],
..Default::default()
}).unwrap();
// Issue an opaque agent token (prefix `at_`)
let token = client.tokens().issue(&IssueTokenRequest {
agent_id: agent.id.clone(),
scope: vec!["files:read".to_string()],
audience: vec!["mcp://filesystem".to_string()],
ttl: 300,
}).unwrap();
println!("Token: {}", token.token);§Guard Pattern
The AgentTrustGuard provides a high-level wrapper for agents using raw
OpenAI/Anthropic SDKs:
use agenttrustid::{AgentTrustClient, AgentTrustGuard};
let client = AgentTrustClient::from_env().unwrap();
let guard = AgentTrustGuard::new(client, "agent-123");
// Before tool calls
guard.check("web_search", "AI news").unwrap();
// After tool calls
guard.report("web_search", true, 1200);
// Telemetry auto-flushed on dropRe-exports§
pub use a2a::A2A;pub use agentcards::AgentCards;pub use approvals::ApprovalsAPI;pub use client::AgentTrustClient;pub use client::AgentTrustClientBuilder;pub use delegations::Delegations;pub use error::AgentTrustError;pub use error::Result;pub use federation::Federation;pub use guard::AgentTrustGuard;pub use guard::AgentTrustGuardBuilder;pub use mcp::Mcp;pub use models::A2ATask;pub use models::ActionCheckRequest;pub use models::ActionCheckResult;pub use models::Agent;pub use models::AgentCard;pub use models::AgentCardSignature;pub use models::AgentCardSkill;pub use models::AgentExtension;pub use models::AgentInterface;pub use models::ApprovalRequestStatus;pub use models::Capabilities;pub use models::CreateAgentRequest;pub use models::CreateDelegationRequest;pub use models::CreateSIEMDestinationRequest;pub use models::Delegation;pub use models::FederationProvider;pub use models::HealthResponse;pub use models::InitSessionRequest;pub use models::IntrospectTokenRequest;pub use models::IntrospectionResult;pub use models::IssueFederatedIDTokenRequest;pub use models::IssueFederatedIDTokenResult;pub use models::IssueTokenRequest;pub use models::IssueWIMSETokenRequest;pub use models::MCPServer;pub use models::Provider;pub use models::RegisterFederationProviderRequest;pub use models::RegisterMCPServerRequest;pub use models::SIEMDeliveryRecord;pub use models::SIEMDestination;pub use models::SecurityScheme;pub use models::SendTaskRequest;pub use models::Session;pub use models::TelemetryEvent;pub use models::TelemetryReportRequest;pub use models::Token;pub use models::UpdateSIEMDestinationRequest;pub use models::V1Task;pub use models::V1TaskStatus;pub use models::VerifyFederatedTokenRequest;pub use models::VerifyFederatedTokenResult;pub use models::VerifyWIMSETokenRequest;pub use models::VerifyWIMSETokenResponse;pub use models::WIMSETokenResponse;pub use models::ATI_TRUST_EXTENSION_URI;pub use sessions::SessionsAPI;pub use streaming::StreamFilter;pub use streaming::Streaming;pub use wimse::Wimse;
Modules§
- a2a
- Agent-to-Agent (A2A) task dispatch via JSON-RPC 2.0.
- actions
- Pre-flight action authorization checks.
- agentcards
- Agent Cards API — generate, fetch, and publish A2A-compatible agent cards.
- agents
- Agent registration and lifecycle management.
- approvals
- Approval management for elevated actions.
- client
- The main AgentTrust ID client and builder.
- delegations
- Capability delegation between agents.
- error
- Error types for the AgentTrust ID SDK.
- federation
- Cross-organization OIDC federation.
- guard
- High-level guard for pre-flight action checks and telemetry.
- mcp
- MCP server registry and proxy operations.
- models
- Data models for the AgentTrust ID SDK.
- sessions
- MCP session management.
- streaming
- SIEM streaming destination management and event subscription.
- telemetry
- Telemetry reporting for agent behavior tracking.
- tokens
- Opaque agent token issuance, introspection, and revocation.
- wimse
- WIMSE workload identity tokens.