Skip to content

fix: skip write approval when HITL is off or permissions bypassed - #28

Merged
pragati-agrawal-glean merged 2 commits into
mainfrom
pragati/agent-plugins-hitl-policy/fix-session-approval
Sep 28, 2026
Merged

pragati-agrawal-glean merged 2 commits into
mainfrom
pragati/agent-plugins-hitl-policy/fix-session-approval

Conversation

@pragati-agrawal-glean

@pragati-agrawal-glean pragati-agrawal-glean commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add one shared approval guard: when HITL is off or the existing permission-mode lookup reports bypassPermissions, execute without approval lookup, elicitation, or preference writes.
  • Apply the same guard to upstream elicitation capability/forwarding, so the backend cannot add an approval form in the opt-out path.
  • Keep this to 3 files (+45/-13). No new hook protocol, schema fields, session plumbing, or persistence changes. The existing missing-session-ID detection limitation is unchanged; unknown mode still requires approval when HITL is on.

Testing

  • npm run typecheck:bundle; npm run test:bundle — 432 tests passed.
  • npm test — build and validation passed for Claude, Cursor, and Codex.
  • Focused guard tests cover HITL off/unset, bypass, normal, and unknown modes; opt-outs issue only run_tool, with no approval lookup, prompt, or preference write.
  • Manual Claude Code verification against a live backend. No real messages, events, or tool-preference changes were made during testing.

— sent via Glean Tau

Use request-local Claude hook context for bypass mode and keep run_tool approval in the local plugin. Disable approval lookup and upstream forms when opted out, without saving an Always Allow preference.

— sent via Glean Tau
Remove the session-context protocol and broad test harness. Reuse the existing permission-mode lookup to skip local and upstream approval when HITL is off or the reported mode is bypassPermissions.

— sent via Glean Tau
@pragati-agrawal-glean pragati-agrawal-glean changed the title fix: honor HITL opt-outs without persisting approvals fix: skip write approval when HITL is off or permissions bypassed Sep 28, 2026
@pragati-agrawal-glean
pragati-agrawal-glean marked this pull request as ready for review September 28, 2026 15:19

@garvit-scio garvit-scio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patched my local cached pluin copy with this. confirming it works

@pragati-agrawal-glean
pragati-agrawal-glean merged commit aafc84d into main Sep 28, 2026
1 check passed
@pragati-agrawal-glean
pragati-agrawal-glean deleted the pragati/agent-plugins-hitl-policy/fix-session-approval branch September 28, 2026 16:14

@eshwar-sundar-glean eshwar-sundar-glean left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eshwar-sundar-glean

Copy link
Copy Markdown
Contributor

Make sure to check why this happened

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.

3 participants