Skip to content
Cisco AI Defense logo
CiscoAI Security

Config files — DefenseClaw

Overview

DefenseClaw stores state across several files under ~/.defenseclaw/. This page enumerates every file, what it contains, which process owns it, and what happens when it's missing.

The layout

~/.defenseclaw/
├── config.yaml                   # primary config
├── .env                          # secrets (0600)
├── audit.db                      # SQLite store
├── gateway.jsonl[.gz]            # append-only structured log + rotations
├── policy/                       # operator overlays
│   ├── rego/*.rego
│   ├── data.json
│   └── guardrail/<profile>/
├── snapshots/                    # drift snapshots (skills, mcp, plugins)
├── quarantine/                   # files moved out of agent reach
├── custom-providers.json         # provider domain allow-list overlay
├── extensions/defenseclaw/       # OpenClaw plugin tree
├── scanners/                     # custom scanner registrations
└── sandbox/                      # sandbox-local state (Linux)

File-by-file

FilePurposeOwnerHot-reload
config.yamlPrimary config (gateway, guardrail, audit sinks, webhooks, watcher, firewall)CLI writes; sidecar readspartial; process config may require restart
.envAll secret material (master key, judge API key, sink tokens). Mode 0600.CLI writes; sidecar reads at startno (restart required)
audit.dbSQLite store of every eventsidecar writes; CLI readsn/a
gateway.jsonlAppend-only structured event logsidecar writesn/a
policy/rego/*.regoOperator overlay Rego moduleshuman editsyes (policy reload)
policy/data.jsonOperator overlay data.jsonhuman editsyes (policy reload)
policy/guardrail/<profile>/rules/*.yamlOperator rule-pack overlayhuman editsyes (policy reload)
policy/guardrail/<profile>/suppressions.yamlOperator suppressions overlayhuman editsyes (policy reload)
snapshots/*.jsonPer-artifact drift snapshotssidecar writes; approve command updatesn/a
quarantine/**Quarantined artifactswatcher movesn/a
custom-providers.jsonCustom LLM provider overlay for the guardrail fetch pluginsetup provider add/removeyes
extensions/defenseclaw/OpenClaw plugin treesetup guardrail managesno (restart OpenClaw)
scanners/*.yamlCustom scanner registrationshuman editsyes (policy reload)
sandbox/policy.yamlLinux sandbox policyhuman edits; init --sandbox installsyes (next invocation)

Ownership and permissions

  • Everything under ~/.defenseclaw/ is owned by the installing user.
  • .env is 0600. Violating permissions on .env causes defenseclaw doctor to fail.
  • audit.db is 0600 by default; relaxing permissions is discouraged.
  • policy/ is 0755 on directories, 0644 on files — human-editable.

Backup and restore

Backing up ~/.defenseclaw/ is equivalent to a full state snapshot. For airgapped DR, zip the whole directory (excluding logs/ and snapshots/ if you want a leaner image).

Restore is drop-in: untar into ~/.defenseclaw/ on a fresh host and start the sidecar. doctor confirms integrity.

Overrides via environment variable

DEFENSECLAW_HOME=/opt/defenseclaw

Changes the base directory. Useful for system installs or containerized deployments that want to mount state separately.

Related