Skip to main content

Overview

NullClaw enforces security at every layer of the stack:
  1. Gateway pairing — One-time code authentication
  2. Channel allowlists — Sender validation
  3. Workspace scoping — Filesystem boundaries
  4. Sandbox isolation — OS-level containment
  5. Encrypted secrets — ChaCha20-Poly1305 AEAD
  6. Audit logging — Signed event trail
  7. Resource limits — Memory, CPU, disk quotas

Security Table

1. Gateway Pairing

How It Works

Configuration

Pairing Flow

  1. Start gateway:
  2. Client pairs:
  3. 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

The owner_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:
Or disable entirely (not recommended):
Disabling workspace scoping allows the agent to read/write any file the process user has access to. Use with caution.

4. Sandbox Isolation

Supported Backends

Configuration

Auto-detection order: Landlock → Firejail → Bubblewrap → Docker → None (fallback)

Docker Sandbox

Restrictions:
  • 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)
Do NOT commit secret.key to git. Backup securely. Loss of this file means encrypted secrets cannot be decrypted.

Encrypted Config Fields

Decrypted at runtime, never written back in plaintext.

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_read fails 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 -rf
  • dd if=/dev/zero
  • mkfs
  • shutdown
  • reboot
  • :(){ :|:& };: (fork bomb)

Configuration

Autonomy levels:
  • full — Allow all commands (ignores allowed_commands)
  • supervised — Allow allowed_commands, block high-risk
  • restricted — Allow allowed_commands only, require approval for medium-risk

Next Steps

Configuration

Full security configuration reference

Architecture

Learn about the security-first design