agent-governance-toolkit
Copilot instructions6.4k starsChanged 2 months agoMITView on GitHub
Multi-language monorepo for runtime governance of AI agents. Core is Python, with SDKs in TypeScript, Rust, .NET, and Go. Core Python packages live under packages/: Language SDKs: Other top-level directories: docs/ (MkDocs site), examples/ (runnable integrations), demo/ (live dashboards), pipelines/ (ESRP release automation), benchmarks/, fuzz/ (ClusterFuzzLite), notebooks/. Each subdirectory with an AGENTS.md has area-specific commands and boundaries: read it before changing code there. For major design changes, always ask a maintainer (a collaborator with the Maintain or Admin role) before…
- Installs packages
- Commits and pushes
Trending
Less talk lately.about the whole repository
Who's talking about microsoft/agent-governance-toolkit
- @pythonhub.dev“microsoft / agent-governance-toolkit AI Agent Governance Toolkit — Policy enforcement, zero-trust identity, …”Bluesky · May 6, 2026 · 9 likes
- aaif/project-proposals“[Project Proposal] Agent Governance Toolkit”GitHub · Apr 26, 2026 · 6 reactions
- A Hacker News story“Agent Governance Toolkit”Hacker News · May 27, 2026 · 5 points
- @qdrddr.bsky.social“#OPA #Rego policies for #agents Integrates with most frameworks. #Python · #TypeScript · .NET · Rust · Go …”Bluesky · May 24, 2026 · 5 likes
- @alexmg.dev“Today's random GitHub ⭐! microsoft/agent-governance-toolkit Posted using Starrysky”Bluesky · Oct 1, 2026 · 2 likes
The biggest 5 of 53 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 53
Talked about on GitHub, Bluesky and Hacker News (53 times).
On GitHub · 43
- Apr 26, 2026[Project Proposal] Agent Governance Toolkit — aaif/project-proposals6 reactions · 33 comments
- Apr 20, 2026[Feature] Governance hooks for AI SDK — policy enforcement before tool execution — vercel/ai2 reactions · 17 comments
- Jul 22, 2026[Feature]: Integrate Microsoft Agent Governance Toolkit (AGT) as optional governance plugin — consolidate 53+ governance-related issues — NousResearch/hermes-agent1 reaction · 3 comments
- Jul 2, 2026🔄 Refresh `foundry-agt` — aiappsgbb/awesome-gbb1 reaction · 1 comment
- Jun 1, 2026🔄 Refresh `foundry-agt` — aiappsgbb/awesome-gbb1 reaction · 2 comments
38 more on GitHub
- May 29, 2026🔄 Refresh `foundry-agt` — aiappsgbb/awesome-gbb1 reaction · 1 comment
- May 26, 2026[Feature Request] GOVERNANCE_PROXY: native AGT sidecar integration for deterministic tool-call governance — openclaw/openclaw1 reaction · 1 comment
- May 26, 2026🔄 Refresh `foundry-agt` — 7 signal(s), impact: high — aiappsgbb/awesome-gbb1 reaction
- May 16, 2026feat(governance): phase 0 — agentmesh build spike — wildcard/caro1 reaction · 5 comments
- Apr 26, 2026Propose Agent Governance Toolkit for Sandbox stage — ossf/tac1 reaction · 22 comments
- Apr 20, 2026Proposal: Agent Governance Toolkit — Runtime Governance for Agentic AI (Sandbox) — lfai/proposing-projects1 reaction · 3 comments
- Mar 25, 2026Collaboration: Governance middleware for Mastra agents — mastra-ai/mastra1 reaction · 5 comments
- Oct 4, 2026agent-plugins.github.microsoft.agent-governance-toolkit: init at 5.0.0 — sudosubin/agents.nix0 reactions
- Oct 2, 2026External institutional authority binding for sandbox policy activation — anthropics/sandbox-runtime0 reactions
- Aug 13, 2026chore(deps): Bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-antigravity-cli — baoqger/agt-fork0 reactions
- Aug 13, 2026chore(deps): Bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-claude-code — baoqger/agt-fork0 reactions
- Aug 12, 2026Opportunity: optional external policy verdict input at the guard seam — ucsandman/DashClaw0 reactions · 10 comments
- Aug 12, 2026chore(deps): bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-copilot-cli — VLPraneeth/praneeth-agent-governance-toolkit0 reactions · 2 comments
- Aug 12, 2026chore(deps): bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-antigravity-cli — VLPraneeth/praneeth-agent-governance-toolkit0 reactions · 2 comments
- Aug 12, 2026chore(deps): bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-claude-code — VLPraneeth/praneeth-agent-governance-toolkit0 reactions · 2 comments
- Aug 11, 2026chore(deps): bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-antigravity-cli — guden/agent-governance-toolkit0 reactions · 3 comments
- Aug 11, 2026chore(deps): bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-claude-code — guden/agent-governance-toolkit0 reactions · 3 comments
- Aug 11, 2026chore(deps): bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-copilot-cli — guden/agent-governance-toolkit0 reactions · 3 comments
- Aug 11, 2026chore(deps): Bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-claude-code — dzungttfci/ms_agent-governance-toolkit0 reactions · 1 comment
- Aug 11, 2026chore(deps): Bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-copilot-cli — dzungttfci/ms_agent-governance-toolkit0 reactions · 1 comment
- Aug 11, 2026chore(deps): Bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-antigravity-cli — dzungttfci/ms_agent-governance-toolkit0 reactions · 1 comment
- Aug 10, 2026[Discussion] Asago — asago-ai/asago-policy-mapper0 reactions · 1 comment
- Aug 6, 2026chore(deps): Bump @microsoft/agent-governance-sdk from 4.0.0 to 5.0.0 in /agent-governance-copilot-cli — baoqger/agt-fork0 reactions
- Jul 20, 2026[LinkedIn Post] 2026-07-20 - Daily Post — rajshevde-01/Linkedin-Daily-Post0 reactions
- Jul 5, 2026[arXiv] Verifiable agent-memory provenance gate — ContextNest: Verifiable Context Governance for Autonomous AI Agent — mnemonik-dev/nightly-research0 reactions · 2 comments
- Jun 30, 2026Update agent-sre requirement from <2.0,>=1.0.0 to >=1.0.0,<4.0 in /packages/agent-compliance — igordjuric404/ophanix-platform0 reactions
- Jun 16, 2026Update agent-governance-toolkit requirement from >=3.7.0 to >=4.1.0 in /packages/agent-compliance — igordjuric404/ophanix-platform0 reactions
- Jun 8, 2026Limit agent execution by tokens consumed — microsoft/agent-framework0 reactions · 1 comment
- May 25, 2026Explore optional Microsoft Agent Governance Toolkit integration — sure-scale/hey-jude0 reactions
- May 19, 2026build(deps): Update agent-hypervisor requirement from >=3.5.0 to >=3.7.0 in /packages/agent-hypervisor — igordjuric404/ophanix-platform0 reactions
- May 15, 2026<h1>Dependency Review</h1> — nexoracontrol-ops/upgraded-guide0 reactions
- May 14, 2026[Project Proposal] Agent Governance Toolkit — guildaidev/aaif-project-proposals-demo0 reactions · 1 comment
- May 14, 2026[Project Proposal] Agent Governance Toolkit — guildaidev/aaif-project-proposals-demo0 reactions · 2 comments
- May 8, 2026[Project Proposal] Agent Governance Toolkit — guildaidev/aaif-project-proposals-demo0 reactions
- May 8, 2026Microsoft Agent Framework: Agent Governance Toolkit — phongnguyend/Practical.AI0 reactions
- May 8, 2026<!-- ai-pr-summary --> — selutions/Github0 reactions
- May 8, 2026<!-- ai-pr-summary --> — selutions/Github0 reactions
- May 6, 2026<!-- ai-agent:docs-sync-checker --> — selutions/Github0 reactions
On Bluesky · 8
- May 6, 2026microsoft / agent-governance-toolkit AI Agent Governance Toolkit — Policy enforcement, zero-trust identity, execution sandboxing, and… — @pythonhub.dev9 likes and reposts · 2 replies
- May 24, 2026#OPA #Rego policies for #agents Integrates with most frameworks. #Python · #TypeScript · .NET · Rust · Go #OpenSource MIT lic… — @qdrddr.bsky.social5 likes and reposts
- Oct 1, 2026Today's random GitHub ⭐! microsoft/agent-governance-toolkit Posted using Starrysky — @alexmg.dev2 likes and reposts
- Apr 4, 2026github.com/microsoft/ag... — @tommis.fi2 likes and reposts
- Jul 28, 2026📦 microsoft / agent-governance-toolkit ⭐ 4,981 (+17) 🗒 Python AI Agent Governance Toolkit — Policy enforcement, zero-trust identity,… — @github-trending.bsky.social1 likes and repost
3 more on Bluesky
- May 16, 2026On that - @h.olysh.it I was wondering if you’d seen AGT and had opinions - I love the ambition and scope. At the moment it’s fairly… — @ahrkrak.bsky.social1 likes and repost · 1 reply
- Apr 9, 2026microsoft/agent-governance-toolkit: AI Agent Governance Toolkit — Policy enforcement, zero-trust identity, execution sandboxing, and… — @fluid.sublimer.me1 likes and repost
- Apr 8, 2026Together, these tell you Microsoft is betting that governance and evaluation infrastructure will matter more than model capability for… — @nik-kale.bsky.social0 likes and reposts · 1 reply
On Hacker News · 2
- May 27, 2026Agent Governance Toolkit5 points
- May 26, 2026AI Agent Governance Toolkit2 points
In this repository17 other files it gives its agents.
- agent-governance-claude-code/AGENTS.mdAGENTS.md
- agent-governance-dotnet/AGENTS.mdAGENTS.md
- agent-governance-opencode/AGENTS.mdAGENTS.md
- agent-governance-python/agent-compliance/AGENTS.mdAGENTS.md
- agent-governance-python/agent-mesh/AGENTS.mdAGENTS.md
- agent-governance-python/agent-mesh/sdks/AGENTS.mdAGENTS.md
- agent-governance-python/agent-os/AGENTS.mdAGENTS.md
- agent-governance-python/AGENTS.mdAGENTS.md
- agent-governance-python/agent-sre/AGENTS.mdAGENTS.md
- agent-governance-rust/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- examples/demos/AGENTS.mdAGENTS.md
- .github/pipelines/AGENTS.mdAGENTS.md
- policy-engine/AGENTS.mdAGENTS.md
- agt-policy-authoringSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
45 rules. About 0 are common, 24 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈24
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 114
Do NOT auto-merge large feature PRs without maintainer review.
- Distinctive: line 118
Every PR must have a well-structured, properly formatted description.
- Very specific: line 129
Use proper markdown: headings (##), backtick code spans, tables, blank lines between sections.
- Very specific: line 130
Never pass PR body text through PowerShell inline strings.
- Very specific: line 131
Verify the rendered PR description on GitHub after creation.
- Distinctive: line 132
No escaped backslashes where backticks should be.
- Very specific: line 158
When external contributors open issues or PRs proposing integration with their own project/tool/library, apply these quality checks before …
- Distinctive: line 168
Verify claims: If the PR cites benchmarks, adoption numbers, or production deployments, spot-check them.
- Distinctive: line 180
When merging PRs, follow this sequence for EACH PR (do not batch):
- Distinctive: line 193
Before commenting on ANY PR or pinging a reviewer:
- Distinctive: line 204
NEVER merge a PR without thorough code review.
- Distinctive: line 208
All PR reviews (human and bot) MUST follow this concise format.
- Distinctive: line 230
No multi-paragraph explanations, "Conclusion" sections, or suggestion lists.
- Distinctive: line 231
No inline code suggestions in the summary.
- Distinctive: line 236
Before approving or merging ANY PR, verify ALL of the following:
- Distinctive: line 265
All GitHub Actions MUST be pinned by full SHA hash, never bare tags:
- Very specific: line 268
All Docker FROM images MUST include @sha256: digest:
- Very specific: line 278
All workflow files MUST have explicit permissions: at the top level
- Very specific: line 280
Write permissions (packages: write, pull-requests: write, id-token: write, etc.) MUST be scoped to the specific job that needs them, not …
- Distinctive: line 281
MUST be scoped to the specific job that needs them, not the workflow level:
- Very specific: line 298
Never use timedelta(days=365) or timedelta(days=366) to represent "one year" in production code.
- Very specific: line 301
Never use is True / is False for boolean comparison — use == True / == False (or just if value: / if not value:)
- Very specific: line 303
Never use mutable default arguments (def f(x=[])) — use None with body initialization:
- Very specific: line 308
Remove unnecessary pass statements in non-empty function/class bodies
- Distinctive: line 319
All security patterns must be in YAML config, not hardcoded
- Very specific: line 320
All GitHub Actions must be SHA-pinned (use action@<sha> # vX.Y.Z format, never bare tags like @v46)
- Very specific: line 321
All workflows must define permissions:
- Very specific: line 322
Use yaml.safe_load(), never yaml.load()
- Distinctive: line 331
7-Day Rule: Never install a package version released less than 7 days ago.
- Distinctive: line 332
Fallback: If the latest version is < 7 days old, pin to the previous stable release.
- Very specific: line 333
Verification: Check release timestamps via npm view <package> time or pip index versions <package>.
- Very specific: line 336
Exact versions only: Use exact versioning in package.json (e.g., "axios": "1.14.0").
- Very specific: line 337
Python pinning: Use == in requirements.txt and pin in pyproject.toml with >=x.y.z,<x.y+1.0.
- Very specific: line 338
Rust pinning: Use exact versions in Cargo.toml (e.g., serde = "=1.0.228").
- Very specific: line 339
Lockfile integrity: Ensure package-lock.json, Cargo.lock, or equivalent is committed to the repository.
- Distinctive: line 342
Pre-install audit: Before adding any new dependency, check for red flags: unusual release spikes, sudden maintainer changes, new suspicious …
- Distinctive: line 343
Alert: If any anomaly is detected, halt the installation and flag for human review.
- Distinctive: line 348
Use conventional commits (feat:, fix:, docs:, etc.)
- Distinctive: line 349
Run tests before committing
- Distinctive: line 354
All packages prefixed with "Public Preview" in descriptions
- Distinctive: line 369
All ESRP config values must be in pipeline secrets, never plaintext in YAML
- Distinctive: line 375
After merging ANY external contributor PR, perform these follow-up checks and fix issues immediately in a separate PR:
- Distinctive: line 406
No mocks or stubs in production code: Always provide real, working implementations.
- Very specific: line 407
No TODO/FIXME/HACK comments as placeholders: If something needs to be done, do it now or track it as a GitHub issue.
- Very specific: line 408
No placeholder or skeleton implementations: Every function, class, and module must be fully implemented and tested.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for agent-governance-toolkit
Architecture
Multi-language monorepo for runtime governance of AI agents. Core is Python, with SDKs in TypeScript, Rust, .NET, and Go.
Core Python packages live under packages/:
| Package | Purpose |
agent-compliance (agent_governance_toolkit) | Unified installer, agt CLI, runtime policy enforcement |
agent-os (agent_os_kernel) | Kernel: policy evaluator, identity, trust, audit |
agent-mesh (agentmesh_platform) | Multi-agent networking: Wire Protocol, registry, relay, E2E encryption |
agent-hypervisor | Execution sandboxing and resource isolation |
agent-sre | SRE: health checks, circuit breakers, observability |
agent-runtime | Runtime orchestration layer |
agent-mcp-governance | MCP (Model Context Protocol) governance primitives |
agent-discovery | Agent discovery and capability advertisement |
agent-lightning | Lightweight/fast-path policy evaluation |
agent-marketplace | Agent marketplace and registry |
agentmesh-integrations | Framework adapters (LangChain, CrewAI, AutoGen, etc.) |
Language SDKs:
| Language | Path | Package name |
| TypeScript | packages/agent-mesh/sdks/typescript/ | @microsoft/agent-governance-sdk |
| Rust | packages/agent-mesh/sdks/rust/ | agent-governance, agent-governance-mcp |
| .NET | agent-governance-dotnet/ | Microsoft.AgentGovernance |
| Go | agent-governance-golang/ | (standalone top-level) |
Other top-level directories: docs/ (MkDocs site), examples/ (runnable integrations), demo/ (live dashboards), pipelines/ (ESRP release automation), benchmarks/, fuzz/ (ClusterFuzzLite), notebooks/.
Each subdirectory with an AGENTS.md has area-specific commands and boundaries: read it before changing code there.
Build, Test, and Lint
Python
# Install (editable, all extras)
pip install -e ".[full]"
# Lint
ruff check --select E,F,W --ignore E501
# Test (full suite)
pytest
# Test (single file)
pytest tests/test_policy.py
# Test (single test by name)
pytest -k "test_policy_deny_dangerous_tools"
# Build
python -m buildTypeScript (packages/agent-mesh/sdks/typescript/)
npm run build
npm test # runs jest
npm run lintRust (packages/agent-mesh/sdks/rust/)
cargo build --release --workspace
cargo test --release --workspace
# Single test
cargo test --release test_name.NET (agent-governance-dotnet/)
dotnet build AgentGovernance.sln
dotnet test AgentGovernance.sln
# Single test
dotnet test --filter "FullyQualifiedName~TestClassName.TestMethodName"MCP Server (packages/agent-os/extensions/mcp-server/)
npm run build
npm test # runs vitest
npm run test:coverageDocs (docs/)
pip install -r requirements/docs.txt
mkdocs serve # local preview
mkdocs build # build static siteDecision Escalation
For major design changes, always ask a maintainer (a collaborator with the Maintain or Admin role) before proceeding:
- New packages or modules that change the repo structure
- Cross-cutting changes spanning 3+ packages
- Security model changes (identity, trust, policy engine)
- Breaking API changes to public interfaces
- New framework integrations or SDK additions
- Changes to CI/CD pipeline architecture
Do NOT auto-merge large feature PRs without maintainer review.
PR Description Standards
Every PR must have a well-structured, properly formatted description. Lightweight or mangled descriptions are not acceptable.
Required sections
- Summary (1-2 sentences): What this PR does and why.
- Problem (optional for trivial fixes): What was broken, missing, or suboptimal.
- Changes: A table or bullet list of files changed and what changed in each. Use a markdown table for 3+ files.
- Testing: How the changes were verified (test results, manual validation, docs-only note).
Formatting rules
- Use proper markdown: headings (
##), backtick code spans, tables, blank lines between sections. - Never pass PR body text through PowerShell inline strings. Always write the body to a temp file with Python (to preserve backticks and special characters) and use
gh pr create --body-file. - Verify the rendered PR description on GitHub after creation. If formatting is broken, fix it immediately with
gh pr edit --body-file. - No escaped backslashes where backticks should be. No missing blank lines between paragraphs. No corrupted characters.
Template
## Summary
<What and why, 1-2 sentences.>
## Problem
<What was broken or missing. Skip for trivial changes.>
## Changes
| File | What changed |
|------|-------------|
| `path/to/file.py` | Description of change |
## Testing
<How verified: "All N tests pass", "Docs-only, verified links", etc.>External Contribution Quality Gate
When external contributors open issues or PRs proposing integration with their own project/tool/library, apply these quality checks before investing review time:
- Attribution & prior art check: If the PR implements functionality similar to an existing open-source project, verify it credits that project explicitly. Check the "Prior art" section in the PR template. If the PR mirrors patterns from a known project (architecture, CLI conventions, config schema, API design) without attribution, request changes immediately and do not merge until attribution is added. Uncredited derivatives of community work will be closed.
- Timeline verification: For PRs that arrive shortly after a community member proposes similar functionality in an issue, verify the PR author isn't racing to submit an uncredited copy of the proposed approach. Check issue discussion history for prior art.
- Repo creation date check: If a contributor references their own project, check when that project's repository was created. If it was created within 7 days of the contributor's first issue or PR on this repo, treat this as a high-risk signal requiring additional scrutiny. Same-day creation is a strong indicator of reactive/derivative work.
- Cross-repo pattern detection: Before merging contributions from new external contributors, search their GitHub handle across adjacent repos in the ecosystem. If the same contributor is filing similar issues or PRs on multiple related projects within a short window, this is a coordination signal — it may indicate legitimate cross-project work, or it may indicate automated/synthetic activity. Evaluate in context.
- Velocity as a signal: A new contributor submitting multiple substantial PRs (code, docs, examples, CI workflows) within days of their first interaction is unusual. High velocity from an unknown contributor is not proof of bad faith, but it warrants deeper review — check for AI-generated content patterns (overly comprehensive specs, hallucinated technical details, projects that claim features without evidence).
- AI-generated contribution detection: Watch for signs of AI-generated contributions: internally consistent but externally unverifiable claims (IETF drafts, NIST submissions, patent filings), projects with elaborate documentation but no real users, landing pages with "design partner" CTAs for projects created days ago, and technically plausible but occasionally hallucinated details (e.g., referencing specific hardware chips in implausible contexts).
- Minimum credibility threshold: The referenced project should have meaningful community adoption (e.g., 50+ GitHub stars, multiple contributors, evidence of production usage). One-person repos with <10 stars and no community traction do not warrant integration effort.
- Self-promotion filter: Issues or PRs that primarily serve to promote the contributor's own low-profile project — rather than adding genuine value to AGT — should be deprioritized. Politely acknowledge but do not fast-track.
- Verify claims: If the PR cites benchmarks, adoption numbers, or production deployments, spot-check them. Unverifiable claims are a red flag.
- Scope proportionality: A small or unknown project requesting a large integration surface (new package, new dependency, new CI pipeline) is disproportionate. Suggest they contribute as an example or community link instead.
- Dependency risk: Adding a dependency on an obscure package creates supply chain risk. Prefer vendored examples or optional integrations that don't add to the core dependency tree.
- IP / patent / NDA red flags: If a contributor mentions patents, NDAs, licensing arrangements, or "the full scope goes beyond what we've discussed," stop technical engagement immediately. AGT is MIT-licensed. All contributions must be made under MIT via the standard CLA. No side agreements, no patent-encumbered code, no NDA-gated architectures.
- Spam/scam PR filter: Close immediately with a polite note if the PR/issue is:
- Marketing content disguised as a contribution (e.g., adding the contributor's company to COMMUNITY.md or README.md as a "Related Project" when there's no genuine technical integration)
- From an account with <5 repos, <5 followers, created <3 months ago that submits promotional content to core docs
- Name-dropping awards, magazine features, publications, or rankings instead of providing technical value
- Repetitive submissions from the same contributor after previous PR was closed for the same reason (e.g., kevinkaylie/AgentNexus pattern)
PR Merge Workflow
When merging PRs, follow this sequence for EACH PR (do not batch):
- Review — run all mandatory checks below
- Update branch — merge latest main into the PR branch (
update-branchAPI or UI button) - Approve pending workflows — fork PRs may have
pull_request_targetworkflows waiting for maintainer approval; approve them in the Actions tab - Approve the PR — submit an approving review
- Enable auto-merge — set squash auto-merge so it merges once CI passes
- Move to next PR — don't wait; auto-merge handles the rest
This prevents PRs from stacking in the merge queue behind stale branches.
PR Comment Etiquette — Read Before Writing
Before commenting on ANY PR or pinging a reviewer:
- Read ALL existing comments and review threads first — never post feedback that duplicates, contradicts, or ignores prior discussion
- Check resolved threads — don't re-raise issues that were already addressed
- Review the full conversation timeline — understand what was already requested, what was fixed, and what decisions were made before adding your input
- Don't ping reviewers until you've verified there are no unaddressed comments from previous rounds that you should handle first
Ignoring existing PR context wastes reviewer time and erodes trust.
PR Review — Mandatory Before Merge
NEVER merge a PR without thorough code review. CI passing is NOT sufficient.
Review Output Style
All PR reviews (human and bot) MUST follow this concise format. Verbose essay-style reviews waste contributor time.
**TL;DR**: N blockers, M warnings. Fix #1 and #2 and this ships.
| # | Sev | Issue | Where |
|---|-----|-------|-------|
| 1 | Block | One-line description | function/file |
| 2 | Warn | One-line description | function/file |
**#1**: One sentence explaining what to fix.
**#2**: One sentence explaining what to fix.
Warnings are fine as follow-up PRs.Rules:
- Lead with verdict, not analysis. TL;DR line is mandatory.
- Summary table: one row per finding, one-line descriptions only.
- Action items: only for blockers. One sentence each, no code blocks.
- Warnings: list in table, mark as "fine as follow-ups."
- Nits: do NOT include in posted reviews. Drop entirely on external contributor PRs.
- No multi-paragraph explanations, "Conclusion" sections, or suggestion lists.
- No inline code suggestions in the summary. Trust the contributor.
- 200 words max per review. If no issues: "No issues found. Clean change."
Review Checklist
Before approving or merging ANY PR, verify ALL of the following:
- Read the actual diff — don't rely on PR description alone
- Attribution & prior art — check if the PR implements patterns similar to known open-source projects. If it does, verify proper attribution exists in the PR description and code. Check whether the PR arrived shortly after a community member proposed similar work in an issue — if so, verify the contributor isn't submitting an uncredited derivative. PRs without proper attribution will not be merged.
- Dependency confusion scan — check every
pip install,npm install,cargo addcommand in docs/code for unregistered package names. The registered names are:- PyPI:
agent-os-kernel,agentmesh-platform,agent-hypervisor,agentmesh-runtime,agent-sre,agent-governance-toolkit,agentmesh-lightning,agentmesh-marketplace,agt-sandbox - PyPI (ACS):
agent-control-specification,agt-policies,acs-generator - PyPI (local-only, not published):
agent-governance-dotnet,agentmesh-integrations,agent-primitives,emk - PyPI (common deps):
streamlit,plotly,pandas,networkx,aioredis,pypdf,spacy,slack-sdk,docker,langchain-openai - npm:
@microsoft/agent-os-kernel - npm (ACS):
agent-control-specification,agent-control-specification-linux-x64-gnu,agent-control-specification-linux-arm64-gnu,agent-control-specification-darwin-x64,agent-control-specification-darwin-arm64,agent-control-specification-win32-x64-msvc,agent-control-specification-opa-linux-x64,agent-control-specification-opa-linux-arm64,agent-control-specification-opa-darwin-x64,agent-control-specification-opa-darwin-arm64,agent-control-specification-opa-win32-x64 - crates.io:
agentmesh - crates.io (ACS):
agent_control_specification_core,agent_control_specification
- PyPI:
- New Python modules — verify
__init__.pyexists in any new package directory - Dependencies declared — any new
importmust have the package inpyproject.tomldependencies (not just transitive) - No hardcoded secrets — no API keys, tokens, passwords, connection strings in code or docs
- No plaintext config in pipelines — ESRP Client IDs, Key Vault names, cert names go in secrets, not YAML
- Verify PR has actual changes — check
additions > 0before merging (empty PRs have happened) - MIT license headers — every new source file (
.py,.ts,.js,.rs,.go,.cs,.sh) must have the license header. This is the #1 most common review finding.
Security Rules
Code Scanning Prevention (Scorecard + CodeQL)
These rules prevent the exact alert categories that code scanning flags. Every PR and commit MUST comply — CI will catch violations, but catching them before push saves time.
Pinned Dependencies (Scorecard PinnedDependenciesID):
- All GitHub Actions MUST be pinned by full SHA hash, never bare tags:
- ✅
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - ❌
uses: actions/checkout@v4
- ✅
- All Docker FROM images MUST include
@sha256:digest:- ✅
FROM python:3.12-slim@sha256:804ddf3251a60bbf9c92e73b7566c40428d54d0e79d3428194edf40da6521286 - ❌
FROM python:3.12-slim
- ✅
- All
pip installin workflows, Dockerfiles, and shell scripts MUST pin versions:- ✅
pip install mkdocs-material==9.7.6 - ❌
pip install mkdocs-material
- ✅
- To look up a GitHub Action SHA:
gh api repos/{owner}/{repo}/git/ref/tags/{tag} --jq '.object.sha' - To look up a Docker image digest:
docker pull python:3.12-slim && docker inspect --format='{{index .RepoDigests 0}}' python:3.12-slim
Token Permissions (Scorecard TokenPermissionsID):
- All workflow files MUST have explicit
permissions:at the top level - Top-level permissions MUST be
contents: readonly (least privilege) - Write permissions (
packages: write,pull-requests: write,id-token: write, etc.) MUST be scoped to the specific job that needs them, not the workflow level:# ✅ CORRECT — write scoped to job permissions: contents: read jobs: publish: permissions: packages: write # ❌ WRONG — write at top level permissions: contents: read packages: write
Python Code Quality (CodeQL):
- Never use
timedelta(days=365)ortimedelta(days=366)to represent "one year" in production code. Usedateutil.relativedelta(years=1)for leap-year safety. In tests where approximate durations suffice, usetimedelta(days=400)to avoid CodeQL flags. - Never use
is True/is Falsefor boolean comparison — use== True/== False(or justif value:/if not value:) - Never use mutable default arguments (
def f(x=[])) — useNonewith body initialization:# ✅ def f(x=None): x = x or [] # ❌ def f(x=[]): - Remove unnecessary
passstatements in non-empty function/class bodies
TypeScript/JavaScript Code Quality (CodeQL):
- URL validation MUST use
new URL()constructor or protocol-aware checks, never plain substring matching:- ✅
new URL(href).hostname === 'cdn.jsdelivr.net' - ❌
href.includes('cdn.jsdelivr.net')
- ✅
General Security Rules
- All
pip installcommands must reference registered PyPI packages - All security patterns must be in YAML config, not hardcoded
- All GitHub Actions must be SHA-pinned (use
action@<sha> # vX.Y.Zformat, never bare tags like@v46) - All workflows must define
permissions: - Use
yaml.safe_load(), neveryaml.load() - No
pickle.loads,eval(),exec(),shell=Truein production code - No
innerHTML— use safe DOM APIs - No
unwrap()in non-test Rust code paths (use?or explicit error handling) - Docker images must use pinned version tags or SHA digests (never
:latest)
Supply Chain Security (Anti-Poisoning)
Version Selection
- 7-Day Rule: Never install a package version released less than 7 days ago. Prefer versions with at least one week of stability and consistent download metrics.
- Fallback: If the latest version is < 7 days old, pin to the previous stable release.
- Verification: Check release timestamps via
npm view <package> timeorpip index versions <package>.
Version Locking
- Exact versions only: Use exact versioning in
package.json(e.g.,"axios": "1.14.0"). Prohibit^or~ranges. - Python pinning: Use
==inrequirements.txtand pin inpyproject.tomlwith>=x.y.z,<x.y+1.0. - Rust pinning: Use exact versions in
Cargo.toml(e.g.,serde = "=1.0.228"). - Lockfile integrity: Ensure
package-lock.json,Cargo.lock, or equivalent is committed to the repository.
Anomaly Detection
- Pre-install audit: Before adding any new dependency, check for red flags: unusual release spikes, sudden maintainer changes, new suspicious transitive dependencies.
- Alert: If any anomaly is detected, halt the installation and flag for human review.
- Dependabot PRs: Review Dependabot version bumps for major version jumps, new transitive deps, or maintainer changes before merging.
Code Style
- Use conventional commits (feat:, fix:, docs:, etc.)
- Run tests before committing
- MIT license headers on all source files:
- Python/Shell:
# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License. - TypeScript/JavaScript/Rust/C#/Go:
// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.
- Python/Shell:
- Author: Microsoft Corporation, email: agentgovtoolkit@microsoft.com
- All packages prefixed with "Public Preview" in descriptions
CI Optimization
CI workflows use path filters so only relevant checks run per PR:
- Python changes (
agent-governance-python/agent-mesh/,agent-governance-python/agent-os/, etc.) → lint + test for that package only - TypeScript changes (
agent-governance-typescript/,extensions/copilot/) → TS lint + test onlyn- **Rust changes** (agent-governance-rust/`) → cargo test only - .NET changes (
agent-governance-dotnet/) → dotnet test only - Go changes (
agent-governance-golang/) → go test only - Docs-only changes (
.md,agent-governance-python/notebooks/) → link check only, skip all builds/tests - Workflow changes (
.github/workflows/) → workflow-security audit only
Publishing
- PyPI/npm/NuGet/crates.io publishing goes through ESRP Release (ADO pipelines), NOT GitHub Actions
- All ESRP config values must be in pipeline secrets, never plaintext in YAML
- Package names must NOT start with
microsoftorwindows(reserved by Python team) - npm packages use
@microsoftscope only
Post-Merge Review — Mandatory Follow-Up
After merging ANY external contributor PR, perform these follow-up checks and fix issues immediately in a separate PR:
Security Sweep
- Secrets scan — grep new files for
sk-,ghp_,password=,api_key=patterns. Placeholder keys in README instructions (e.g.,sk-...) are OK; real-looking keys are not. - Unsafe patterns — check for
eval(),exec(),yaml.load()(not safe_load),shell=True,pickle.loadin new non-test code. Function names containing "exec" (e.g.,tool_exec()) are fine — only actualexec(calls matter. - innerHTML/XSS — check new
.ts/.tsxfiles forinnerHTMLwithout escaping. Must useescapeHtml()ortextContent. - Network exposure — check for
0.0.0.0bindings in new code (must be127.0.0.1for dev servers). - Wildcard CORS — check for
allow_origins=["*"]in new code (must use env-driven origins). - Credential leaks in scanners — if new security scanning code stores matched patterns, ensure values are redacted (not raw secrets in audit logs).
- Credential boundary anchors , bounded-token patterns (GitHub, OpenAI, AWS, Google) must use
(?<![A-Za-z0-9])/(?![A-Za-z0-9])lookaround anchors, NOT\bword boundaries.\btreats_as a word character, so a secret annotated_oldor preceded bysession_is missed. Thetests/ci/test_regression_credential_boundary.pyguard verifies this in the regex SDKs (TypeScript, Python; C# is in #3934) and checks Rust boundary match arms separately.
- Credential boundary anchors , bounded-token patterns (GitHub, OpenAI, AWS, Google) must use
Build & Compatibility
- License headers — verify all new
.py,.ts,.cs,.rs,.go,.shfiles have the MIT copyright header. - File encoding — all
open()calls reading YAML/JSON/text must useencoding="utf-8"(prevents Windows failures). - Trailing newlines — all new source files must end with a newline (ruff W292).
- Relative links — translated/i18n docs must adjust relative paths (e.g.,
../../prefix for files indocs/i18n/).
Structural Integrity
- Scope verification — confirm PR only touches files matching its description. Flag "trojan PRs" that bundle unrelated code changes in docs-only PRs.
- .github/ modifications — ANY change to
.github/workflows/from an external contributor requires line-by-line security review. Never merge a delete-all/re-add-all workflow diff. - Mutable data structures — if a PR adds validation (e.g.,
__post_init__), ensure the validated fields cannot be mutated post-construction (convertlist→tuple). Update tests to match. - Dependency format —
pyproject.tomluseslicense = {text = "MIT"}(table format);Cargo.tomluseslicense = "MIT"(SPDX string). Do NOT mix these. - Package names —
pyproject.tomlnames must use underscores (PEP 625):agent_governance_toolkit, notagent-governance-toolkit.
CI Verification
- Run CI — confirm the CI run on the merge commit passes. If it fails, fix immediately.
- Lint compliance — new Python files must pass
ruff check --select E,F,W --ignore E501. - Test compatibility — if our fixes changed data types (e.g., list → tuple), update any tests that assert on the old type.
Implementation Quality
- No mocks or stubs in production code. Always provide real, working implementations. If a dependency is unavailable, build the real integration or defer the feature — never ship a mock.
- No TODO/FIXME/HACK comments as placeholders. If something needs to be done, do it now or track it as a GitHub issue. Code with TODO comments will not be merged.
- No placeholder or skeleton implementations. Every function, class, and module must be fully implemented and tested. Empty methods,
passbodies,raise NotImplementedError, or// TODOstubs are not acceptable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

