Skip to content
Cisco AI Defense logo
CiscoAI Security

CLI Reference — DefenseClaw

CLI Reference

DefenseClaw ships two CLI binaries. Use <command> --help for detailed usage on any command.

BinaryLanguagePurpose
defenseclawPython (Click)Primary user CLI for scanning, enforcement, and configuration
defenseclaw-gatewayGo (Cobra)Gateway sidecar daemon, code scanning, and policy management

Python CLI (defenseclaw)

Top-Level Commands

CommandDescription
initCreate ~/.defenseclaw, audit database, install scanner dependencies
statusShow environment, scanner availability, enforcement counts, sidecar health
alertsShow recent security alerts (-n to set limit, default 25)
doctorVerify credentials, endpoints, and connectivity for all services

setup

CommandDescription
setup skill-scannerConfigure skill-scanner analyzers, API keys, and scan policy
setup mcp-scannerConfigure MCP scanner analyzers and providers
setup gatewayConfigure gateway sidecar connection settings
setup guardrailConfigure LLM guardrail mode, model, port, and API keys
setup splunkConfigure Splunk HEC, OTLP, and local bridge integration

skill

CommandDescription
skill listList all OpenClaw skills with scan severity and enforcement status
skill scan <target>Scan a skill by name, path, or all for every configured skill
skill search <query>Search the clawhub registry for skills
skill install <name>Install from clawhub/npm/URL, scan, and enforce admission gate
skill info <name>Show detailed metadata, scan results, and enforcement actions
skill block <name>Add to block list (--reason for audit trail)
skill allow <name>Add to allow list (removes from block list)
skill disable <name>Disable at runtime via gateway sidecar
skill enable <name>Re-enable a previously disabled skill
skill quarantine <name>Move files to quarantine directory
skill restore <name>Restore from quarantine to original location

mcp

CommandDescription
mcp listList MCP servers with enforcement status
mcp scan <url>Scan an MCP server endpoint
mcp block <url>Add to block list
mcp allow <url>Add to allow list
mcp set <key> <value>Set an MCP configuration value
mcp unset <key>Remove an MCP configuration value

plugin

CommandDescription
plugin listList installed OpenClaw plugins
plugin scan <name>Scan a plugin for security issues
plugin install <name>Install from local path, npm, clawhub://, or HTTP URL
plugin remove <name>Remove an installed plugin
plugin info <name>Show detailed plugin metadata and scan results
plugin block <name>Add to block list (--reason for audit trail)
plugin allow <name>Add to allow list
plugin disable <name>Disable at runtime via gateway sidecar
plugin enable <name>Re-enable a previously disabled plugin
plugin quarantine <name>Move plugin files to quarantine directory
plugin restore <name>Restore from quarantine to original location

tool

CommandDescription
tool block <name>Block a tool (global or scoped with --source)
tool allow <name>Allow a tool (skip scan gate)
tool unblock <name>Remove from block/allow list
tool listList all tools in the block/allow list
tool status <name>Show block/allow status of a specific tool

policy

CommandDescription
policy create <name>Create a new custom policy
policy listList all policies (built-in and custom)
policy show <name>Display policy details
policy activate <name>Activate a policy (applies to config and OPA data)
policy delete <name>Delete a custom policy
policy validateCompile-check Rego modules and validate data.json
policy testRun OPA Rego unit tests
policy edit actionsEdit severity-to-action mappings
policy edit scannerEdit per-scanner action overrides
policy edit guardrailEdit guardrail thresholds and patterns

aibom

CommandDescription
aibom scanGenerate live AI Bill of Materials from the running OpenClaw environment

Flags: --json (full inventory as JSON), --summary (summary table only), --only <categories> (comma-separated: skills,plugins,mcp,agents,tools,models,memory)

codeguard

CommandDescription
codeguard install-skillInstall the CodeGuard skill into the OpenClaw workspace

Go Gateway CLI (defenseclaw-gateway)

The Go binary runs the sidecar daemon and provides code scanning and policy management.

Daemon

CommandDescription
(no subcommand)Run the sidecar in the foreground
startStart the sidecar as a background daemon
stopStop the running daemon
restartRestart the daemon
statusShow health of all subsystems

Root flags: --token, --host, --port

scan

CommandDescription
scan code <path>Scan source code with CodeGuard static analyzer (--json for machine output)

policy

CommandDescription
policy validateCompile-check Rego modules and validate data.json
policy showDisplay current OPA policy data
policy evaluateDry-run admission policy for a given input
policy reloadHot-reload OPA policies (no restart required)

evaluate flags: --target-type, --target-name, --severity, --findings


Key Flags Reference

defenseclaw init

FlagDescription
--skip-installSkip automatic scanner dependency installation
--enable-guardrailAlso configure and enable the LLM guardrail

defenseclaw setup skill-scanner

FlagDescription
--use-llmEnable LLM analyzer
--use-behavioralEnable behavioral dataflow analyzer
--enable-metaEnable meta-analyzer (false positive filtering)
--use-virustotalEnable VirusTotal binary scanning
--use-aidefenseEnable Cisco AI Defense cloud analyzer
--llm-providerLLM provider: anthropic or openai
--policyScan policy preset: strict, balanced, permissive
--non-interactiveUse flags instead of interactive prompts

defenseclaw setup guardrail

FlagDescription
--modeobserve (log only) or action (block threats)
--scanner-modelocal, remote, or both
--portLiteLLM proxy port (default: 4000)
--disableDisable guardrail and revert configuration
--restartRestart sidecar and OpenClaw after configuration
--non-interactiveUse flags instead of interactive prompts

defenseclaw setup splunk

FlagDescription
--o11yEnable Splunk Observability (OTLP)
--logsEnable Splunk log forwarding
--realmSplunk realm
--access-tokenSplunk access token
--app-nameApplication name for Splunk
--disableDisable Splunk integration
--non-interactiveUse flags instead of interactive prompts