agentleFS
MicrosoftKnown publishermicrosoft/agent-governance-toolkit/.github/copilot-instructions.md

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

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 7 mentionsMay 2026: 19 mentionsJun 2026: 4 mentionsJul 2026: 5 mentionsAug 2026: 14 mentionsSep 2026: 0 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/agent-governance-toolkit repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/agent-governance-toolkit

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

38 more on GitHub

On Bluesky · 8

3 more on Bluesky

On Hacker News · 2

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
  1. Distinctive:

    Do NOT auto-merge large feature PRs without maintainer review.

    line 114
  2. Distinctive:

    Every PR must have a well-structured, properly formatted description.

    line 118
  3. Very specific:

    Use proper markdown: headings (##), backtick code spans, tables, blank lines between sections.

    line 129
  4. Very specific:

    Never pass PR body text through PowerShell inline strings.

    line 130
  5. Very specific:

    Verify the rendered PR description on GitHub after creation.

    line 131
  6. Distinctive:

    No escaped backslashes where backticks should be.

    line 132
  7. Very specific:

    When external contributors open issues or PRs proposing integration with their own project/tool/library, apply these quality checks before …

    line 158
  8. Distinctive:

    Verify claims: If the PR cites benchmarks, adoption numbers, or production deployments, spot-check them.

    line 168
  9. Distinctive:

    When merging PRs, follow this sequence for EACH PR (do not batch):

    line 180
  10. Distinctive:

    Before commenting on ANY PR or pinging a reviewer:

    line 193
  11. Distinctive:

    NEVER merge a PR without thorough code review.

    line 204
  12. Distinctive:

    All PR reviews (human and bot) MUST follow this concise format.

    line 208
  13. Distinctive:

    No multi-paragraph explanations, "Conclusion" sections, or suggestion lists.

    line 230
  14. Distinctive:

    No inline code suggestions in the summary.

    line 231
  15. Distinctive:

    Before approving or merging ANY PR, verify ALL of the following:

    line 236
  16. Distinctive:

    All GitHub Actions MUST be pinned by full SHA hash, never bare tags:

    line 265
  17. Very specific:

    All Docker FROM images MUST include @sha256: digest:

    line 268
  18. Very specific:

    All workflow files MUST have explicit permissions: at the top level

    line 278
  19. Very specific:

    Write permissions (packages: write, pull-requests: write, id-token: write, etc.) MUST be scoped to the specific job that needs them, not …

    line 280
  20. Distinctive:

    MUST be scoped to the specific job that needs them, not the workflow level:

    line 281
  21. Very specific:

    Never use timedelta(days=365) or timedelta(days=366) to represent "one year" in production code.

    line 298
  22. Very specific:

    Never use is True / is False for boolean comparison — use == True / == False (or just if value: / if not value:)

    line 301
  23. Very specific:

    Never use mutable default arguments (def f(x=[])) — use None with body initialization:

    line 303
  24. Very specific:

    Remove unnecessary pass statements in non-empty function/class bodies

    line 308
  25. Distinctive:

    All security patterns must be in YAML config, not hardcoded

    line 319
  26. Very specific:

    All GitHub Actions must be SHA-pinned (use action@<sha> # vX.Y.Z format, never bare tags like @v46)

    line 320
  27. Very specific:

    All workflows must define permissions:

    line 321
  28. Very specific:

    Use yaml.safe_load(), never yaml.load()

    line 322
  29. Distinctive:

    7-Day Rule: Never install a package version released less than 7 days ago.

    line 331
  30. Distinctive:

    Fallback: If the latest version is < 7 days old, pin to the previous stable release.

    line 332
  31. Very specific:

    Verification: Check release timestamps via npm view <package> time or pip index versions <package>.

    line 333
  32. Very specific:

    Exact versions only: Use exact versioning in package.json (e.g., "axios": "1.14.0").

    line 336
  33. Very specific:

    Python pinning: Use == in requirements.txt and pin in pyproject.toml with >=x.y.z,<x.y+1.0.

    line 337
  34. Very specific:

    Rust pinning: Use exact versions in Cargo.toml (e.g., serde = "=1.0.228").

    line 338
  35. Very specific:

    Lockfile integrity: Ensure package-lock.json, Cargo.lock, or equivalent is committed to the repository.

    line 339
  36. Distinctive:

    Pre-install audit: Before adding any new dependency, check for red flags: unusual release spikes, sudden maintainer changes, new suspicious …

    line 342
  37. Distinctive:

    Alert: If any anomaly is detected, halt the installation and flag for human review.

    line 343
  38. Distinctive:

    Use conventional commits (feat:, fix:, docs:, etc.)

    line 348
  39. Distinctive:

    Run tests before committing

    line 349
  40. Distinctive:

    All packages prefixed with "Public Preview" in descriptions

    line 354
  41. Distinctive:

    All ESRP config values must be in pipeline secrets, never plaintext in YAML

    line 369
  42. Distinctive:

    After merging ANY external contributor PR, perform these follow-up checks and fix issues immediately in a separate PR:

    line 375
  43. Distinctive:

    No mocks or stubs in production code: Always provide real, working implementations.

    line 406
  44. Very specific:

    No TODO/FIXME/HACK comments as placeholders: If something needs to be done, do it now or track it as a GitHub issue.

    line 407
  45. Very specific:

    No placeholder or skeleton implementations: Every function, class, and module must be fully implemented and tested.

    line 408

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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/:

PackagePurpose
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-hypervisorExecution sandboxing and resource isolation
agent-sreSRE: health checks, circuit breakers, observability
agent-runtimeRuntime orchestration layer
agent-mcp-governanceMCP (Model Context Protocol) governance primitives
agent-discoveryAgent discovery and capability advertisement
agent-lightningLightweight/fast-path policy evaluation
agent-marketplaceAgent marketplace and registry
agentmesh-integrationsFramework adapters (LangChain, CrewAI, AutoGen, etc.)

Language SDKs:

LanguagePathPackage name
TypeScriptpackages/agent-mesh/sdks/typescript/@microsoft/agent-governance-sdk
Rustpackages/agent-mesh/sdks/rust/agent-governance, agent-governance-mcp
.NETagent-governance-dotnet/Microsoft.AgentGovernance
Goagent-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 build

TypeScript (packages/agent-mesh/sdks/typescript/)

npm run build
npm test           # runs jest
npm run lint

Rust (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:coverage

Docs (docs/)

pip install -r requirements/docs.txt
mkdocs serve       # local preview
mkdocs build       # build static site

Decision 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

  1. Summary (1-2 sentences): What this PR does and why.
  2. Problem (optional for trivial fixes): What was broken, missing, or suboptimal.
  3. Changes: A table or bullet list of files changed and what changed in each. Use a markdown table for 3+ files.
  4. 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):

  1. Review — run all mandatory checks below
  2. Update branch — merge latest main into the PR branch (update-branch API or UI button)
  3. Approve pending workflows — fork PRs may have pull_request_target workflows waiting for maintainer approval; approve them in the Actions tab
  4. Approve the PR — submit an approving review
  5. Enable auto-merge — set squash auto-merge so it merges once CI passes
  6. 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:

  1. Read ALL existing comments and review threads first — never post feedback that duplicates, contradicts, or ignores prior discussion
  2. Check resolved threads — don't re-raise issues that were already addressed
  3. Review the full conversation timeline — understand what was already requested, what was fixed, and what decisions were made before adding your input
  4. 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:

  1. Read the actual diff — don't rely on PR description alone
  2. 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.
  3. Dependency confusion scan — check every pip install, npm install, cargo add command 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
  4. New Python modules — verify __init__.py exists in any new package directory
  5. Dependencies declared — any new import must have the package in pyproject.toml dependencies (not just transitive)
  6. No hardcoded secrets — no API keys, tokens, passwords, connection strings in code or docs
  7. No plaintext config in pipelines — ESRP Client IDs, Key Vault names, cert names go in secrets, not YAML
  8. Verify PR has actual changes — check additions > 0 before merging (empty PRs have happened)
  9. 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 install in 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: read only (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) or timedelta(days=366) to represent "one year" in production code. Use dateutil.relativedelta(years=1) for leap-year safety. In tests where approximate durations suffice, use timedelta(days=400) to avoid CodeQL flags.
  • Never use is True / is False for boolean comparison — use == True / == False (or just if value: / if not value:)
  • Never use mutable default arguments (def f(x=[])) — use None with body initialization:
    # ✅ def f(x=None): x = x or []
    # ❌ def f(x=[]):
  • Remove unnecessary pass statements 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 install commands 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.Z format, never bare tags like @v46)
  • All workflows must define permissions:
  • Use yaml.safe_load(), never yaml.load()
  • No pickle.loads, eval(), exec(), shell=True in 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> time or pip 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 == in requirements.txt and pin in pyproject.toml with >=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.
  • 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 microsoft or windows (reserved by Python team)
  • npm packages use @microsoft scope 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

  1. 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.
  2. Unsafe patterns — check for eval(), exec(), yaml.load() (not safe_load), shell=True, pickle.load in new non-test code. Function names containing "exec" (e.g., tool_exec()) are fine — only actual exec( calls matter.
  3. innerHTML/XSS — check new .ts/.tsx files for innerHTML without escaping. Must use escapeHtml() or textContent.
  4. Network exposure — check for 0.0.0.0 bindings in new code (must be 127.0.0.1 for dev servers).
  5. Wildcard CORS — check for allow_origins=["*"] in new code (must use env-driven origins).
  6. 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 \b word boundaries. \b treats _ as a word character, so a secret annotated _old or preceded by session_ is missed. The tests/ci/test_regression_credential_boundary.py guard verifies this in the regex SDKs (TypeScript, Python; C# is in #3934) and checks Rust boundary match arms separately.

Build & Compatibility

  1. License headers — verify all new .py, .ts, .cs, .rs, .go, .sh files have the MIT copyright header.
  2. File encoding — all open() calls reading YAML/JSON/text must use encoding="utf-8" (prevents Windows failures).
  3. Trailing newlines — all new source files must end with a newline (ruff W292).
  4. Relative links — translated/i18n docs must adjust relative paths (e.g., ../../ prefix for files in docs/i18n/).

Structural Integrity

  1. Scope verification — confirm PR only touches files matching its description. Flag "trojan PRs" that bundle unrelated code changes in docs-only PRs.
  2. .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.
  3. Mutable data structures — if a PR adds validation (e.g., __post_init__), ensure the validated fields cannot be mutated post-construction (convert list → tuple). Update tests to match.
  4. Dependency format — pyproject.toml uses license = {text = "MIT"} (table format); Cargo.toml uses license = "MIT" (SPDX string). Do NOT mix these.
  5. Package names — pyproject.toml names must use underscores (PEP 625): agent_governance_toolkit, not agent-governance-toolkit.

CI Verification

  1. Run CI — confirm the CI run on the merge commit passes. If it fails, fix immediately.
  2. Lint compliance — new Python files must pass ruff check --select E,F,W --ignore E501.
  3. 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, pass bodies, raise NotImplementedError, or // TODO stubs are not acceptable.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.