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

LayerMechanism
SDK → GatewayX-AgentTrust-Token header or Bearer JWT
DashboardJWT session
Enterprise SSOSAML via /v1/sso/*
Embedded gatewayAuto-generated bearer token

Critical: Set AUTH_ENABLED=true in all non-dev environments.

Authorization

  • JWT contains tier claim — gateway enforces capability matrix
  • Rate limiting: 60 req/min per agent_id (configurable)
  • Team management via /v1/team/*

Encryption

DataProtection
Audit payloads at restAES-256-GCM (AGENTRUST_AUDIT_ENCRYPTION_KEY)
Archive store (S3/GCS)AES-256 at rest
Audit packagesEd25519 signing (AGENTRUST_SIGNING_KEY)
In transitTLS (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

SecretRotation
AGENTRUST_JWT_SECRETQuarterly minimum
AGENTRUST_KEY / API keysOn team member departure
DATABASE_URL credentialsPer org policy
AGENTRUST_AUDIT_ENCRYPTION_KEYAnnual; requires re-encryption plan

Kill-switch

export AGENTRUST_ENABLED=false

Instant rollback — all governance paths become no-ops.

Examples

Verify auth:

curl -H "X-AgentTrust-Token: $AGENTRUST_KEY" http://localhost:8000/v1/auth/check

Best 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=true always in production
  • Complete AIIA for high-risk domains
  • Follow Incident Response procedures

Common Mistakes

  • AUTH_ENABLED=false in production
  • Exposing gateway port 8000 without TLS/reverse proxy
  • Storing production keys in .env files in git repos
  • Using embedded gateway for regulated production data

Troubleshooting

IssueFix
401 on all requestsVerify token; check JWT secret matches
PII alerts floodingEnable pii_controls policy pack; redact inputs
Chain verify failsDo not manually edit audit database