Skip to content
Docs

Security Architecture

Encryption: OAuth tokens (AES-256-GCM), API keys (AES-256-GCM since 2.0.412; older rows written as AES-256-CBC still decrypt), passwords (bcryptjs), sessions (JWT), backups (AES-256-GCM + PBKDF2), cloud creds (encrypted in DB), SAML certs + LDAP bind passwords (encrypted in DB), chat session files (AES-256-GCM, per-turn IV), request/response body archive (AES-256-GCM, per-file IV — see Section 35.1). Network: HTTPS enforcement, Helmet.js headers, CORS, IP allowlisting (CIDR), request size limits (50MB on /v1/*), Redis TLS. HTTP/3 hardening: every response path that proxies upstream traffic strips Alt-Svc and Alternate-Protocol headers so browsers don’t cache a QUIC endpoint and bypass the TCP-only MITM on the next request (see Section 30.3). Private VPC / no direct internet egress: AgentWatch can deploy fully inside a private VPC with no direct internet egress. All outbound LLM calls route through an explicit egress proxy (Zscaler integration, Section 5.3) which can do TLS inspection of the gateway → provider channel. Endpoint: Local CA in OS trust store, CRL Distribution Point endpoint, signed installers (Apple Developer ID + notarization on macOS; Authenticode on Windows). Sensitive log scrubbing: usage previews of DLP-actioned (blocked/redacted) requests are scrubbed of raw PII, and event-pipeline prompt/response previews get basic PII masking (email/phone/SSN/card) when PII redaction is enabled for capture. Application logs are not DLP-scanned. Secret storage: API keys, OAuth tokens, SAML certificates, LDAP bind passwords, cloud creds — all encrypted at rest in the primary DB with a key from ENCRYPTION_KEY.

Encryption keys at rest (2.0.412): ENCRYPTION_KEY encrypts database secrets; CHAT_ENCRYPTION_KEY encrypts conversation history (when unset, a domain-separated key is derived from ENCRYPTION_KEY with HKDF-SHA256); BODY_ARCHIVE_KEY_HEX encrypts archived bodies (falls back to the conversation key). When ENCRYPTION_KEY is unset, a 256-bit key is generated once and stored in the database (system_settings encryption_key): insert-if-absent then re-read, so racing replicas adopt one value, and an existing key is never overwritten. It persists wherever the encrypted rows persist (any database, any volume layout), but it travels with database backups — a secret-manager ENCRYPTION_KEY protects a stolen backup better and is recommended. Without ENCRYPTION_KEY, an unreadable database at boot is fatal (retried, then the server stops) rather than a throwaway key. When ENCRYPTION_KEY is added later, the database key stays a read key. Before 2.0.412 secrets fell back to a fixed public passphrase (exported by start.sh) and conversation history used a key compiled into the product; both are now read-only legacy keys, so data written by older versions still decrypts and nothing is written with them again. New conversation lines are v2:<kid>:iv:tag:ct, where kid identifies the key that wrote them. Provider keys under a non-current key (the old public key, or the database key once ENCRYPTION_KEY is set) are re-encrypted at boot (verified round trip; undecryptable rows untouched; AW_REENCRYPT_LEGACY_SECRETS=0 disables it). Conversation files are not rewritten. Never replace an operator key on a running deployment without a migration plan.

External vault managers (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, CyberArk) are not natively integrated as of v2.0.105 — see Section 43.1.