Guardrail

Presets and packs

See what a fresh DefenseClaw install ships: three admission presets and three rule packs named permissive, default and strict, and how to inspect them.

Two separate things ship in three matching names (permissive, default, strict). Change them separately.

LayerWhat it decidesLives inSwitch with
Admission presetWhat happens to a skill, MCP server or plugin at install, by scan severity, plus the guardrail block and alert levelspolicies/<name>.yamldefenseclaw policy activate <name>
Rule packThe rules, judge prompts and suppressions that check prompts, replies and tool callspolicies/guardrail/<name>/defenseclaw guardrail use-pack <name>

policy activate strict does not change guardrail.rule_pack, and use-pack does not change admission. For strict everywhere, run both.

Admission presets

The keys below are preset-file keys. In config.yaml the same values live under admission.defaults.actions, admission.<type>.actions, guardrail.block_at and guardrail.alert_at (Admission).

Knobpermissivedefaultstrict
admission.allow_list_bypass_scantruetruefalse
skill_actions.criticalquarantine + disable + blockquarantine + disable + blockquarantine + disable + block
skill_actions.highnone + enable + nonequarantine + disable + blockquarantine + disable + block
skill_actions.mediumnone + enable + nonenone + enable + nonequarantine + disable + block
scanner_overrides.mcpnoneHIGH, MEDIUM and LOW install and run (CRITICAL follows skill_actions.critical)MEDIUM blocks and quarantines; LOW disables at runtime
scanner_overrides.pluginnoneHIGH blocks and quarantines; MEDIUM installs and runsHIGH blocks and quarantines; MEDIUM installs and runs
guardrail.block_threshold4 (CRITICAL)4 (CRITICAL)2 (MEDIUM)
guardrail.alert_threshold3 (HIGH)2 (MEDIUM)1 (LOW)
guardrail.cisco_trust_leveladvisoryfullfull
watch.rescan_interval_min1206030

Threshold ranks: 1 = LOW, 2 = MEDIUM, 3 = HIGH, 4 = CRITICAL. Human approval is not part of a preset; turn it on with defenseclaw guardrail hilt.

Activate a preset

policy activate copies the preset into config.yaml in one validated write. The gateway never reads the preset file.

In the preset fileIn config.yaml
admission.scan_on_install, allow_list_bypass_scanadmission.defaults.scan_on_install, allow_list_bypass_scan
skill_actionsadmission.defaults.actions and admission.skill.actions
scanner_overrides.<type>admission.<type>.actions
first_party_allow_listadmission.<type>.first_party_allow_list
guardrail.block_threshold, alert_thresholdguardrail.block_at, alert_at, only where the preset's level differs from the selected rule pack's default
guardrail.cisco_trust_levelguardrail.cisco_trust_level (unset for full)
watchwatch.rescan_enabled, watch.rescan_interval_min
cisco_ai_defense.endpoint, api_key_envThe same keys, when the preset carries them
webhooksAdded to webhooks; an existing webhook is never removed or rewritten
  • The preset's hilt, patterns, severity_mappings, firewall, enforcement and audit sections are not copied.
  • Activation replaces the whole admission: section, so re-apply hand-tuned entries afterwards, or use defenseclaw policy edit.
  • It prints each level it changes and warns when the new level blocks or alerts on fewer severities.
  • The running gateway applies it without a restart, except for keys read at start (a listener, guardrail.enabled, guardrail.scanner_mode).
defenseclaw policy list
defenseclaw policy show strict
defenseclaw policy create my-policy -d "Production policy"
defenseclaw policy activate my-policy
defenseclaw policy delete my-policy
defenseclaw policy validate
defenseclaw policy test --verbose
defenseclaw policy edit actions --severity high --runtime disable --policy-name my-policy
Available policies:

  * default [built-in] [active]
      Balanced security policy for standard deployments
    permissive [built-in]
      Permissive policy for development and testing
    strict [built-in]
      Maximum security policy for high-risk environments

  Activate a policy: defenseclaw policy activate <name>
  Show details:      defenseclaw policy show <name>

* and [active] mark the active preset. Without --policy-name, policy edit changes the live policy in config.yaml; with it, it saves a named preset (your copy of a built-in goes to ~/.defenseclaw/policies/<name>.yaml, and policy delete restores the built-in). policy validate checks the policy files and compiles the Rego modules, and policy test runs the Rego unit tests; defenseclaw config validate checks config.yaml.

