Human-in-the-Loop (HITL)
How DefenseClaw turns confirmable findings into native approval prompts when a connector can pause, and what happens on connectors without an ask surface.
Human approval (HITL) pauses a risky call and asks you instead of silently allowing or hard-blocking it. It works in action mode, on agents that can ask: Claude Code, Antigravity, Amp and OpenClaw (the list). CRITICAL findings still block without asking, and alert-only rules never ask.
Guided example · Operator branch is pre-authored
Pause a HIGH-risk Claude Code action for review
A PreToolUse event becomes a native approval request, then follows a deterministic approve or deny branch.
{ "connector": "claudecode", "decision": "approved", "operator_reason": "reviewed synthetic path change", "execution_resumed": true, "severity": "high"}{ "connector": "claudecode", "decision": "approved", "operator_reason": "reviewed synthetic path change", "execution_resumed": true, "severity": "high"}
Operator approved the HIGH-risk action
Audit and resume agent
What DefenseClaw did — and did not do
What it did
- Show a native pause only where the connector supports it
- Use connector capability to choose native ask or a review-only alert
- Audit the chosen branch
What it did not do
- Offer HITL in observe mode
- Offer approval for CRITICAL findings
- Resume a Codex hook from an alert or TUI review
- Execute either branch in the browser
Two runtime outcomes
Only an event with a native ask can pause a call. Any other event takes its connector's fallback at once, and nothing in DefenseClaw can resume the call later. The audit log keeps raw_action: "confirm" either way.
Per-connector behaviour
| Agent | What a confirm verdict does |
|---|---|
| Claude Code | Native ask on PreToolUse. CRITICAL still blocks. The command-line app shows the DefenseClaw reason in its prompt. Claude Cowork shows its own approval card without the reason: see Cowork. |
| Antigravity | Native ask on PreToolUse only. DefenseClaw sends force_ask, which ignores cached Always Allow grants. |
| Amp | Asks in the active foreground thread, on tool.call and before a tool.result reaches the model. A denial, a background thread or an unavailable plugin UI rejects the call or withholds the result. |
| OpenClaw | DefenseClaw approval prompts. They reach chat-origin sessions through the bundled plugin. |
| Copilot CLI | The confirmation blocks, because its hook does not prove an approval prompt is available. VS Code Local uses its own native ask. |
| Codex | An alert and a system message. No native ask surface. |
| Cursor | An attributed alert. DefenseClaw does not enable Cursor's native approval. |
| Hermes | Recorded and alerted. No native approval surface. |
| OpenCode | No native approval surface. The bridge plugin blocks by throwing in tool.execute.before, and a confirm verdict falls back to allow. |
| Devin | Can block documented events, but has no resumable approval. The confirm falls back explicitly. |
| Kiro | Downgraded to an alert. Kiro's ACP permission requests stay native client interactions and may be denied before the client shows them. |
| ZeptoClaw | An explicit fallback. No resumable approval. |
Configure
Before you start
- The agent is in action mode (Turn on blocking).
- This page uses Claude Code. Other agents differ only in where the prompt appears.
On a managed computer, these per-user guardrail and alerts commands refuse. The administrator sets guardrail.connectors.<id>.hilt in the managed config, applies it through the enterprise lifecycle, and checks the result through the managed policy and audit tools. The steps below are for a per-user install.
Steps
-
Turn on approval at HIGH. The command shows the change and asks
Proceed?; press Enter or typey.defenseclaw guardrail hilt on --min-severity HIGHUpdating HILT for active connectors: - Claude Code (claudecode): enabled=false → true, min_severity=HIGH → HIGH - Codex (codex): enabled=false → true, min_severity=HIGH → HIGH Proceed? [Y/n]: y ✓ Config saved (2 connector HILT overrides updated) ✓ The running gateway applies it now.The list names every agent you have set up, so yours will differ. Scripts can supply confirmation on standard input: a newline accepts the default yes, and
yconfirms explicitly. If standard input ends without an answer, the command aborts. Use--yesto skip the prompt. If input is still a terminal but both output streams are piped, the command refuses because the prompt would be hidden; remove the pipe or add--yes.--min-severitytakeslow,medium,highorcritical. On a multi-connector install, add--connector claudecodeto change one agent only. With a single connector, omit--connector. Add--yesto skip the prompt in a script. The running gateway applies the change without a restart. -
Ask Claude Code to run a command that matches a HIGH rule and sends no data:
Run
curl --max-time 2 https://webhook.site/defenseclaw-demo.The rule
C2-WEBHOOK-SITE(HIGH) matches the URL. The Claude Code command-line app shows its own approval prompt with the reason below. Approve to run the command (it makes one empty request), or deny to stop it.DefenseClaw policy needs your confirmation for this action (rule C2-WEBHOOK-SITE: webhook.site (known exfil)).DefenseClaw asks only in Claude Code's Manual mode, its default. In any other permission mode (accept edits, plan, auto, bypass permissions, don't ask) Claude Code may run or deny the call without showing the prompt, so DefenseClaw blocks it and the reason ends with the next step: switch Claude Code to Manual mode (Shift+Tab) and ask again.
Not every HIGH finding asks. Only a finding that can block can pause. Alert-only HIGH rules (such as
PATH-AWS-CONFIG) never ask: the agent shows a notice and the audit log recordsalert.
Decision flow
List view for small screens. Use the expand button to open the drawing.
- Verdict is confirmHIGH finding, HITL on
- Can this event ask?
- Can this event ask?see the table below
- yesAgent pauses and asks
- noNo pause
- No pausealert or block, by connector
- logged forReview it afterwards
- Agent pauses and asksits own permission prompt
- waits forYou approve or deny
- Review it afterwardsaudit log or TUI
- You approve or denythe call runs or stops
Check it worked
List Claude Code's latest alerts, newest first:
defenseclaw alerts --connector claudecode --limit 3Each time Claude Code asked, the list has a claudecode:PreToolUse row with decision=confirm. Find the newest such row and note its number. The confirm row is not always #1. When Claude Code's reply after you approve quotes the URL, that reply is a newer claudecode:MessageDisplay row with decision=alert. Show the confirm row by its number, with the same --connector, so the number refers to the list above. In this example you approved, the reply quoted the URL, and the confirm row is #2. After a deny it is usually #1.
defenseclaw alerts --connector claudecode --show 2Alert #2
ID: 01a16527-4f2e-7a7d-9c1b-5d0e8c2f6a31
Severity: HIGH
Timestamp: 2026-10-22 19:47:02
Action: scan-finding
Target: claudecode:PreToolUse
Decision: confirm
Connector: claudecode
Rule: C2-WEBHOOK-SITE: webhook.site (known exfil)
…Decision: confirm means the gateway asked. Your approve or deny answer is handled inside Claude Code, so DefenseClaw records the finding and the verdict, not who approved. Outside Manual mode Claude Code cannot ask, so the call is blocked and its row shows decision=blocked in the list and blocked on the Decision line of --show. Copilot CLI blocks an action-mode confirmation because its hook does not prove that an approval prompt is available; the audit records block with raw action confirm. Antigravity can deny a confirm without asking in a non-interactive run (-p); its audit still shows confirm.
What HITL is not
The TUI shows alerts and audit events but has no pending-approval queue, so it cannot resume a call. If a call must never run on an agent that cannot ask, make the rule block instead.
Undo
defenseclaw guardrail hilt off