Security Architecture
AgentOS is built on fail-closed security principles: when a security service is unavailable, the system denies access rather than allowing potentially unsafe operations.Security Features
RBAC
Per-agent capability enforcement with tool-level granularity
Audit Chain
Merkle-linked SHA-256 audit log with tamper detection
Sandboxing
Docker and WASM isolation with fuel limits
Vault
AES-256-GCM encrypted secrets with auto-lock
Fail-Closed Defaults
All security gates deny by default when services are unavailable:Security services failing to respond results in request denial, preventing unauthorized access during outages.
Multi-Layer Protection
1. Authentication
- Mutual Authentication Protocol (MAP): HMAC-SHA256 challenge-response between agents
- Timing-Safe Comparison: Constant-time verification prevents timing attacks
- Nonce Replay Protection: Single-use nonces with 60-second validity window
2. Authorization
- RBAC: Tool-level capability enforcement per agent
- Tool Policy: Allow/deny/approve policies per tool
- Approval Tiers: Auto (read-only), Async (write), Sync (destructive)
3. Input Validation
- Prompt Injection Scanning: 9 regex patterns detect common attacks
- SQL Injection Prevention: Identifier validation on dynamic queries
- Path Traversal Prevention: Safe path resolution in file operations
4. Execution Isolation
- Docker Sandbox: Container-isolated code execution
- WASM Sandbox: wasmtime-based execution with fuel limits
- Process Timeout: Hard timeouts prevent runaway processes
5. Data Protection
- Vault Encryption: AES-256-GCM for secrets at rest
- Auto-Zeroing: Decrypted secrets cleared from memory after TTL
- Taint Tracking: Information flow control (Secret, PII, UntrustedAgent)
6. Audit & Compliance
- Merkle Audit Chain: SHA-256-linked immutable log
- Ed25519 Signing: Cryptographic signatures for manifests
- Tamper Detection: Chain integrity verification
Security Configuration
Security Workers
AgentOS security is implemented across Rust and TypeScript workers:| Worker | Language | Purpose |
|---|---|---|
security (Rust) | Rust | RBAC, audit chain, prompt injection, taint tracking |
security (TS) | TypeScript | Capability enforcement, audit log |
security-map | TypeScript | Mutual authentication protocol |
vault | TypeScript | AES-256-GCM encrypted secrets |
wasm-sandbox | Rust | WASM execution with fuel limits |
Security Workflow
Every agent action flows through multiple security checkpoints:Security Guarantees
What AgentOS Protects Against
✅ Prompt injection attacks — Regex-based pattern detection✅ Unauthorized tool access — RBAC capability enforcement
✅ Resource exhaustion — Fuel limits, timeouts, rate limiting
✅ Audit tampering — Merkle-linked immutable chain
✅ Secrets exposure — AES-256-GCM encryption + auto-zeroing
✅ Replay attacks — Single-use nonces with timing verification
✅ Timing attacks — Constant-time HMAC comparison
What You Still Need to Protect
⚠️ Supply chain attacks — Review dependencies and lock versions⚠️ Social engineering — Train users on security best practices
⚠️ Physical access — Secure infrastructure and credentials
⚠️ Zero-day exploits — Keep systems patched and monitored
CLI Security Commands
Next Steps
RBAC Configuration
Configure per-agent capabilities and tool policies
Audit Chain
Learn how to verify audit integrity and detect tampering
Sandboxing
Configure Docker and WASM sandboxes for code execution
Vault Setup
Securely store API keys and credentials