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 it is an intentional kill-switch
Calls succeed but nothing is governed or auditedGateway unreachable under the default fail-open modeSet AGENTRUST_FAILURE_MODE=closed to make the failure loud, then fix the URL
user="unknown" in every envelopeAgent called with positional argsCall with keyword arguments, or set user_kwarg / input_kwarg
GatewayUnavailableErrorGateway down + closed modeFix gateway or set failure_mode=open
BlockedError on all callsPolicy too strictReview e.reason and validation.failures; adjust the 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 URL, or fail-open masking an outageVerify AGENTRUST_GATEWAY_URL, then curl $AGENTRUST_GATEWAY_URL/health
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 whoami after any key change; curl $AGENTRUST_GATEWAY_URL/health after any URL 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)