π¦ WASM Sandbox vs Docker vs VM
Execution isolation is the most important defense when AI runs real code. Three levels of isolation, each with different trade-offs in security, complexity, and performance.
π Isolation Comparison
Choose based on your use case:
- β’WASM: maximum isolation, no access to FS/network, minimal overhead β for code evaluation
- β’Docker: good isolation, controlled access via volumes, low overhead β general use
- β’VM: complete isolation with a hypervisor, high overhead β for compliance and critical data
- β’None: blocklist + audit onlyβfor strictly personal use on a dedicated machine
π‘ Practical Tip
For a personal assistant in development, Docker with read-only volumes is the perfect balance: reasonable security with maximum convenience.
π¦ Approval Gates β 3 Levels
Approval gates are the human-in-the-loop of IronClaw. They define when Jarvis acts on its own and when it needs your explicit confirmation.
π The 3 Levels of Autonomy
Each level defines which actions require approval:
- β’Level 1 - Read-only: only reads data, never writes. No confirmation. For public use.
- β’Level 2 - Supervised: any write or execution requires confirmation via Telegram. Default for personal use.
- β’Level 3 - Autonomous: pre-approved actions run without confirmation, but with a full audit trail. For well-defined routine tasks.
π‘ Practical Tip
Use Level 2 as the default. For specific, well-defined tasks (e.g., daily backup), create an allowlist of actions that operate at Level 3.
πΊ The Complete IronClaw Stack
IronClaw it's not a feature β it's an architecture. Five independent layers that work together to create real, auditable protection.
π The 5 Layers in Detail
Each layer has a single responsibility:
- β’L1 Blocklist: immediately rejects prohibited commands β O(1) cost
- β’L2 Injection Detection: analyzes manipulation patterns β O(n) cost for the text
- β’L3 Approval Gate: asks a human before high-impact actions β ~5s latency cost
- β’L4 Sandbox: runs in an isolated environment β 50-200ms overhead
- β’L5 Audit: records everything immutably β O(1) append cost
π‘ Practical Tip
IronClaw adds ~200-300ms of total latency with all layers active. Imperceptible in conversations. For fast automation loops, consider disabling L3 with a granular allowlist.
π Monitoring and Alerts
Security without monitoring is blind defense. The audit_analyzer.py processes the log periodically and sends alerts when it detects suspicious patterns.
π Monitored Patterns
Anomalies that trigger alerts:
- β’5+ injection attempts in 1 hour β possible active attack
- β’Access to a path outside the sandbox β bypass attempt
- β’More than 100 tool executions in 10 minutes β possible malicious loop
- β’API cost above the threshold β possible billing DoS
- β’Any repeated action='deny' β persistent bypass attempt
π‘ Practical Tip
Set up Telegram alerts so Jarvis can notify you of anomalies. Itβs recursive, but it works β use a separate channel for security alerts.
π§ͺ Testing Your Defenses
Untested defenses aren't defensesβthey're wishful thinking. Red team Jarvis itself verifies that each layer works as expected against real attacks.
π Security Test Suite
Required tests after each change:
- β’test_blocklist.py: tests 50+ variations of dangerous commands
- β’test_injection.py: 20 known injection patterns
- β’test_path_traversal.py: simple traversal, double encoding, symlinks
- β’test_approval_gate.py: verifies that high-risk actions require confirmation
- β’test_audit.py: verifies that the log captures all actions
π‘ Practical Tip
Run the security suite as CI/CD. Any code change that breaks a security test should be blocked automatically.
π Security Playbook
Incidents happen. A documented playbook before the incident is the difference between a controlled response and panic.
π The 6 Playbook Steps
Incident response in order:
- β’1. KILL SWITCH: python -m intelecto stop β disables immediately
- β’2. PRESERVE: cp ~/.intelecto/audit.log /secure/backup/incident-$(date).log
- β’3. ANALYZE: python audit_analyzer.py --mode forensic --output report.txt
- β’4. REVOKE: revoke all potentially compromised API keys
- β’5. RESTORE: python setup.py --restore /secure/clean-backup
- β’6. POST-MORTEM: document what happened, how it was detected, and what changed
π‘ Practical Tip
Practice the playbook in a test environment before you need to use it in production. You don't want to learn the commands during a real incident.
β Module 3.4 Summary
Next:
Track 4: Integrations