Principle: Defense in Depth
ZeroClaw implements multiple security layers:- Authentication - Pairing codes, API keys, allowlists
- Authorization - Autonomy levels, approval prompts
- Validation - Command filtering, path checking
- Sandboxing - Process isolation, resource limits
- Monitoring - Audit logs, anomaly detection
Authentication
API Keys
Best practices:Gateway Pairing
Always enable pairing for internet-exposed gateways:1
Start gateway
AB12-CD342
Client pairs
3
Use token
Channel Allowlists
Restrict who can interact with the agent:Authorization
Autonomy Levels
Control tool execution permissions:- Supervised (Recommended)
- Semi-autonomous
- Autonomous
Requires human approval for all tool calls.Use when:
- Running untrusted code
- High-risk operations
- Learning agent behavior
Tool Allowlists
Disable unused tools:Validation
Command Filtering
Block dangerous shell commands:Path Validation
Enforce workspace boundaries:Network Restrictions
Limit outbound connections:Sandboxing
Landlock (Linux)
Filesystem sandboxing with Landlock LSM:Process Limits
Prevent resource exhaustion:Timeout Enforcement
Limit execution time:Monitoring
Audit Logging
Enable comprehensive audit logs:Anomaly Detection
Monitor for unusual behavior:Rate Limiting
Prevent abuse:Network Security
TLS/HTTPS
Always use TLS for public endpoints:Reverse Proxy
Use nginx or Caddy in front of gateway:Firewall Rules
Restrict access to gateway:Secret Management
Environment Variables
Never hardcode secrets:Secret Rotation
Rotate API keys regularly:1
Generate new key
Create new key in provider dashboard
2
Update environment
3
Restart service
4
Verify
5
Revoke old key
Delete old key from provider dashboard
Incident Response
When security incidents occur:1
Isolate
Stop the affected service:
2
Investigate
Review audit logs:
3
Remediate
- Revoke compromised credentials
- Update security policies
- Patch vulnerabilities
4
Restore
Restart with updated configuration:
5
Document
Record incident in security log
Compliance
Data Retention
Configure retention policies:PII Handling
Redact sensitive information:Security Checklist
Before deploying to production:- API keys in environment variables, not config files
- Gateway pairing enabled
- Channel allowlists configured
- Autonomy level set to
supervisedorsemi-autonomous - Dangerous commands blocked
- Workspace path restricted
- TLS/HTTPS enabled for public endpoints
- Rate limiting configured
- Audit logging enabled
- Resource limits set
- Firewall rules applied
- Regular backups configured
- Incident response plan documented