Skip to main content

agent-policy

Schema-first generator for coding-agent repo policies and compatibility files.

Generates AGENTS.md, CLAUDE.md, .cursor/rules/, and .windsurf/rules/ (among others) from a single agent-policy.yaml.

crates.io npm PyPI docs.rs Docs site CI License: Apache-2.0

What it does

Maintaining AGENTS.md, CLAUDE.md, and Cursor rules separately means the same policy information gets duplicated across files that diverge over time. agent-policy solves this by letting you define your repo's coding-agent policy once in a canonical agent-policy.yaml, then generating all the tool-specific compatibility files from that single source of truth.

Keep one policy file. Generate all agent instruction files from it. Detect drift in CI.

Install

From npm (no Rust toolchain required)

npx agent-policy
# or install globally
npm install -g agent-policy

From PyPI (no Rust toolchain required)

pip install agent-policy-cli
# or with pipx (recommended for CLI tools)
pipx install agent-policy-cli
# or with uv
uv tool install agent-policy-cli

The PyPI package is agent-policy-cli; the command it installs is agent-policy.

From crates.io

cargo install agent-policy

Binary releases

Download pre-built binaries from GitHub Releases.

Quick start

# Create a starter policy
agent-policy init

# Edit agent-policy.yaml, then generate
agent-policy generate

# Add to CI to prevent drift
agent-policy check

Commands

Command Description
agent-policy init Write a starter agent-policy.yaml in the current directory
agent-policy list-targets View a table of all available export formats and their stability
agent-policy generate Generate all enabled output files from agent-policy.yaml
agent-policy lint Analyze agent-policy.yaml for semantic errors and warnings
agent-policy check Verify committed files match the current policy (CI use)
agent-policy install-hooks Install a pre-commit or pre-push git hook that runs check locally
agent-policy import Scaffold agent-policy.yaml by scraping an existing AGENTS.md or CLAUDE.md

Both generate and check accept --config / -c to specify a non-default config path, and --targets to natively override outputs:

agent-policy generate --config infra/agent-policy.yaml
agent-policy check --targets agents-md,clinerules

agent-policy.yaml

Minimal example:

project:
  name: my-project
  summary: A short description.
outputs:
  - agents-md

Note: You do not need to manually add .md outputs or target paths to your paths.generated config list. Any active outputs are injected into your generated list automatically!

Full example — see examples/website/agent-policy.yaml.

The file is validated against agent-policy.schema.json (JSON Schema Draft 2020-12). The schema is bundled with the binary and is versioned alongside it. It is considered unstable until v1.0.0.

Generated outputs

Target ID File Enabled by default Tool(s)
agents-md AGENTS.md Yes Codex, Windsurf, Copilot
claude-md CLAUDE.md No Claude Code, Copilot
cursor-rules .cursor/rules/*.mdc No Cursor
gemini-md GEMINI.md No Google Gemini CLI
windsurf-rules .windsurf/rules/*.md No Codeium Windsurf
clinerules .clinerules/*.md No Cline
copilot-instructions .github/copilot-instructions.md No Copilot (Global)
copilot-instructions-scoped .github/instructions/*.md No Copilot (Scoped Context)
junie-guidelines .junie/guidelines.md No JetBrains Junie

When outputting directory rules like cursor-rules or clinerules, agent-policy generates one default layout and optionally one file per customized role, intelligently assigning frontmatter globs and path references directly into the generated configurations to cleanly silo AI behaviors scope-to-scope!

CI integration

Add to your CI workflow to enforce that generated files are never edited by hand:

- name: Check agent policy
  run: agent-policy check

This step exits non-zero if any generated file is stale or missing, and prints a unified diff to stderr.

Non-goals

  • Not a replacement for AGENTS.md — it generates AGENTS.md
  • Not a full enforcement engine or policy-as-code runtime
  • Not a SaaS platform or hosted service
  • Not a daemon or background process

License

Apache-2.0

Metadata

Release files for agent-policy-cli 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for agent-policy-cli 0.7.0
File Actions
agent_policy_cli-0.7.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for agent_policy_cli-0.7.0-py3-none-win_amd64.whl
agent_policy_cli-0.7.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for agent_policy_cli-0.7.0-py3-none-manylinux_2_17_x86_64.whl
agent_policy_cli-0.7.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for agent_policy_cli-0.7.0-py3-none-manylinux_2_17_aarch64.whl
agent_policy_cli-0.7.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for agent_policy_cli-0.7.0-py3-none-macosx_11_0_arm64.whl
agent_policy_cli-0.7.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for agent_policy_cli-0.7.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 28.3 MB

Release files / agent_policy_cli-0.7.0-py3-none-win_amd64.whl

Download URL agent_policy_cli-0.7.0-py3-none-win_amd64.whl
Size 5.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ba724272b49c2cebc035a4adcdd201a4c35752f54467debc8e035263f9a8cf74
BLAKE2b-256 checksum
How to use checksums
ad0cd2eadebf22105f038ad1c371558337ce1258ccdfdd3e0cec5df90f626eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / agent_policy_cli-0.7.0-py3-none-manylinux_2_17_x86_64.whl

Download URL agent_policy_cli-0.7.0-py3-none-manylinux_2_17_x86_64.whl
Size 6.0 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c51f9194bbbd3ff69bd95ad3873e2865f4a61343e63a78345a2fa6283836ae74
BLAKE2b-256 checksum
How to use checksums
eac72fd574da502be65f2061aa1ba08688aff9e232b5a79333a1884978926380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / agent_policy_cli-0.7.0-py3-none-manylinux_2_17_aarch64.whl

Download URL agent_policy_cli-0.7.0-py3-none-manylinux_2_17_aarch64.whl
Size 5.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
357775537791f35344149fb059394de0ca36a5bc731fe0f47e886a878fff88c4
BLAKE2b-256 checksum
How to use checksums
680763eb5767e4f349a7757699341e661fea00a06cbe803a65e1316e75dac4fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / agent_policy_cli-0.7.0-py3-none-macosx_11_0_arm64.whl

Download URL agent_policy_cli-0.7.0-py3-none-macosx_11_0_arm64.whl
Size 5.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fa2f7b753c37a8fcb8e7ed7ae8a104976431031206bb5b3660832a603ab331d2
BLAKE2b-256 checksum
How to use checksums
29acb61aad384531538a9d47e7f2871901748fe529ff7589b68cd9711a93d00d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / agent_policy_cli-0.7.0-py3-none-macosx_10_12_x86_64.whl

Download URL agent_policy_cli-0.7.0-py3-none-macosx_10_12_x86_64.whl
Size 5.8 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
959791c386c6e74b435bee9f7abbfb7d30446abeeca963440a666222f2cdfdec
BLAKE2b-256 checksum
How to use checksums
876e07767e4c6b6124b52fc15323c5bf68ee38252f721ea64b7698919a15cb88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for agent-policy-cli 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for agent_policy_cli-0.7.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.0 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page