policy-and-managed-settings
Use whenever adding, modifying, or reviewing any Copilot, agent, LLM, AI, tool, permission, sandbox, MCP, model, telemetry, feature-gate, setting, configuration, or enterprise control—especially anything an organization or administrator may need to manage. Start here to decide whether it belongs in runtime managed settings, a typed SDK contract, VS Code configuration policy, extension policy, or a split implementation. Run on every new Copilot/agent/LLM control and ANY change that adds a `policy:` field.
- License 许可
- MIT
- 所属仓库
- microsoft/vscode
- 最近更新
- 2026-11-11
- Stars
- ★ 20w
- Forks
- 4.4w
01 前言 Front Matter
- name
- policy-and-managed-settings
- description
- Use whenever adding, modifying, or reviewing any Copilot, agent, LLM, AI, tool, permission, sandbox, MCP, model, telemetry, feature-gate, setting, configuration, or enterprise control—especially anything an organization or administrator may need to manage. Start here to decide whether it belongs in runtime managed settings, a typed SDK contract, VS Code configuration policy, extension policy, or a split implementation. Run on every new Copilot/agent/LLM control and ANY change that adds a `policy:` field.
02 资源文件 7
- 参考文档extension-policy.md1.2 KB
- 参考文档github-managed-settings.md6.1 KB
- 参考文档legacy-permission-policy.md2.2 KB
- 参考文档local-testing.md1.8 KB
- 参考文档policy-support-maintenance.md3.3 KB
- 参考文档sdk-runtime-policy.md8.1 KB
- 参考文档vscode-policy.md2.6 KB
03 SKILL.md 正文
Enterprise Policy and Managed Settings
Route a control by where the governed behavior is implemented, not by who requested it. Most Copilot agent controls belong in the runtime, not VS Code.
| Governed behavior | Destination | Guide |
|---|---|---|
| Copilot runtime: tools, shell, files, URLs, MCP, plugins, subagents, permissions, sandbox, runtime model/telemetry | Runtime managed setting (SDK type only if the host owns the value) | sdk-runtime-policy.md |
| VS Code editor/workbench | VS Code configuration policy: |
vscode-policy.md |
| Extension-contributed setting | extensionConfigurationPolicy in vscode-distro |
extension-policy.md |
| Independent runtime and editor behavior | Split: runtime setting for agent behavior, VS Code policy for editor behavior only | both of the above |
| Existing permission policy introduced before 1.133 | Bounded migration only | legacy-permission-policy.md |
Supporting references:
- github-managed-settings.md: projecting managed settings into VS Code policy (channels, precedence, key declaration).
- policy-support-maintenance.md: Agent Host support inventory and Policy Diagnostics readiness.
- local-testing.md: mock policy server.
Rules
- Runtime enforcement is authoritative. Do not duplicate runtime parsing, matching, or security decisions in VS Code, and never substitute editor UI suppression for runtime enforcement.
- New Copilot controls go directly in the shared managed-settings schema/SDK contract. Do not add a VS Code setting to mirror or bridge one.
- Closed to new properties (existing entries stay for compatibility): GitHub token/account
IPolicyDatafields consumed byAccountPolicyService, the legacy VS Code setting bridge, and pre-1.133 permission translation. - Split controls: add the runtime capability first and keep existing editor behavior until it ships. Keep both projections semantically aligned; keep permission authorization separate from sandbox containment; make create/resume/removal/peer/subagent/cloud behavior explicit.
- Every VS Code or extension policy change needs an
agentHostPolicySupportentry andpnpm run export-policy-data. Never hand-editbuild/lib/policies/policyData.jsonc. - Never log raw enterprise rules/values or add telemetry containing them.
- Trust source and tests over these docs. Document decisions and invariants; link to source instead of copying it.
Policy-disabled UI
Prefer an option that stays visible but disabled, with the briefcase managed-policy indicator, a localized reason, and an accessible next step, over silently hiding it (design guidance). Use policy provenance to distinguish prohibition from unsupported, feature-gated, or pending states. Presentation never changes authorization: a disabled option must not re-enter the runtime's allowed set or bypass create/resume/write validation. Test policy refresh/removal, keyboard and pointer activation, and stale menus; preserve AI-hiding behavior.
04 同仓库更多 Skills
sweeper-query
Answer natural-language questions about the VS Code Sweeper's published issue index (index-<name>.json for microsoft/vscode and the enrolled family repos) — which issues are agent-ready to implement or plan, what the sweeper proposed for an assignee or area, whether the sweeper knows a report as a duplicate, the highest-value open bugs in a lane — and, for one issue, the review's full record (evidence with file citations, fix brief, proposed comment). Use ONLY when the request explicitly names the sweeper — "sweeper", "vscodesweeper", "sweeper-query", a sweeper verdict, record, brief or index, an agent-ready issue — or asks what "the sweeper" found, proposed or knows. Do NOT use for general questions about issues, duplicates, priorities or ranking that do not mention the sweeper. Read-only; discovery only.
update-skills
Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says "learn!", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.
update-pr
Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.
sync
Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.
sync-upstream
Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.
merge
Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.