Skip to content
Cisco AI Defense logo
CiscoAI Security

defenseclaw policy — DefenseClaw

Overview

defenseclaw policy — Manage DefenseClaw security policies — create, list, show, activate, validate, test, edit.

Reference

Synopsis

defenseclaw policy [OPTIONS]

Subcommands

SubcommandDescription
activateActivate a policy — applies it to config.yaml and syncs OPA data.json.
createCreate a new security policy.
deleteDelete a custom policy.
editEdit policy sections (guardrail, firewall, scanner, actions).
listList all available policies (built-in and custom).
showShow details of a policy.
testRun OPA Rego unit tests.
validateValidate OPA Rego modules and data.json schema.

Description

Manage DefenseClaw security policies — create, list, show, activate, validate, test, edit

defenseclaw policy activate

Activate a policy — applies it to config.yaml and syncs OPA data.json

defenseclaw policy activate <NAME>

Arguments

NameTypeArityRequired
nametext1yes

defenseclaw policy create

Create a new security policy

Create a new security policy.

Examples:

defenseclaw policy create my-strict --from-preset strict

defenseclaw policy create prod --critical-action block --high-action block --medium-action warn

defenseclaw policy create dev --critical-action block --high-action warn --medium-action allow

defenseclaw policy create <NAME>

Arguments

NameTypeArityRequired
nametext1yes

Options

FlagTypeDefaultEnv varRequiredDescription
--description, -dtextnoPolicy description
--from-presetchoice (default, strict, permissive)Sentinel.UNSETnoStart from a built-in preset and customize
--scan-on-install, --no-scan-on-installbooleantruenoScan on install (default: true)
--allow-list-bypass, --no-allow-list-bypassbooleantruenoAllow-listed items skip scan (default: true)
--critical-actionchoice (block, warn, allow)noAction for CRITICAL findings
--high-actionchoice (block, warn, allow)noAction for HIGH findings
--medium-actionchoice (block, warn, allow)noAction for MEDIUM findings
--low-actionchoice (block, warn, allow)noAction for LOW findings

defenseclaw policy delete

Delete a custom policy

defenseclaw policy delete <NAME>

Arguments

NameTypeArityRequired
nametext1yes

defenseclaw policy edit

Edit policy sections (guardrail, firewall, scanner, actions)

Subcommands

SubcommandDescription
actionsEdit severity actions for the global policy.
firewallEdit egress firewall rules (domains, ports, blocked destinations).
guardrailEdit guardrail thresholds, patterns, and severity mappings.
scannerEdit per-scanner-type severity overrides.

defenseclaw policy edit actions

Edit severity actions for the global policy

Options

FlagTypeDefaultEnv varRequiredDescription
--severity, -schoice (critical, high, medium, low, info)Sentinel.UNSETyesSeverity level to configure
--runtimechoice (disable, enable)no
--filechoice (quarantine, none)no
--installchoice (block, allow, none)no
--policy-name, -ptextnoPolicy to edit (default: active policy)

defenseclaw policy edit firewall

Edit egress firewall rules (domains, ports, blocked destinations)

Options

FlagTypeDefaultEnv varRequiredDescription
--default-actionchoice (allow, deny)no
--add-domaintextSentinel.UNSETnoAdd an allowed domain
--remove-domaintextSentinel.UNSETnoRemove an allowed domain
--add-blockedtextSentinel.UNSETnoAdd a blocked destination (IP/host)
--remove-blockedtextSentinel.UNSETnoRemove a blocked destination
--add-portintegerSentinel.UNSETnoAdd an allowed port
--remove-portintegerSentinel.UNSETnoRemove an allowed port
--policy-name, -ptextnoPolicy to edit (default: active policy)

defenseclaw policy edit guardrail

Edit guardrail thresholds, patterns, and severity mappings

Options

FlagTypeDefaultEnv varRequiredDescription
--block-thresholdintegernoMinimum severity rank to block (1=LOW .. 4=CRITICAL)
--alert-thresholdintegernoMinimum severity rank to alert (1=LOW .. 4=CRITICAL)
--cisco-trust-levelchoice (full, advisory, none)no
--add-patterntextSentinel.UNSETnoAdd a guardrail pattern (e.g. --add-pattern injection 'new pattern')
--remove-patterntextSentinel.UNSETnoRemove a guardrail pattern
--set-severity-mappingtextSentinel.UNSETnoSet severity mapping (e.g. --set-severity-mapping injection CRITICAL)
--policy-name, -ptextnoPolicy to edit (default: active policy)

defenseclaw policy edit scanner

Edit per-scanner-type severity overrides

Options

FlagTypeDefaultEnv varRequiredDescription
--typechoice (skill, mcp, plugin)Sentinel.UNSETyesScanner type to override
--severity, -schoice (critical, high, medium, low, info)Sentinel.UNSETyesSeverity level to configure
--runtimechoice (disable, enable)no
--filechoice (quarantine, none)no
--installchoice (block, allow, none)no
--removebooleannoRemove this override (revert to global)
--policy-name, -ptextnoPolicy to edit (default: active policy)

defenseclaw policy list

List all available policies (built-in and custom)

defenseclaw policy show

Show details of a policy

defenseclaw policy show <NAME>

Arguments

NameTypeArityRequired
nametext1yes

defenseclaw policy test

Run OPA Rego unit tests

Run OPA Rego unit tests.

Requires 'opa' binary on PATH. Install: https://www.openpolicyagent.org/docs/latest/#running-opa

Options

FlagTypeDefaultEnv varRequiredDescription
--rego-dirtextnoPath to rego directory (default: bundled policies/rego)
-v, --verbosebooleannoVerbose test output

defenseclaw policy validate

Validate OPA Rego modules and data.json schema

Validate OPA Rego modules and data.json schema.

Checks:

  1. data.json is valid JSON with required top-level keys

  2. All severity levels in actions and scanner_overrides have valid fields

  3. Rego modules compile without errors (requires 'opa' binary or Go daemon)

Options

FlagTypeDefaultEnv varRequiredDescription
--rego-dirtextnoPath to rego directory (default: bundled policies/rego)

Usage

Inspect and activate policies

defenseclaw policy list
defenseclaw policy show default
defenseclaw policy activate default

The Python CLI manages YAML policy profiles. OPA reload is a gateway operation:

defenseclaw-gateway policy reload

Validate and test Rego

defenseclaw policy validate --rego-dir policies/rego
defenseclaw policy test --rego-dir policies/rego --verbose

Use these checks before activating policy changes.

Related