Command generator

Build a Bash or PowerShell defenseclaw setup guardrail command for any connector. Pick mode, scanner backend, detection strategy, rule pack, HITL behaviour, and every advanced knob; copy the result straight into your terminal or CI pipeline.

Use the generator to build the exact defenseclaw setup guardrail --non-interactive command for CI or scripts. Pick the agent, mode, scanner, judge and approval options. The command rewrites itself, and a notes panel warns about combinations that will not behave as you expect, such as human approval in observe mode.

Nothing here runs on your machine. Choose Bash / zsh for macOS and Linux or PowerShell for native Windows, then copy the result into that host's terminal.

Build a command

Output shell

Choose the syntax for the host where you will run the command.

Connector

Pick the agent framework.

Mode

observe logs without blocking. action enforces on configured severities.

Scanner backend

local is zero-key bundled regex. remote calls Cisco AI Defense. both runs the union.

Detection strategy

regex_only is the zero-key default. The judge variants need an LLM key.

Rule pack

Bundled rule-pack profile under ~/.defenseclaw/policies/guardrail/. In observe mode it decides what gets logged.

Human-in-the-Loop (HITL)

HITL only fires in action mode. Switch above to enable.

Claude Code HITL: Claude Code supports native PreToolUse ask prompts. CRITICAL findings still block; HIGH findings can pause for approval.

Advanced

Knobs most operators leave untouched.

defenseclaw setup guardrail — Claude Code / observe / Bash / zsh
defenseclaw setup guardrail \
  --non-interactive \
  --connector claudecode \
  --mode observe \
  --scanner-mode local \
  --rule-pack default \
  --detection-strategy regex_only

Notes & validation

No warnings. The command above should run cleanly with the connector and flags selected.

Claude Code capabilities

Family
hooks
Scope
user
Tool inspection
pre-execution + response-scan
Subprocess policy
none
Native ask
yes
Fail-closed
supported

See /docs/connectors/claudecode for the full per-connector guide.

What the generator covers

  • The agent picker, with native ask, fail-closed and Windows support shown for each.
  • Mode, scanner backend (local, remote, both), detection strategy and rule pack.
  • The judge: model, provider, Bedrock, Vertex AI and Azure settings, TLS options. Only the selected provider's flags are written.
  • Human approval and its minimum severity (turned off in observe mode).
  • --port, --block-message, --workspace, --restart and --disable.

--disable collapses the command to defenseclaw setup guardrail --disable, which is global. For one agent use defenseclaw guardrail disable --connector <id>.

The two choices with no flag are the hook fail mode (use defenseclaw guardrail fail-mode) and judge fallback models (guardrail.judge.fallbacks in config.yaml). Every flag is in the setup guardrail reference.

Check it worked

Run the copied command on the host, then defenseclaw guardrail status. The agent shows enabled with the mode, rule pack and judge you picked. A mismatch means a flag was left out of the command.