Class SessionPermissionsApi
permissions namespace.- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionAPI methods for thepermissions.folderTrustsub-namespace.API methods for thepermissions.locationssub-namespace.API methods for thepermissions.pathssub-namespace.API methods for thepermissions.urlssub-namespace. -
Method Summary
Modifier and TypeMethodDescriptionReplaces selected permission policy fields (rules, paths, URLs, exclusions, allow-all flags) on the session.getMode()Returns the current permission mode for the session.Provides a decision for a pending tool permission request.Adds or removes session-scoped or location-scoped permission rules.Notifies the runtime that a permission prompt UI has been shown to the user.Reconstructs the set of pending tool permission requests from the session's event history.Clears session-scoped tool approvals and, for full resets, exact session-approved paths.Enables or disables automatic approval of tool permission requests for the session.Sets the permission mode for the session.Sets whether the client wants permission prompts bridged into session events.
-
Field Details
-
paths
API methods for thepermissions.pathssub-namespace. -
locations
API methods for thepermissions.locationssub-namespace. -
folderTrust
API methods for thepermissions.folderTrustsub-namespace. -
urls
API methods for thepermissions.urlssub-namespace.
-
-
Method Details
-
configure
@CopilotExperimental public CompletableFuture<SessionPermissionsConfigureResult> configure(SessionPermissionsConfigureParams params) Replaces selected permission policy fields (rules, paths, URLs, exclusions, allow-all flags) on the session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
handlePendingPermissionRequest
@CopilotExperimental public CompletableFuture<SessionPermissionsHandlePendingPermissionRequestResult> handlePendingPermissionRequest(SessionPermissionsHandlePendingPermissionRequestParams params) Provides a decision for a pending tool permission request.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
pendingRequests
@CopilotExperimental public CompletableFuture<SessionPermissionsPendingRequestsResult> pendingRequests()Reconstructs the set of pending tool permission requests from the session's event history.- Since:
- 1.0.0
-
setApproveAll
@CopilotExperimental public CompletableFuture<SessionPermissionsSetApproveAllResult> setApproveAll(SessionPermissionsSetApproveAllParams params) Enables or disables automatic approval of tool permission requests for the session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
setMode
@CopilotExperimental public CompletableFuture<SessionPermissionsSetModeResult> setMode(SessionPermissionsSetModeParams params) Sets the permission mode for the session. `manual` follows the normal approval flow, `assisted` attaches LLM safety recommendations, and `allow-all` automatically approves permission requests. The result returns the authoritative post-mutation mode so callers can update local state without racing the `session.permissions_changed` notification.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
getMode
Returns the current permission mode for the session.- Since:
- 1.0.0
-
modifyRules
@CopilotExperimental public CompletableFuture<SessionPermissionsModifyRulesResult> modifyRules(SessionPermissionsModifyRulesParams params) Adds or removes session-scoped or location-scoped permission rules.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
setRequired
@CopilotExperimental public CompletableFuture<SessionPermissionsSetRequiredResult> setRequired(SessionPermissionsSetRequiredParams params) Sets whether the client wants permission prompts bridged into session events.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
resetSessionApprovals
@CopilotExperimental public CompletableFuture<SessionPermissionsResetSessionApprovalsResult> resetSessionApprovals(SessionPermissionsResetSessionApprovalsParams params) Clears session-scoped tool approvals and, for full resets, exact session-approved paths.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
notifyPromptShown
@CopilotExperimental public CompletableFuture<SessionPermissionsNotifyPromptShownResult> notifyPromptShown(SessionPermissionsNotifyPromptShownParams params) Notifies the runtime that a permission prompt UI has been shown to the user.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-