agentleFS
MicrosoftKnown publishermicrosoft/agent-governance-toolkit/agent-governance-python/agent-compliance/AGENTS.md

agent-governance-toolkit / agent-compliance

AGENTS.md6.4k starsChanged 2 months agoMITView on GitHub

Agent Compliance (agent-governance-toolkit) provides runtime policy enforcement and security scanning for AI agent systems. This package ensures agents operate within organizational compliance boundaries and security policies. Core Capabilities: Security exemptions use .security-exemptions.json: Security scanner integrates with: - detect-secrets: Secret detection - pip-audit: Python CVE scanning - npm audit: Node.js CVE scanning - bandit: Python SAST All tool integ

  • Deletes or force-pushes
  • Installs packages

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

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    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:

    All public APIs must have type hints

    line 49
  2. Very specific:

    Use dataclasses for simple data structures, Pydantic for validation-heavy ones

    line 50
  3. Very specific:

    Test fixtures (/tests/fixtures/, /test_data/)

    line 67
  4. Distinctive:

    All new features must include corresponding tests

    line 85
  5. Very specific:

    Run tests before committing: pytest tests/ -v

    line 87
  6. Very specific:

    Temporary exemptions: Must have expires field (ISO 8601 date)

    line 114
  7. Distinctive:

    Never skip: test coverage for new features

    line 120
  8. Distinctive:

    Keep backward compatibility in public APIs

    line 121
  9. Distinctive:

    All tool integrations gracefully handle missing tools (skip scan if not available).

    line 131
  10. Very specific:

    Use conventional commits: feat:, fix:, docs:, test:, refactor:, chore:

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md

Agent Compliance - Coding Agent Instructions

Project Overview

Agent Compliance (agent-governance-toolkit) provides runtime policy enforcement and security scanning for AI agent systems. This package ensures agents operate within organizational compliance boundaries and security policies.

Core Capabilities:

  • Security Scanning: Automated detection of secrets, CVEs, dangerous code patterns, and unsafe operations
  • Runtime Policy Enforcement: OWASP ASI 2026 controls and integrity verification

Build & Test Commands

# Install dependencies (development mode)
pip install -e ".[dev]"

# Run all tests
pytest tests/ -v

# Run tests with coverage
pytest tests/ --cov=src/agent_compliance --cov-report=html --cov-branch

# Type checking
pyright src/

# Lint and format
ruff check . --fix
ruff format .

Code Style

  • Formatter/Linter: Ruff (line-length: 100, target: Python 3.10+)
  • Type checker: Pyright basic mode with ignore for missing stubs
  • Docstrings: Google-style for public APIs
  • Imports: Sorted alphabetically, grouped (stdlib → third-party → first-party → local)

Key Files

FilePurpose
src/agent_compliance/security/scanner.pySecurity scanning engine (secrets, CVEs, code patterns)
src/agent_compliance/security/schemas/JSON schemas for security exemptions
tests/test_security_scanner.pySecurity scanner test suite (25 tests)

Coding Conventions

  • All public APIs must have type hints
  • Use dataclasses for simple data structures, Pydantic for validation-heavy ones
  • SecurityFinding fields: severity, category, title, file, line, code, description, recommendation, cwe, cve
  • Severity levels: critical, high, medium, low (critical/high block PRs)

Security Scanning

What Gets Scanned

  • Python files (*.py)
  • JavaScript/TypeScript (*.js, *.ts)
  • Shell scripts (*.sh, *.bash)
  • PowerShell (*.ps1)
  • Dependency files (requirements.txt, package.json, pyproject.toml)
  • Code blocks in markdown files (skills and agents)

What's Excluded

  • Test fixtures (**/tests/fixtures/**, **/test_data/**)
  • Example files (**/examples/**, **/*.example.*)
  • Build artifacts (**/dist/**, **/node_modules/**, **/__pycache__/**)
  • Documentation (most README.md, docs/**/*.md)

Severity Configuration

SEVERITY_CONFIG = {
    "critical": {"blocks": True},   # Hardcoded secrets, RCE, CVSS ≥ 9.0
    "high": {"blocks": True},       # Command injection, SQL injection, CVSS 7.0-8.9
    "medium": {"blocks": False},    # Weak crypto, CVSS 4.0-6.9
    "low": {"blocks": False},       # Best practices, CVSS < 4.0
}

Testing Requirements

  • All new features must include corresponding tests
  • Security tests: Cover finding creation, exemption matching, pattern detection, formatting
  • Run tests before committing: pytest tests/ -v
  • Aim for >90% code coverage on new code

Exemption System

Security exemptions use .security-exemptions.json:

{
  "version": "1.0",
  "exemptions": [
    {
      "tool": "detect-secrets",
      "file": "tests/fixtures/mock.py",
      "line": 10,
      "reason": "Test fixture with intentionally fake credentials",
      "approved_by": "security-team"
    }
  ]
}

Exemption Matching

  • File + line: Exact match
  • Category + file: Any line in file
  • CVE identifier: Matches across all files
  • Temporary exemptions: Must have expires field (ISO 8601 date)

Boundaries

  • Never commit secrets, credentials, or API keys
  • Never loosen severity blocking thresholds without approval
  • Never skip test coverage for new features
  • Keep backward compatibility in public APIs

Integration with External Tools

Security scanner integrates with:

  • detect-secrets: Secret detection
  • pip-audit: Python CVE scanning
  • npm audit: Node.js CVE scanning
  • bandit: Python SAST

All tool integrations gracefully handle missing tools (skip scan if not available).

Commit Style

Use conventional commits: feat:, fix:, docs:, test:, refactor:, chore:

Example:

feat(security): add support for shell script scanning

- Add _check_shell_code_block method
- Detect dangerous rm -rf patterns
- Add tests for shell code validation

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.