Integrations
Claude Agents Integration
Claude Agents SDK wrapper and agent loop governance.
Claude Agents Integration
Overview
ClaudeAgentGuard wraps Claude Agent SDK client loops to validate outputs before they are returned to users or trigger tool calls.
Tier: Team+
Why It Matters
Claude Agents run autonomous tool-use loops. Governance must intercept loop outputs without breaking the agent's tool execution flow.
Prerequisites
pip install agentrust-sdk
# Team+ API key
# Claude Agents SDK installed in your environmentStep-by-Step Guide
from agentrust_sdk import ClaudeAgentGuard
guard = ClaudeAgentGuard(agent_id="claude-agent")
# Wrap client or agent loop
with guard.wrap(client):
result = client.run(prompt="Analyze this document")The guard validates each loop iteration's output through the AgentTrust gateway.
Examples
See agentrust_sdk/agentrust_sdk/adapters/claude_agents.py for implementation details.
Best Practices
- Wrap at the client level for consistent coverage
- Use
block_on_block=Truefor sensitive document processing - Combine with PII policy pack for customer data
Common Mistakes
- Team tier required — OSS key will not activate adapter
- Wrapping too late (after output already delivered)
Troubleshooting
| Issue | Fix |
|---|---|
TierGateError | Upgrade to Team |
| Loop interrupted | Check if block outcome is expected; review policy |