Everything you need to integrate TrustLayer into your AI infrastructure.
from agent_trust import AgentTrustClient
client = AgentTrustClient()
# Verify an agent
result = client.verify_agent(
name="Shopping Assistant",
url="https://shop.ai/agent"
)
if result.is_safe:
print("Agent is trusted!")
else:
print(f"Blocked: {result.reasoning}")curl -X POST \
https://api.trustagents.dev/verify/agent \
-H "Content-Type: application/json" \
-d '{
"agent_card": {
"name": "Shopping Assistant",
"url": "https://shop.ai/agent",
"description": "Helps find deals"
}
}'Verify an agent's trustworthiness
{
"agent_card": {
"name": "Shopping Assistant",
"url": "https://shop.ai/agent",
"description": "I help you find deals"
}
}{
"verdict": "allow",
"threat_level": "safe",
"threats": [],
"trust_score": 100.0,
"reasoning": "No threats detected"
}TrustLayer detects 65+ threat patterns across 10 categories, based on research from OWASP, MITRE ATLAS, and security teams at Palo Alto and Lakera.
15 patterns
9 patterns
6 patterns
6 patterns
5 patterns
5 patterns
6 patterns
6 patterns
4 patterns
3 patterns
Trust scores range from 0-100 and are calculated based on multiple factors:
Agents can earn verification badges to increase their trust score and demonstrate legitimacy to other agents and users.
Basic verification. Agent has both email and domain verified.
Domain ownership proven via DNS TXT record challenge.
Email address confirmed via verification link.
// GET /agents/{url}/reputation response with badges
{
"agent_url": "https://shop.ai/agent",
"trust_score": 87.5,
"is_registered": true,
"badges": ["verified", "domain_verified", "email_verified"],
"verification": {
"email_verified": true,
"email_verified_at": "2024-01-10T09:00:00Z",
"domain_verified": true,
"domain_verified_at": "2024-01-12T14:30:00Z"
},
"total_interactions": 230,
"success_rate": 0.95
}from agent_trust import AgentTrustClient
client = AgentTrustClient()
# Start email verification
result = client.verify_email(
agent_url="https://shop.ai/agent",
email="admin@shop.ai"
)
print(f"Check your email: {result.email}")
# User clicks link, or confirm programmatically:
confirmed = client.confirm_email(
agent_url="https://shop.ai/agent",
token="abc123token"
)
print(f"Badge earned: {confirmed.badge}")from agent_trust import AgentTrustClient
client = AgentTrustClient()
# Get DNS challenge
challenge = client.verify_domain(
agent_url="https://shop.ai/agent"
)
print(f"Add TXT record:")
print(f" {challenge.record_name}")
print(f" {challenge.record_value}")
# After adding DNS record, verify:
result = client.check_domain_verification(
agent_url="https://shop.ai/agent"
)
if result.status == "verified":
print(f"Domain verified! Badge: {result.badge}")pip install agent-trust-sdk
Full-featured client with sync and async support. Includes type hints and comprehensive documentation.
Coming soon
npm package with full TypeScript support for Node.js and browser environments.