Disabling guardrail
defenseclaw setup guardrail --disable is the global rollback. Connector hooks are removed or restored from the hash-checked backup, and agents run without DefenseClaw until you turn the guardrail back on.
setup guardrail --disable sets guardrail.enabled: false and restarts the gateway. The restart removes the DefenseClaw hook entries from each agent's config, or restores the file from a hash-checked backup. Agents then run without DefenseClaw. Your config and the audit database stay.
Turn the guardrail off
-
Turn the guardrail off.
defenseclaw setup guardrail --disableDisabling LLM guardrail... Connector: Claude Code (claudecode) OK Config saved (guardrail.enabled = false) Restarting gateway to run connector teardown... … OK Claude Code connector teardown completeThe command always restarts the gateway, even with
--no-restart, because the restart runs the teardown. It is global. To turn off one agent and keep the rest, usedefenseclaw guardrail disable --connector codex.
Verify the rollback
defenseclaw guardrail status * enabled: no
- Claude Code
key: claudecode
state: disabled (guardrail off)
…
Enable with: defenseclaw guardrail enableOpen the agent's config (for example ~/.claude/settings.json). No DefenseClaw hook entries remain. A file DefenseClaw created is deleted; a file you had before is restored.
defenseclaw doctor shows the guardrail as disabled. It still checks the agents' hooks: a SKIP row says they are removed, which is expected after a disable. If DefenseClaw hooks are still registered, doctor warns and names defenseclaw-gateway restart, which removes them.
OpenClaw has no hooks: doctor checks that the DefenseClaw plugin is gone from ~/.openclaw/extensions/defenseclaw (SKIP when removed, a warning when it is still there) and still checks that the OpenClaw gateway answers. With no guardrail.model set, doctor names defenseclaw setup openclaw to turn it back on, because guardrail enable needs a model for OpenClaw.
Turn it back on
defenseclaw guardrail enable Enabling guardrail for Claude Code (claudecode)
Will restart the gateway so the connector setup runs immediately.
Proceed? [Y/n]:
…
OK Claude Code connector setup complete--yes skips the question. The agents stay configured, so this brings back every agent you did not turn off on its own with guardrail disable --connector.
OpenClaw and ZeptoClaw route model traffic through the guardrail, so for them guardrail enable needs guardrail.model and otherwise stops with Cannot enable: guardrail.model is not set. Run the agent's defenseclaw setup openclaw or defenseclaw setup zeptoclaw command again instead.
defenseclaw guardrail enable --connector <name> runs setup's check of the agent's settings and of the shared hooks/.hookcfg before it saves, and exits 1 with Nothing was changed when one refuses. If the gateway cannot set the agent up, the agent stays disabled: guardrail.connectors.<name>.enabled is false again, the message says so, and the same command can be run after you fix the error.
After setup guardrail --disable, defenseclaw guardrail enable --connector codex changes nothing: it says the guardrail is off for every agent, names defenseclaw guardrail enable and exits 1. If you also turned Codex off on its own, it names both steps: defenseclaw guardrail enable, then defenseclaw guardrail enable --connector codex, because the global enable keeps that agent off. To bring back only one agent, run defenseclaw guardrail enable, then defenseclaw guardrail disable --connector <name> for each agent to keep off. enable --connector codex brings back an agent you turned off with guardrail disable --connector codex.
Remove everything
defenseclaw uninstall removes DefenseClaw itself. See Uninstall.
See also
Changing connectors
Use defenseclaw setup <connector> to add or reconfigure connector wiring, and setup remove <connector> to retire a connector without deleting audit history.
Protected files
The gateway watches SSH authorized keys, shell startup files and user autostart entries. A change made while an agent tool call runs raises a HIGH alert that names the agent session. Restore is an opt-in setting.