Add managed permission settings to session startup - #2139
Draft
joshspicer wants to merge 1 commit into
Draft
Conversation
…/resume
Add an optional per-session `managedSettings` field (permissions-only
contract) across all six language SDKs, alongside the existing
`enableManagedSettings` boolean. Hosts can inject enterprise permission
policy at session startup via:
managedSettings.permissions = {
disableBypassPermissionsMode?: "disable",
deny?: string[],
ask?: string[],
allow?: string[],
}
Semantics: startup-only (not persisted), must be re-supplied on resume,
composes restrictively with runtime-managed settings, and older runtimes
fail closed. Wired through hand-written wire types at both create and
resume in Node, Python, Go, .NET, Rust, and Java, plus tests, docs, and
a CHANGELOG entry. Generated RPC mirror types regenerated from the
runtime schema (TS/Python/Go/Rust; C# unaffected as it does not mirror
SessionOpenOptions). No SDK protocol bump.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment on lines
+1470
to
+1472
| // Allow lists operations permitted without prompting. Every declared allow | ||
| // list across managed layers must admit an operation for it to be allowed. | ||
| Allow []string `json:"allow,omitempty"` |
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
SDK hosts need a typed way to inject enterprise permission policy at session startup, independent of the runtime server/device managed-settings fetch path.
What
Adds optional managedSettings.permissions support alongside enableManagedSettings for create and resume across Node, Python, Go, .NET, Rust, and Java. The public types expose bypass disable plus deny/ask/allow rule arrays, and each client forwards the same camelCase JSON shape. Generated RPC mirrors are updated where the language consumes SessionOpenOptions; protocol version remains unchanged because the field is optional.
The setting is startup-only and must be re-supplied on resume. It composes restrictively with runtime-fetched policy.
Validation
Runtime-backed Node/Python tests are locally blocked by a corrupted installed CLI native addon; .NET test execution is locally blocked by the missing .NET 8 runtime, while the SDK builds successfully.