Expose managed approval requirement on permission requests - #2080
Draft
joshspicer wants to merge 1 commit into
Draft
Expose managed approval requirement on permission requests#2080joshspicer wants to merge 1 commit into
joshspicer wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Exposes managed approval requirements to TypeScript permission handlers.
Changes:
- Adds optional
managedApprovalRequiredmetadata. - Adds package-root type coverage.
Show a summary per file
| File | Description |
|---|---|
nodejs/src/types.ts |
Overlays managed approval metadata onto permission requests. |
nodejs/test/session-event-types.test.ts |
Verifies the field is publicly importable. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Medium
Comment on lines
+1106
to
+1107
| export type PermissionRequest = GeneratedPermissionRequest & { | ||
| readonly managedApprovalRequired?: boolean; |
Comment on lines
+1101
to
+1103
| * `managedApprovalRequired` indicates that managed policy requires an explicit | ||
| * user decision. Hosts should bypass automatic approval and present their | ||
| * normal confirmation UI. |
Comment on lines
+1105
to
+1106
| import type { PermissionRequest as GeneratedPermissionRequest } from "./generated/session-events.js"; | ||
| export type PermissionRequest = GeneratedPermissionRequest & { |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 18f1bbc1-6001-43e2-b293-724505087f6a
SteveSandersonMS
force-pushed
the
joshspicer/managed-approval-required-sdk
branch
from
July 28, 2026 16:26
13c3d37 to
03184d2
Compare
Contributor
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (1)
nodejs/src/types.ts:1108
- This overlay only updates the standalone type and
PermissionHandler; the publicSessionEvent/PermissionRequestedDatatypes still come from the generated schema, wherepermissionRequestlacks this property. Consequently, an event-only host (the documented path whenonPermissionRequestis omitted) cannot compileevent.data.permissionRequest.managedApprovalRequiredeven though the runtime sends it. Please overlay thepermission.requestedevent payload as well so every public permission-request surface exposes the metadata.
export type PermissionRequest = GeneratedPermissionRequest & {
readonly managedApprovalRequired?: boolean;
};
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Enterprise-managed permission
askrules must be answered by a person. SDK hosts need to distinguish those requests from ordinary permission prompts that client settings may auto-approve.This is the public SDK contract for:
The initial runtime scope supports managed Shell, Read, Edit, and URL selectors. Tool and MCP selectors are deferred.
What
Adds optional
managedApprovalRequiredmetadata to the public TypeScriptPermissionRequesttype.When true, hosts should bypass automatic approval and present their normal confirmation UI. The runtime remains authoritative for the managed verdict and approve-once-only behavior; the flag is request metadata, not an administrator setting.
The field is overlaid at the hand-authored public type boundary because the runtime schema change has not shipped in a published CLI package yet. This avoids committing unrelated generated-schema drift. A later normal schema regeneration can absorb the field into generated bindings without changing the public TypeScript shape.
Validation
npm run buildnpm run typechecknpm test -- session-event-types.test.ts— 5 passednpm run format:checknpm run lint— 0 errors; 3 pre-existing warnings in unrelated tests