feat: add Copilot CLI governance package#2272
Conversation
PR Review Summary
Verdict: ❌ Changes needed |
There was a problem hiding this comment.
Pull request overview
TL;DR: 2 blockers, 1 warning. Fix #1 and #2 and this ships.
| # | Sev | Issue | Where |
|---|---|---|---|
| 1 | Block | bin/agt-copilot.mjs is referenced but missing (breaks npx + npm run check) |
agent-governance-copilot-cli/package.json |
| 2 | Block | realpathSync runs before existence checks, causing hard failure instead of a controlled “SDK not found” error |
agent-governance-copilot-cli/.../lib/sdk-loader.mjs |
| 3 | Warn | npm-agentmesh-mcp-proxy selector isn’t whitelisted in Python resolver’s NPM_INPUTS, producing an “Unknown package” error annotation |
.github/workflows/publish.yml |
#1: Add the missing bin/agt-copilot.mjs entrypoint (or update bin/scripts to point at the real entrypoint).
#2: Make SDK path canonicalization tolerant of missing files (defer/wrap realpathSync so missing vendored SDK yields a readable error).
Changes:
- Adds a production-style Copilot CLI governance installer package (
@microsoft/agent-governance-copilot-cli) plus a runnable example and scenario corpus. - Adds hardened policy profiles/default policy for Copilot CLI prompt/tool/tool-output governance.
- Updates docs + CI/publish/ESRP plumbing to include the new package and Node 22 handling.
Reviewed changes
Copilot reviewed 48 out of 50 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Adds Copilot CLI surface + install row |
mkdocs.yml |
Adds Copilot CLI package + tutorial nav entries |
examples/copilot-cli-agt/README.md |
Documents example + production install path |
examples/copilot-cli-agt/package.json |
Example Node test/check scripts |
examples/copilot-cli-agt/test/policy-engine.test.mjs |
Example policy/runtime alignment tests |
examples/copilot-cli-agt/scripts/install-extension.sh |
Bash install/update wrapper |
examples/copilot-cli-agt/scripts/install-extension.ps1 |
PowerShell install/update wrapper |
examples/copilot-cli-agt/config/default-policy.json |
Example default policy baseline |
examples/copilot-cli-agt/config/profiles/strict.json |
Example strict profile |
examples/copilot-cli-agt/config/profiles/balanced.json |
Example balanced profile |
examples/copilot-cli-agt/config/profiles/advisory.json |
Example advisory profile |
examples/copilot-cli-agt/.github/extensions/agt-global-policy/package.json |
Example extension module metadata |
examples/copilot-cli-agt/.github/extensions/agt-global-policy/extension.mjs |
Example extension entrypoint |
examples/copilot-cli-agt/.github/extensions/agt-global-policy/main.mjs |
Example Copilot CLI hooks/tools wiring |
examples/copilot-cli-agt/.github/extensions/agt-global-policy/lib/sdk-loader.mjs |
Example SDK loader |
examples/copilot-cli-agt/.github/extensions/agt-global-policy/lib/poisoning.mjs |
Example text flatten/summarize helpers |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/README.md |
Scenario walkthrough |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/expected-outcomes.md |
Expected outcomes |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/proof-corpus.json |
Machine-readable proof corpus |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/proof-package.md |
Evidence checklist |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/tool-output/poisoned-web-content.txt |
Poisoned output sample |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/prompts/prompt-injection.txt |
Prompt injection sample |
examples/copilot-cli-agt/scenarios/guarded-repo-triage/prompts/unsafe-bootstrap.txt |
Unsafe bootstrap sample |
docs/tutorials/46-copilot-cli-governance.md |
New Copilot CLI installer tutorial |
docs/packages/index.md |
Fixes TS SDK install + adds Copilot CLI row |
docs/packages/copilot-cli-governance.md |
New package docs page |
docs/index.md |
Fixes TS SDK install command |
agent-governance-typescript/package-lock.json |
Bumps TS SDK lock version to 3.6.0 |
agent-governance-copilot-cli/README.md |
Package README |
agent-governance-copilot-cli/package.json |
New npm package manifest (bin/scripts) |
agent-governance-copilot-cli/package-lock.json |
New npm lockfile |
agent-governance-copilot-cli/test/policy-engine.test.mjs |
Packaged baseline policy/runtime tests |
agent-governance-copilot-cli/test/install.test.mjs |
Installer/doctor/policy command tests |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/package.json |
Packaged extension module metadata |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/extension.mjs |
Packaged extension entrypoint |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/main.mjs |
Packaged Copilot CLI hooks/tools wiring |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/lib/sdk-loader.mjs |
Packaged hardened SDK loader |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/lib/poisoning.mjs |
Packaged poisoning helpers (+ windows) |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/config/default-policy.json |
Packaged default policy |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/config/profiles/strict.json |
Packaged strict profile |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/config/profiles/balanced.json |
Packaged balanced profile |
agent-governance-copilot-cli/assets/extensions/agt-global-policy/config/profiles/advisory.json |
Packaged advisory profile |
.github/workflows/ci.yml |
CI path filters + Node version matrix updates |
.github/workflows/publish.yml |
Adds npm matrix + permissions scoping |
.github/pipelines/esrp-publish.yml |
Adds package entries + per-package Node version |
.github/dependabot.yml |
Adds dependabot for new npm package |
.github/CODEOWNERS |
Adds codeowners for new package path |
Files not reviewed (2)
- agent-governance-copilot-cli/package-lock.json: Language not supported
- agent-governance-typescript/package-lock.json: Language not supported
imran-siddique
left a comment
There was a problem hiding this comment.
Approved. Legit feature add — Copilot CLI governance package with policy profiles. CI failures are pre-existing test config drift and process gates, not caused by this PR. Merging per trusted contributor workflow.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
5b68d90 to
89eb549
Compare
🤖 AI Agent: breaking-change-detector — API CompatibilityAPI CompatibilityNo breaking changes detected. |
🤖 AI Agent: docs-sync-checker — Docs SyncDocs Sync
|
🤖 AI Agent: security-scanner — View detailsNo security issues found. |
🤖 AI Agent: test-generator — `agent-governance-copilot-cli/index.ts`
|
🤖 AI Agent: code-reviewer — Action Items:TL;DR: 2 blockers, 1 warning. The PR introduces a critical security gap and a CI/CD misconfiguration; minor documentation issue can be addressed later.
Action Items:
Warnings:
|
Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
Signed-off-by: Jack Batzner <jackbatzner@microsoft.com>
|
I went through the open bot threads and handled the actionable ones. Fixed in follow-up commits:
The earlier package.json comment about bin/agt-copilot.mjs is now stale — that entrypoint is present, tracked, and wired correctly. At this point the only remaining red item I’m seeing is the maintainer-review policy gate; the code-side PR feedback has been addressed. |
|
@imran-siddique , pushed updates for failing checks in the PR. Also addressed AI review feedback. Would appreciate a second review! Thanks in advance |
Description
Adds a production-style Copilot CLI governance package (
agent-governance-copilot-cli) plus a runnable example (examples/copilot-cli-agt) for AGT-backed policy enforcement in Copilot CLI.This PR:
agt-copilotinstall / update / uninstall / doctor / policy commands instead of npm postinstall side effectsType of Change
Package(s) Affected
Checklist
Attribution & Prior Art
Prior art / related projects (if any):
AI Assistance
If AI tools materially shaped this change, briefly note what was used:
IP, Patents, and Licensing
Related Issues