Block risky plugins at install

The default preset installs a plugin with a MEDIUM finding and lets it run. To block and quarantine those plugins:

defenseclaw policy edit scanner --type plugin --severity medium \
  --install block --file quarantine --runtime disable

This writes admission.plugin.actions.medium. Read it back with defenseclaw config get admission.plugin.actions. Activating a preset again replaces the whole admission section, so make this change after the last policy activate.

Rule packs

PackRules onBlock and alert levelsJudge promptssuppressions.yaml
permissive279 of 287Block CRITICAL, alert HIGH and uppii and tool-injection with higher thresholds; injection follows guardrail.judge.injection12 entries, including all IP findings and some file-inspection PII
default283 of 287Block CRITICAL, alert MEDIUM and upinjection, pii, tool-injection9 entries: private and loopback IPs, platform IDs, system metadata
strict299 of 299Block MEDIUM and up, alert LOW and upThe same three, lower thresholds4 entries; no tool suppressions

All three have the same rule files, the same local-patterns.yaml and the same six sensitive tools. Switching packs does not turn the LLM judge on (guardrail.judge.enabled, default false). On Windows, strict keeps blocking .example, .bak and .template copies of credential files, like the files themselves; default and permissive do not block them. Pack differences rule by rule are on Deterministic detection; the levels and their scopes on Block and alert levels.

Other defaults

KeyDefaultNotes
guardrail.modeobserveRecords, enforces nothing (Set up and modes)
guardrail.hook_fail_modeunsetA per-user install with no saved mode follows its rule pack when the gateway is down. Managed: closed (Set up and modes)
guardrail.judge.enabledfalseTurn on with --judge-model or the setup prompt
guardrail.hilt.enabledfalsemin_severity is HIGH; the key is spelled hilt
guardrail.judge.hook_timeout8sOne judge round trip on a hook
guardrail.judge.timeout30sOne judge call on the proxy lane only (OpenClaw, ZeptoClaw)
guardrail.judge.adjudication_timeout5sThe judge's review of what the rules flagged
guardrail.detection_strategyregex_judgeRules first, then the judge. Runs as regex_only while the judge is off
observability.local SQLite historyalways onLocal history of collected logs

defenseclaw setup guardrail --rule-pack default saves the pack name, not a path, and leaves block_at and alert_at unset, so the pack's levels apply. If config.yaml already has an entry for the connector under guardrail.connectors (defenseclaw setup claude-code or an init that picked several agents writes one), the command saves mode and rule_pack in that entry instead of at the top level. The setup summary and defenseclaw guardrail status show the values the connector runs with; defenseclaw config show --section guardrail shows where they are saved. Per-connector settings are on Several agents.

Inspect the active defaults

defenseclaw config show --section guardrail
defenseclaw config get guardrail.block_at --effective
defenseclaw policy show default
defenseclaw guardrail list-packs
config show optionShows
--section NAMEOne top-level section, such as guardrail or asset_policy
--sourceconfig.yaml as written, with no defaults filled in
--effectiveOnly the observability section, resolved with its defaults
--provenanceWith --effective, where each observability setting comes from
--format yaml|jsonThe output format (default yaml)

config get KEY prints one dotted key; a default prints with a note on stderr. It exits 1 when the key has no value and no default, 2 for an unknown section. With --effective, the level keys, admission[.<type>] and guardrail.cisco_trust_level print the enforced value and its source: (source: pack-default:default) means the rule pack decides, (source: builtin) a shipped default, config:<key> a value you set. defenseclaw-gateway policy show prints what the gateway compiled, and defenseclaw-gateway policy evaluate dry-runs an asset against it.

Reset to defaults

There is no --reset flag. To go back to the defaults:

defenseclaw setup guardrail --rule-pack default --no-human-approval
defenseclaw guardrail hilt off --yes
defenseclaw policy activate default

--no-human-approval without --connector turns off only the global guardrail.hilt; guardrail hilt off --yes turns it off for every active connector.

To reset all user state, copy ~/.defenseclaw first (reset keeps no archive), then run defenseclaw reset and defenseclaw quickstart --connector <name>. With several agents installed, bare quickstart exits with "Multiple connectors detected" and asks for --connector. On Windows copy %USERPROFILE%\.defenseclaw with Copy-Item -Recurse. A managed install resets through its lifecycle commands.