Allowlist with claude_cli: fail closed until hx#182; record provider mode #18

Merged
hermes merged 3 commits from claude-cli-mode into main 2026-11-14 10:32:33 +00:00
Collaborator

Refs #17 (close it when hx#182 is merged and the real-hx test below flips to the denied-by-guard case).

claude_cli must stay usable and hx#182 (bridge through the event bus, tool events) is in progress, so this PR assumes it: allow is accepted in claude_cli mode. The earlier versions (force the direct provider, then refuse) are gone.

Because the assumption cannot be verified from outside, orch fails closed: in a run with a policy it counts the [claude TOOL: ...] lines hx writes into the text stream and the tool_call events. If claude used more tools than hx reported, the run ends needs-human: policy: claude used N tool(s) but hx reported M tool_call event(s) .... A guarded profile is never silently unguarded. With hx#182 the counts match and nothing changes; the denial itself then comes from the existing guard (bridge -> event bus -> orch guard) and the stream check.

  • Telemetry provider_mode (claude_cli | direct | codex; old lines unknown), orch report column, orch eval refuses to compare different or mixed modes (NOT COMPARABLE, exit 1).
  • docs/safety.md: "Provider modes".

Verification: sh tests/all.sh exit 0, 21 unit tests, flake loop 5/5 under load. e2e (fake hx that prints claude tool lines): tools seen and allowed -> done; tool seen and denied -> needs-human policy:, secret never read; line without event (hx without #182) -> policy: claude used 1 tool(s) but hx reported 0; direct mode unaffected. Real hx binary + fake claude: control run without allow (claude really reads the secret, proves sensitivity); with allow on today's hx the run fails closed with could not be enforced and mode claude_cli.

Known gap until hx#182: the check is after the fact. The fake claude has already read the file when orch notices; only hx#182's bridge can stop the call before it runs. The real-hx test documents that and must be changed to "denied by the guard" once #182 is merged (the issue's done-condition).

Refs #17 (close it when hx#182 is merged and the real-hx test below flips to the denied-by-guard case). `claude_cli` must stay usable and hx#182 (bridge through the event bus, tool events) is in progress, so this PR assumes it: `allow` is accepted in `claude_cli` mode. The earlier versions (force the direct provider, then refuse) are gone. Because the assumption cannot be verified from outside, orch fails closed: in a run with a policy it counts the `[claude TOOL: ...]` lines hx writes into the text stream and the `tool_call` events. If claude used more tools than hx reported, the run ends `needs-human`: `policy: claude used N tool(s) but hx reported M tool_call event(s) ...`. A guarded profile is never silently unguarded. With hx#182 the counts match and nothing changes; the denial itself then comes from the existing guard (bridge -> event bus -> `orch guard`) and the stream check. - Telemetry `provider_mode` (`claude_cli` | `direct` | `codex`; old lines `unknown`), `orch report` column, `orch eval` refuses to compare different or mixed modes (`NOT COMPARABLE`, exit 1). - docs/safety.md: "Provider modes". Verification: `sh tests/all.sh` exit 0, 21 unit tests, flake loop 5/5 under load. e2e (fake hx that prints claude tool lines): tools seen and allowed -> done; tool seen and denied -> `needs-human policy:`, secret never read; line without event (hx without #182) -> `policy: claude used 1 tool(s) but hx reported 0`; direct mode unaffected. Real hx binary + fake claude: control run without `allow` (claude really reads the secret, proves sensitivity); with `allow` on today's hx the run fails closed with `could not be enforced` and mode `claude_cli`. Known gap until hx#182: the check is after the fact. The fake claude has already read the file when orch notices; only hx#182's bridge can stop the call before it runs. The real-hx test documents that and must be changed to "denied by the guard" once #182 is merged (the issue's done-condition).
hermes added 1 commit 2026-11-13 19:06:15 +00:00
hermes changed title from Allowlist: force direct provider, record provider mode to Refuse allowlist with claude_cli; record provider mode 2026-11-13 19:14:30 +00:00
hermes added 1 commit 2026-11-13 19:14:32 +00:00
hermes changed title from Refuse allowlist with claude_cli; record provider mode to Allowlist with claude_cli: fail closed until hx#182; record provider mode 2026-11-14 10:22:29 +00:00
hermes added 1 commit 2026-11-14 10:22:31 +00:00
hermes merged commit a76c0ac16f into main 2026-11-14 10:32:33 +00:00
hermes deleted branch claude-cli-mode 2026-11-14 10:32:33 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/orch#18