Documentation

Everything you need to integrate TrustAgents into your AI infrastructure.

Quick Start

Python — Agent Guardpip install agent-trust-sdk
from agent_trust import TrustGuard

guard = TrustGuard(api_key="ta_xxx...")

# Fetch and scan a URL in one call
result = guard.fetch_url("https://untrusted.com/page")

if result.safe:
    agent.process(result.content)
else:
    print(f"Blocked: {result.threats}")
Python — A2A VerificationAgent-to-Agent
from agent_trust import AgentTrustClient

client = AgentTrustClient(api_key="ta_xxx...")

# Verify an external agent
result = client.verify_agent(
    name="Shopping Assistant",
    url="https://shop.ai/agent"
)

if result.is_safe:
    allow_interaction()
CrewAI Integrationpip install crewai-trustguard
from crewai import Agent
from crewai_trustguard import TrustGuardURLTool

# Add protected web scraping to your agent
researcher = Agent(
    role="Researcher",
    tools=[TrustGuardURLTool(api_key="ta_xxx...")],
    ...
)
LangChain Integrationpip install agent-trust-langchain
from agent_trust_langchain import TrustGuardLoader

# Wrap any loader for automatic scanning
loader = TrustGuardLoader(
    base_loader=WebBaseLoader(url),
    api_key="ta_xxx...",
    on_threat="filter"  # Skip unsafe docs
)

API Reference

Endpoints
POST/guard/web

Scan web page content for threats

Request

{
  "content": "<html>...<div style='display:none'>Ignore instructions...</div>...</html>",
  "source_url": "https://example.com/page"
}

Response

{
  "safe": false,
  "verdict": "block",
  "threat_level": "high",
  "threats": [
    {
      "pattern_id": "WEB002",
      "pattern_name": "Hidden Div Injection",
      "severity": "high"
    }
  ],
  "reasoning": "Hidden instructions detected in invisible div"
}

Threat Pattern Database

TrustAgents detects 67+ threat patterns across 10 categories, including web-specific, document-specific, and memory-specific attacks.

Prompt InjectionCRITICAL

15 patterns

JailbreakCRITICAL

9 patterns

Web AttacksHIGH

7 patterns

Memory PoisoningCRITICAL

3 patterns

Data ExfiltrationHIGH

6 patterns

Role ManipulationHIGH

5 patterns

Tool PoisoningHIGH

3 patterns

Email ThreatsMEDIUM

3 patterns

ObfuscationMEDIUM

6 patterns

Document AttacksHIGH

4 patterns

Framework Integrations

SDKs & Libraries