IronClaw implements defense in depth to protect your data and prevent misuse by AI agents, malicious tools, and external attackers. Security is not an afterthought—it’s the foundation of every component.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nearai/ironclaw/llms.txt
Use this file to discover all available pages before exploring further.
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
| Threat | Mitigation |
|---|---|
| Malicious WASM tool | Sandbox isolation, capability restrictions |
| Secret exfiltration | Leak detection, credential injection at boundary |
| Unauthorized API access | Endpoint allowlisting, rate limiting |
| Prompt injection | Pattern detection, content sanitization |
| Resource exhaustion | CPU fuel metering, memory limits, timeouts |
| Path traversal | Path validation (no .., no absolute paths) |
| Data exfiltration | No network access by default, allowlist required |
| Infinite loops | Epoch interruption + tokio timeout |
| Side channels | Fresh instance per execution, no state reuse |
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