Overview
NullClaw enforces security at every layer of the stack:- Gateway pairing — One-time code authentication
- Channel allowlists — Sender validation
- Workspace scoping — Filesystem boundaries
- Sandbox isolation — OS-level containment
- Encrypted secrets — ChaCha20-Poly1305 AEAD
- Audit logging — Signed event trail
- Resource limits — Memory, CPU, disk quotas
Security Table
1. Gateway Pairing
How It Works
Configuration
Pairing Flow
-
Start gateway:
-
Client pairs:
-
Use bearer token:
Pairing codes are single-use and expire after 5 minutes (configurable). Bearer tokens persist until revoked.
2. Channel Allowlists
Every channel enforces a sender allowlist:Allowlist Rules
- Empty allowlist (
[]) → Deny all inbound messages - Wildcard (
["*"]) → Allow all (explicit opt-in) - Exact match → Case-insensitive username/ID match
Special Cases
Nostr
Theowner_pubkey is always allowed regardless of dm_allowed_pubkeys:
Signal
Supports phone numbers and UUIDs:3. Workspace Scoping
Default Behavior
All file operations are restricted to~/.nullclaw/workspace/ by default:
Path Validation
Expanding Access
Allow specific paths outside workspace:4. Sandbox Isolation
Supported Backends
Configuration
Docker Sandbox
- No network by default
- Read-only rootfs (workspace mounted as writable volume)
- Memory limit enforced
- Auto-removed on exit
Landlock Example
5. Encrypted Secrets
SecretStore
API keys are encrypted at rest with ChaCha20-Poly1305 AEAD:Configuration
Key Management
Key file format: 32-byte random key (256-bit)Encrypted Config Fields
6. Audit Logging
AuditEvent Structure
Configuration
Example Log Entry
Querying Logs
7. Resource Limits
Configuration
Tool-Level Limits
Enforcement
- Shell timeout: Subprocess killed after N seconds
- Output truncation: STDOUT/STDERR capped at max_output_bytes
- File size:
file_readfails if file > max_file_size_bytes - HTTP response: Downloads stopped after max_response_size bytes
Command Risk Classification
Risk Levels
High-Risk Commands
Blocked by default (configurable):rm -rfdd if=/dev/zeromkfsshutdownreboot:(){ :|:& };:(fork bomb)
Configuration
full— Allow all commands (ignoresallowed_commands)supervised— Allowallowed_commands, block high-riskrestricted— Allowallowed_commandsonly, require approval for medium-risk
Next Steps
Configuration
Full security configuration reference
Architecture
Learn about the security-first design