Skip to content

Add "Always allow" option to HITL approval prompts#19

Draft
glean-github-app-oauth[bot] wants to merge 3 commits into
mainfrom
add-always-allow-option
Draft

Add "Always allow" option to HITL approval prompts#19
glean-github-app-oauth[bot] wants to merge 3 commits into
mainfrom
add-always-allow-option

Conversation

@glean-github-app-oauth

Copy link
Copy Markdown

Description

When HITL (Human-In-The-Loop) is enabled, every write action (e.g. slack_send_message) requires manual approval via Accept/Decline buttons. This makes write actions tedious to use repeatedly.

This PR adds an "Always allow" checkbox to the approval prompt. When a user checks it and clicks Accept, the preference is persisted so future calls to that tool skip the approval gate entirely.

Changes

  • New src/tool-permissions-store.ts — Persistent store (following the same pattern as token-store.ts and url-config-store.ts) that saves auto-approved tool names to mcp-tool-permissions.json
  • Modified src/tools/run-tool.ts — Before showing the elicitation prompt, checks if the tool has been previously auto-approved. The elicitation schema now includes an always_allow boolean field rendered as a checkbox in the approval UI
  • Modified src/index.tssetup({reset}) now also clears saved tool permissions
  • 4 new tests covering: schema includes always_allow, preference saved on accept, preference not saved without checkbox, elicitation skipped for auto-approved tools

Testing

  • All 149 tests pass (including 4 new tests for the new functionality)
  • New test cases cover:
    • Elicitation schema includes always_allow boolean field
    • Auto-approve preference is saved when user accepts with always_allow=true
    • Auto-approve preference is NOT saved when user accepts without checking the box
    • Elicitation is skipped entirely for previously auto-approved tools

🤖 Generated by Glean Code Writer
📝 Chat link - https://app.glean.com/chat/61bb6b7594f048fbb44c65d2073ebf10

When HITL is enabled, tool approval prompts now include an "Always allow"
checkbox. Checking it before accepting persists the preference so future
calls to the same tool skip the approval gate entirely.

- New tool-permissions-store persists auto-approved tool names to disk
- Elicitation schema includes an always_allow boolean field
- Auto-approved tools bypass elicitation on subsequent calls
- setup({reset}) clears saved permissions alongside other state
@glean-github-app-oauth glean-github-app-oauth Bot added the glean-code-writer Modified by Glean Code Writer label Jun 21, 2026

@aditya-scio aditya-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.

Why rename from path4 to path5 or path8 to path9

}

export function isToolAutoApproved(toolName: string): boolean {
return loadPermissions().autoApproved.includes(toolName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice!

Comment thread package-lock.json
The peer flag removals were an unintended side effect of running
npm install with a different npm version and are unrelated to the
always-allow feature.
@eshwar-sundar-glean

eshwar-sundar-glean commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Why rename from path4 to path5 or path8 to path9

@aditya-scio You are probably reading the distribution file, that is checked in as part of source to support Plugin delivery in different harnesses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

glean-code-writer Modified by Glean Code Writer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants