Reference
Security architecture
Trust boundaries and controls as implemented.
Trust boundaries
Agents are semi-trusted workloads: they hold a credential scoped to the runtime API and nothing else. Model output is untrusted. People hold administrative power through sessions. The API is the only path to the database.
Controls in this build
| Control | Implementation |
|---|---|
| Passwords | argon2id, 12+ characters, lockout after repeated failures |
| Sessions | random token, SHA-256 stored, httpOnly cookie, idle and absolute expiry |
| CSRF | double-submit cookie + X-CSRF-Token on every mutation |
| RBAC | permissions per role enforced on every endpoint; human-only permission set |
| Tenant isolation | org filter in code + PostgreSQL RLS (ENABLE + FORCE) on a non-owner role |
| Input validation | Pydantic models for every body; JSON Schema for tool parameters; 256 KB body limit |
| Output encoding | React escaping; no raw HTML rendering; CSV formula guard |
| Headers | CSP, X-Frame-Options DENY, nosniff, Referrer-Policy, Permissions-Policy |
| Secrets | HMAC-only storage of API keys and agent credentials; redaction before persistence |
| Rate limiting | in-process sliding windows (Redis backend planned for multi-instance) |
| SSRF | TrustMesh makes no outbound calls to user-supplied URLs (MCP registry is metadata only); OPA and AI provider URLs come from server configuration only |
| Audit | append-only grants + trigger, hash chain, verification |
See also the public security page.