Security
Authentication, API keys, network security, and hardening guidance.
Security
Overview
AgentTrust implements defense-in-depth security: authentication, encryption at rest, audit integrity, PII detection, and tier-based authorization. This page summarizes security controls for operators and developers.
Why It Matters
AI governance systems handle sensitive agent inputs/outputs. Security misconfiguration can expose audit data or bypass policy enforcement.
Prerequisites
- Full edge gateway for production security features
- Enterprise tier for SSO, hash chain, SOC2 export
Step-by-Step Guide
Authentication
| Layer | Mechanism |
|---|---|
| SDK → Gateway | X-AgentTrust-Token header or Bearer JWT |
| Dashboard | JWT session |
| Enterprise SSO | SAML via /v1/sso/* |
| Embedded gateway | Auto-generated bearer token |
Critical: Set AUTH_ENABLED=true in all non-dev environments.
Authorization
- JWT contains
tierclaim — gateway enforces capability matrix - Rate limiting: 60 req/min per
agent_id(configurable) - Team management via
/v1/team/*
Encryption
| Data | Protection |
|---|---|
| Audit payloads at rest | AES-256-GCM (AGENTRUST_AUDIT_ENCRYPTION_KEY) |
| Archive store (S3/GCS) | AES-256 at rest |
| Audit packages | Ed25519 signing (AGENTRUST_SIGNING_KEY) |
| In transit | TLS (operator responsibility) |
Audit integrity
- Append-only ledger with content hashes
- Hash chain verification:
GET /v1/audit/chain/verify(Enterprise) - Ledger hashes are permanent (required for integrity; not erasable)
PII handling
- Policy engine detects SSN, email, API keys, passwords
- PII fields masked in hot store within 24 hours
- Erasure endpoint:
DELETE /v1/audit/executions/{id}/pii - LLM judge receives truncated input/output only (never full payload)
Secret management
| Secret | Rotation |
|---|---|
AGENTRUST_JWT_SECRET | Quarterly minimum |
AGENTRUST_KEY / API keys | On team member departure |
DATABASE_URL credentials | Per org policy |
AGENTRUST_AUDIT_ENCRYPTION_KEY | Annual; requires re-encryption plan |
Kill-switch
export AGENTRUST_ENABLED=falseInstant rollback — all governance paths become no-ops.
Examples
Verify auth:
curl -H "X-AgentTrust-Token: $AGENTRUST_KEY" http://localhost:8000/v1/auth/checkBest Practices
- Never commit API keys or JWT secrets to version control
- Use secret managers (Vault, AWS Secrets Manager, K8s Secrets)
- Enable audit encryption in production
- Run
AUTH_ENABLED=truealways in production - Complete AIIA for high-risk domains
- Follow Incident Response procedures
Common Mistakes
AUTH_ENABLED=falsein production- Exposing gateway port 8000 without TLS/reverse proxy
- Storing production keys in
.envfiles in git repos - Using embedded gateway for regulated production data
Troubleshooting
| Issue | Fix |
|---|---|
| 401 on all requests | Verify token; check JWT secret matches |
| PII alerts flooding | Enable pii_controls policy pack; redact inputs |
| Chain verify fails | Do not manually edit audit database |