/** * Compatibility bridge from legacy VS Code settings to Copilot SDK managed * settings. * * Scope and limits, all deliberate: * * - **Restrictions only.** Mappings may add `deny`, `ask`, or the bypass lock; * they never widen what a session may do. In particular no `allow` list is * contributed, even to narrow another rule's reach: the SDK's managed `allow` * is not a scoping hint, since a covered request resolves to `managed_allow`, * which the runtime treats as outright approval and returns without prompting. * The runtime also intersects allow lists only when more than one managed * source supplies one, so a lone list from VS Code would grant blanket * auto-approval and could relax an MDM policy rather than reinforce it. * - **Global layers only.** Values are read from policy, user, and application; * workspace and folder values are ignored, because the agent host is shared by * every window connected to it and one workspace's settings must not leak into * another window's sessions. * - **Approval policies only.** Auto-approval settings contribute only their * enterprise policy value. User and application approval preferences stay on * the root-config path so global and session Allow All can override them. * - **Only what survives translation.** A setting is mapped only when its VS * Code semantics can be expressed exactly in the SDK's rule grammar. Where * they cannot — for example a regular-expression terminal rule — the restriction is skipped rather than approximated, since a * near-miss silently changes what an administrator configured. * - **One deliberate exception, erring more restrictive.** * `chat.tools.eligibleForAutoApproval` marks individual tools ineligible for * auto-approval, but the SDK grammar has no tool-name family ({@link * ManagedRuleFamily} is only `Shell`, `Read`, `Write`, and `Domain`, and an * unknown family rejects the whole document). Rather than skip a genuine * restriction, a policy that marks any tool ineligible maps onto the * family-agnostic bypass lock — coarser and more restrictive, since the lock * is session-wide and does not itself force per-request confirmation (only an * `ask` rule sets `managedApprovalRequired`). A policy that leaves every tool * eligible (all `true`, or empty) expresses no restriction and contributes * nothing. Replace this with a per-tool translation once the grammar gains a * tool-name family. * - **Copilot sessions on a local host.** The renderer sends an empty * contribution to remote hosts, and other agents do not consume managed * settings, so restrictions bridged here do not reach them. Those agents * remain governed by the root-config path (see * `AgentHostAutoApprovePolicyRestrictedConfigKey`). * * New enterprise controls belong directly in the SDK's managed-settings * contract; this table exists only so settings that predate it keep working. */ import { IConfigurationService } from "../../configuration/common/configuration.service.js"; import { ILogService } from "../../log/common/log.service.js"; /** * The restrictions this bridge contributes to the Copilot SDK. There is * deliberately no `allow` list — see the module comment. */ export interface IAgentHostManagedSettingsPermissions { disableBypassPermissionsMode?: "disable"; deny?: string[]; ask?: string[]; limitTo?: string[]; } export declare const managedPermissionsConfigurationIds: string[]; export declare function isManagedSettingsPermissions(value: unknown): value is IAgentHostManagedSettingsPermissions; /** * Combines every mapping's contribution into the single document sent to the * host, deduplicating rules that more than one setting produced. * * Client-injected managed permissions are non-activating, so these rules bind * without forcing unmatched requests to prompt. See the module comment. */ export declare function resolveManagedSettingsPermissions(configurationService: IConfigurationService, logService?: ILogService): IAgentHostManagedSettingsPermissions;