Skip to content

fix: refuse native ask grants for calls rewritten after review - #70

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-68-native-ask-hardening
Oct 24, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-68-native-ask-hardening

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Closes #68

Summary

  • The allToolsNativeAsks: "review" grant keeps the live execute.before event and re-checks its tool name and input digest inside permission.evaluate. A call that a later hook rewrote (or that changed while the review ran — the digest is now taken before the review) leaves the native ask to a human before the tool runs.
  • execute.after also compares the tool name, not only the input.
  • allToolsNativeAsks: "review" is rejected with mode: "on-ask" and on OpenCode 1.x instead of being silently ignored.
  • README: modes table row, the permission.evaluate paragraph, explicit user ask rules, same-action asks not re-checking resources (documented rather than matched, since a tool may resolve its own resources at run time), the audit log gap, undefined execute.after throw handling and the hook order assumption.
  • Tests: rewritten input/tool before the ask, input changed during review, tool name change after execution, parallel calls in one message, an evaluate event without agent, and the config/V1 rejections.

Not changed: escalate on an extra action still denies (design note in #68), and flipped asks are not audited (documented).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7

dyoshikawa and others added 2 commits October 24, 2026 17:07
The all-tools native ask bridge now keeps the live execute.before event
in its grant and re-checks the tool name and input digest (taken before
the review starts) inside permission.evaluate, so a call that a later
hook rewrote leaves the native ask to a human before it runs.
execute.after also compares the tool name. allToolsNativeAsks "review"
is rejected with mode "on-ask" and on OpenCode 1.x instead of being
ignored, and the README documents same-action resources, explicit ask
rules, the audit log gap and the hook order assumption.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
execute.before now compares the call with the digest taken before the
review and fails closed when it changed, even when no native ask
follows. An input that can no longer be serialized counts as changed,
the post-execution error names the call rather than the input, and the
new tests use the shared helpers and cover the reviewer branch of the
evaluate hook.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
@dyoshikawa
dyoshikawa merged commit 39419d7 into main Oct 24, 2026
1 check passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-68-native-ask-hardening branch October 24, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups from PR #53: native ask bridging hardening, config checks and docs

1 participant