Troubleshooting

Common issues, diagnostics, and resolution steps.

Troubleshooting

Overview

Common issues and fixes when integrating, deploying, and operating AgentTrust.

Why It Matters

Fast diagnosis reduces downtime and prevents silent governance bypass.

Prerequisites

  • agentrust status and agentrust whoami available
  • Gateway logs accessible

Step-by-Step Guide

SDK issues

SymptomCauseFix
Decorator is no-opAGENTRUST_ENABLED=falseSet to true or intentional kill-switch
GatewayUnavailableErrorGateway down + closed modeFix gateway or set failure_mode=open
BlockedError on all callsPolicy too strictReview decision.reasons; adjust policy pack
TierGateErrorFeature above tierUpgrade or remove tier-gated adapter
GatewayVersionErrorSDK/gateway mismatchUpgrade both to compatible versions
Auto-instrument not workingImport orderCall auto_instrument() before framework imports
No audit recordsWrong gateway URLagentrust status; verify URL
Queue not drainingGateway still downagentrust queue replay when reachable

Gateway issues

SymptomCauseFix
401 UnauthorizedInvalid/missing tokenCheck AGENTRUST_KEY and AGENTRUST_API_KEYS
403 ForbiddenTier insufficientUpgrade subscription
503 Service UnavailablePostgres/Redis downcurl /health; check compose logs
High latencyRedis unreachableVerify REDIS_URL
Review queue emptyNo escalate decisionsCheck decision thresholds
Dashboard blankCORS/API URLSet VITE_API_URL to gateway

Deployment issues

SymptomCauseFix
Port 8765 in useEmbedded conflictAGENTRUST_EMBED_PORT=8766
Migration errorsMulti-replica migrateRun Alembic as K8s Job
Sidecar connection refusedWrong portMatch sidecar port to env var

Diagnostic commands

agentrust status
agentrust whoami
agentrust queue status
agentrust audit tail
curl http://localhost:8000/health
curl -H "X-AgentTrust-Token: $AGENTRUST_KEY" http://localhost:8000/v1/auth/check

Enable debug logging

import logging
logging.getLogger("agentrust_sdk").setLevel(logging.DEBUG)

Examples

Test gateway connectivity:

from agentrust_sdk import AgentTrustClient
client = AgentTrustClient()
# First validate call will surface connection issues

Best Practices

  • Run agentrust status after any config change
  • Test failure modes in staging before production
  • Monitor /health and /metrics endpoints
  • Keep SDK and gateway versions aligned

Common Mistakes

  • Debugging without checking AGENTRUST_ENABLED first
  • Assuming embedded gateway has same behavior as full edge
  • Using Python AGENTRUST_KEY in Node.js (use AGENTRUST_API_KEY)