Security Philosophy
IronClaw’s security model is built on three principles:- Your data stays yours - All information stored locally, encrypted, never shared
- Zero trust for code - All tools run in isolated sandboxes with explicit permissions
- Defense in depth - Multiple security layers protect against different attack vectors
Multi-Layer Architecture
Security Components
WASM Sandbox
All untrusted tools execute in WebAssembly containers with:- Resource limits: 10MB memory, configurable CPU fuel
- No system access: No filesystem, no raw sockets, no subprocess spawning
- Fresh instances: Each execution creates a new isolated instance
- Explicit capabilities: HTTP, secrets, workspace, and tool invocation are opt-in
Network Isolation
HTTP requests from WASM tools pass through multiple validation layers:- Host allowlist: Only approved domains (e.g.,
api.openai.com) - Path prefixes: Restricted to specific API paths (e.g.,
/v1/) - HTTP methods: GET/POST/etc. explicitly allowed per endpoint
- Secret scanning: Block requests containing leaked credentials
Credential Management
Secrets are never exposed to WASM tools:- Storage: Encrypted with AES-256-GCM using per-secret derived keys
- Master key: Stored in OS keychain or environment variable
- Existence checks: Tools can verify secrets exist without reading values
- Injection: Host injects credentials at request time (WASM never sees plaintext)
- Leak detection: All responses scanned before returning to WASM
Prompt Injection Defenses
External content (emails, webhooks, API responses) is sanitized before reaching the LLM:- Pattern detection: Identify injection attempts (“ignore previous”, “system:”, etc.)
- Content wrapping: Structural delimiters for untrusted data
- Policy rules: Block dangerous patterns (system file access, shell injection)
- Escape sequences: Neutralize special tokens (
<|endoftext|>,[INST], etc.)
Threat Model
Protected Against
Out of Scope
- Physical security: Assumes attacker doesn’t have direct machine access
- OS compromise: Trust the host operating system
- LLM jailbreaking: Defense against adversarial prompts (best effort)
- Supply chain: Trust the Rust toolchain and dependencies
Security Defaults
IronClaw ships with secure defaults:- ✅ All tools run in WASM sandbox (no native code execution)
- ✅ HTTPS-only for HTTP requests (HTTP blocked by default)
- ✅ Secrets encrypted at rest with AES-256-GCM
- ✅ Leak detection enabled for all outputs
- ✅ Prompt injection checking enabled
- ✅ No telemetry or analytics
- ✅ No data sharing with third parties
Audit and Logging
All security-relevant events are logged:RUST_LOG=ironclaw=debug to see all security checks.
Security Configuration
Master Key Setup
The master key encrypts all secrets. Two options: Option 1: OS Keychain (recommended for local use)Safety Configuration
Configure in~/.ironclaw/.env or via environment:
Source Code References
- Safety layer: src/safety/mod.rs:28-177
- WASM runtime: src/tools/wasm/mod.rs:1-134
- Leak detector: src/safety/leak_detector.rs:132-252
- Secrets crypto: src/secrets/crypto.rs:38-141
- Allowlist validator: src/tools/wasm/allowlist.rs:74-164
Next Steps
- WASM Sandbox - Deep dive into sandbox isolation
- Prompt Injection Defense - Pattern detection and sanitization
- Credential Management - Encryption and injection architecture
- Network Security - Allowlisting and rate limiting