apm-policy.yml schema
Normative reference: this page documents the v0.2 working-draft policy schema as enforced by the current CLI. The normative, ratified contract for v0.1 is defined in OpenAPM v0.1, Section 6 (Policy) and published as JSON Schema at
policy-v0.1.schema.json.
The apm-policy.yml schema. One file per org or repo. Loaded by apm install, apm audit --ci, apm policy status, and the install preflight before any package is written to disk.
For the workflow (where to put the file, how to roll it out), see Govern with apm-policy.yml. For CLI usage of apm policy status, see apm policy. For the wider governance picture (rulesets, registry proxy, CI gating), see Governance deep-dive.
What apm-policy.yml governs
Section titled “What apm-policy.yml governs”apm-policy.yml is the install policy for agent primitives. In plain terms it decides:
- Which sources are trusted — which dependencies and MCP servers
apm installwill accept (theallow/deny/registry_sourcerules). - Which versions install — whether refs must be pinned to bounded constraints, and how version conflicts on required packages resolve.
- What the lockfile records and verifies — which artifacts the lockfile records, and what the install-time audit pass checks over them once written.
apm install enforces the dependency and MCP source rules, dependencies.max_depth, manifest.scripts and unmanaged_files.action: deny during install; manifest.scripts and unmanaged_files are judged the same way for a dependency install, --mcp and a local bundle (enforcement: warn warns, --dry-run previews each verdict without writing); apm audit --ci evaluates every rule on this page. Together they govern what gets installed — not what a running agent is later allowed to do.
What apm-policy.yml does NOT govern
Section titled “What apm-policy.yml does NOT govern”apm-policy.yml is not a runtime permission system. It does not control:
- Runtime permissions — what an agent may read, write, or call once it is running.
- Sandboxing — process isolation or resource limits for a running agent.
- Agent behavior — what a running agent actually does with the primitives it was given.
- Marketplace enablement — which tools or extensions a harness exposes to the agent.
Those controls are owned by the agent harness that runs your agents, not by APM. APM stops at install: it decides what reaches disk, and the harness decides what runs.
File location
Section titled “File location”Discovery order, in priority:
- Explicit policy source on
apm audit --civia--policy <ref>orapm policy statusvia--policy-source <ref>.apm installauto-discovers from the project’s git remote and supports--no-policy; it does not accept--policytoday. - Auto-discovery from the project’s git remote — checks the org policy repo cascade (
.github-private,.github,.apm,_apm; Azure DevOps uses repositoryapm-policyin projectapm, then falls back to legacy_apm/_apmonly after a 404). When no candidate has a policy, the install proceeds silently;apm policy statusreports outcomeabsent(see output fields). On GitHub, if.github-privatereturned 404, the status adds a hint that the credential may lack read access, because GitHub also answers 404 for private repositories you cannot read. Offline, an unreachable earlier candidate does not hide a policy cached from a later one: a cached policy up to 7 days old is applied, and output names it as stale. An authentication error still fails closed.
The <ref> accepts:
- A local file path.
- An
https://URL (plainhttp://is rejected). - The literal string
org(force git-remote auto-discovery). <owner>/<repo>shorthand (defaults togithub.com).<host>/<owner>/<repo>for GHES or other hosts.
Do not embed credentials in direct policy URLs. APM strips URL userinfo, query strings, and fragments from policy cache metadata and diagnostics; use the repository forms above with the normal host authentication chain when possible.
Top-level fields
Section titled “Top-level fields”| Field | Type | Default | Required | Notes |
|---|---|---|---|---|
name | string | "" | no | Human label. Surfaces in apm policy status. |
version | string | "" | no | Free-form. Useful for change tracking. |
extends | string or null | null | no | Parent policy reference. See Inheritance. |
enforcement | enum | warn | no | off / warn / block. See Enforcement modes. |
fetch_failure | enum | warn | no | warn / block. Behavior when a remote policy cannot be fetched or parsed. |
cache | object | {ttl: 3600} | no | Cache settings for remote policy fetches. ttl is capped at 86400 (24 hours). |
dependencies | object | see section | no | Rules over APM dependencies. |
mcp | object | see section | no | Rules over MCP servers (direct and transitive). |
compilation | object | see section | no | Rules over apm compile outputs. |
manifest | object | see section | no | Rules over apm.yml content. |
unmanaged_files | object | see section | no | Rules over files in target directories not tracked by the lockfile. |
security | object | see section | no | Rules over APM’s security checks: install-time audit and external scanners (require the external-scanners flag), lockfile hashes and drift. |
registry_source | object | see section | no | Mandate registry usage and block non-registry sources (requires registries flag). |
marketplace | object | see section | no | Restrict the marketplace catalogs a project apm.yml may declare. See marketplace. |
executables | object | see section | no | Org ceiling for executable-primitive trust (hooks, bin, self-defined MCP, LSP, canvas). See executables. |
bin_deploy | object | see section | no | DEPRECATED alias folded into executables.deny (bin-scoped). See bin_deploy. |
Unknown top-level keys produce a warning, never an error — so newer policy
files load on older clients. apm policy status --json returns these in the
warnings array. Known fields with the wrong native YAML type are rejected
instead of being silently replaced by defaults.
Enforcement modes
Section titled “Enforcement modes”enforcement is the global outcome dial. Per-rule severities feed into this dial:
| Mode | Behavior |
|---|---|
off | Policy is loaded and reported, but never blocks. Useful during rollout. |
warn | Violations print [!] warnings but exit code stays 0. Default. |
block | Violations print [x] errors and exit non-zero. apm install aborts before writing to disk. |
fetch_failure controls fail-closed behavior on the policy fetch itself (network down, malformed YAML, host mismatch). Set to block in production CI to refuse to run when policy cannot be loaded.
| Field | Type | Default | Notes |
|---|---|---|---|
ttl | integer | 3600 | Seconds. Must be > 0. Applies to remote extends: and URL fetches. |
dependencies
Section titled “dependencies”Rules over the dependencies: and mcp: blocks declared in consumer apm.yml files.
When a dependency matches deny, apm install will not download or deploy that artifact. With enforcement: block, the install aborts before the denied package is downloaded or deployed. deny is an install-time decision, not a runtime block: it stops a denied artifact from being installed, and does not constrain what an already-installed or otherwise-present artifact does at runtime.
deny also covers local bundles and apm pack. apm install <bundle> checks the bundle’s own package name as _local/<name> (so **/<name> matches it) and every package its embedded apm.lock.yaml records. apm pack refuses when a declared dependency or a package in the project’s apm.lock.yaml is denied; pack applies no other dependency rule.
allow judges a local bundle by the packages its embedded apm.lock.yaml records, with the same matching as remote dependencies. It never matches the bundle’s own name (_local/<name>), which the bundle author chooses. Under an allow list, a bundle that records no packages is a violation. With enforcement: block, a bundle with any allow violation is refused before any file is written; warn reports it and installs, and off skips the check. Without an allow list, bundle installs are unchanged.
| Field | Type | Default | Notes |
|---|---|---|---|
allow | list of patterns or null | null | null = no opinion. [] = nothing allowed. [...] = only these. |
deny | list of patterns or null | null | null = no opinion (transparent during merge). [] = adds nothing; inherited entries still apply. Always wins over allow. |
require | list of refs or null | null | null = no opinion (transparent during merge). [] = adds nothing; inherited entries still apply. Packages every consumer manifest must include. Exact and host-bound; see below. |
require_resolution | enum | project-wins | project-wins / policy-wins / block — how to resolve version conflicts on required packages. |
max_depth | integer | 50 | Maximum depth in the resolved dependency graph. Canonical source identities are ref-insensitive and first-wins: later edges reuse the same dependency at its existing depth, even with a different ref, while a different origin remains distinct. Must be > 0. Under enforcement: block, apm install stops resolving at the limit and refuses the deeper chain before fetching past it; under warn it warns. |
require_pinned_constraint | boolean | false | When true, every direct APM dep declared in apm.yml must use a bounded constraint (exact, ^/~/bounded range, literal tag such as v1.2.3 or pkg-a-v1.2.3 for a package named pkg-a, exact package release tag such as name@1.2.3 or @scope/name@1.2.3, or SHA). The declared constraint is judged, not the tag a range resolved to; transitive deps are not evaluated. Unbounded refs (missing ref, *, bare branch, bare >=X.Y) are routed through policy.enforcement (warn / block). Enabling on existing projects will likely surface violations; roll out with enforcement: warn first. |
require_pinned_constraint reference
Section titled “require_pinned_constraint reference”Examples (with require_pinned_constraint: true and enforcement: block):
dependencies: apm: - acme/skills # FAIL: no ref (NO_REF) - other/lib#>=1.0.0 # FAIL: unbounded upper (OPEN_UPPER) - third/lib#* # FAIL: wildcard (WILDCARD) - acme/lib#main # FAIL: bare branch (BARE_BRANCH) - fourth/lib#^1.2.0 # OK: caret range - fifth/lib#~1.2.3 # OK: tilde range - sixth/lib#1.5.3 # OK: exact version (bare) - sixth_eq/lib#=1.5.3 # OK: exact version (npm/cargo explicit equality) - sixth_pip/lib#==1.5.3 # FAIL: pip-style operator not supported (BARE_BRANCH) - seventh/lib#v1.5.3 # OK: literal tag - ninth/lib#v01.5.3 # FAIL: leading zero is not SemVer (BARE_BRANCH) - acme/mono/packages/pkg-a#pkg-a-v1.5.3 # OK: this package's own release tag - shadcn/ui#shadcn@4.12.0 # OK: exact package release tag (name@X.Y.Z) - acme/mono/packages/pkg-a#pkg-b-v1.5.3 # FAIL: another package's tag (BARE_BRANCH) - eighth/lib#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa # OK: SHA - ./packages/local # OK: local-path dep (no version surface)Diagnostic shape (ASCII-only, [x] for block, [!] for warn):
[x] Policy violation: acme/lib -- bare branch 'main' tracks a moving tip Blocked by org policy at org:contoso/.github (dependency-pinned-constraint). Nothing was changed. Pin `acme/lib` to a semver range, tag, or SHA in apm.yml, or contact your policy admin to allow it. Run `apm policy status` to see the active policy.[x] Policy violation: acme/skills -- no ref; resolves to default branch Blocked by org policy at org:contoso/.github (dependency-pinned-constraint). Nothing was changed. Pin `acme/skills` to a semver range, tag, or SHA in apm.yml, or contact your policy admin to allow it. Run `apm policy status` to see the active policy.apm audit --ci lists the same dependencies under dependency-pinned-constraint details:.
A range is classified as the author wrote it: fourth/lib#^1.2.0 stays OK after the install selects v1.4.0 for it, and acme/lib#main stays FAIL whatever commit it resolves to. The package name used for {name}-v{version} and {name}--v{version} tags is the final path segment of a subdirectory dependency, otherwise the repository name. An exact name@X.Y.Z or @scope/name@X.Y.Z tag (optional v, semver prerelease/build allowed, at most one scope segment) counts for any name, because monorepo tags often name the published package rather than the directory. release@next, feature/x@1.2.3, name@^1.2.0 and name@1.x are not exact releases and still fail. The check judges declared release intent, not immutability: a tag can be moved. Replaying a committed lockfile with apm install --frozen installs the locked commit; security.integrity.require_hashes only requires every locked entry to carry a content hash, so an update can still record a moved tag’s new commit.
Patterns are matched against <owner>/<repo> (hostless, any host) or <host>/<owner>/<repo> (that host only; see Allow-list semantics). Wildcards via shell-style globs, e.g. contoso/*.
require entries are exact and name one host. A hostless entry names the default host (GITHUB_HOST, else github.com); a package on any other host (GitLab, GHES, Gitea) must be written with its host:
dependencies: require: - contoso/baseline # on the default host - gitlab.example.com/platform/sub/pkg # on a self-managed GitLabrequired-packages (declared in apm.yml) and required-packages-deployed (present in apm.lock.yaml) compare the same identity. An entry that matches no declared package fails both checks; when the package is declared on another host, the message names that host and the policy entry that would match it, so you can either move the dependency or, for a trusted host, change the entry.
A dependency written as an explicit registry-proxy path (art.example.com/artifactory/github/acme/tools) is identified by the proxy host: require it as art.example.com/acme/tools. Both checks pass, because apm.lock.yaml records that package under the same host. To keep default-host entries matching instead, set PROXY_REGISTRY_URL and keep plain shorthand.
A project’s default_host: does not change what a hostless entry names, and GITHUB_HOST can differ between machines: for an org-wide policy, write every require entry with its host. Ports are ignored, as for deny.
Required-package matching follows source replacement. When a root replace: rule swaps example-org/app for fork-org/app-fork, an entry identifies the selected package. Write fork-org/app-fork (with its host, if that is not the default). required-packages-deployed reads the lock entry, which stays recorded under example-org/app. apm install and apm audit --ci match the same way, and both judge registry_source against the selected source.
Rules over MCP server references, including transitive ones declared by deep dependencies.
| Field | Type | Default | Notes |
|---|---|---|---|
allow | list or null | null | Same null/empty/list semantics as dependencies.allow. |
deny | list | [] | Always wins. |
transport.allow | list or null | null | Allowed transports: stdio, streamable-http, sse (http is an alias of streamable-http). Checked against the effective transport APM writes, including registry servers, by install, update and apm audit --ci; a registry server whose transport cannot be resolved is a violation (blocked under enforcement: block, a warning under the default warn). null = no opinion. |
self_defined | enum | warn | allow / warn / deny — treatment of MCP servers defined inline in apm.yml. |
trust_transitive | boolean | false | When false, transitive MCP servers must be explicitly allow-listed. |
compilation
Section titled “compilation”| Field | Type | Default | Notes |
|---|---|---|---|
target.allow | list or null | null | Allowed targets, e.g. copilot, claude. Aliases resolve (vscode is copilot); all allows every target. |
target.enforce | string or null | null | If set, the target selection must include this target. |
strategy.enforce | enum or null | null | distributed / single-file. Pins the compilation strategy. |
source_attribution | boolean | false | Require source-attribution headers in compiled outputs. |
manifest
Section titled “manifest”| Field | Type | Default | Notes |
|---|---|---|---|
required_fields | list of strings | [] | Top-level keys every apm.yml must declare (e.g. description, license). |
scripts | enum | allow | allow / deny — whether scripts: blocks are permitted. apm install refuses (block) a scripts: block in the manifest it installs (--root, -g, --mcp and local bundles included) before fetching or writing anything, or warns (warn); apm audit --ci fails it too. apm run does not consult it. |
content_types | object or null | null | {allow: [...]}. Restricts primitive content types (e.g. skill, prompt). |
require_explicit_includes | boolean | false | When true, manifests must declare an explicit includes: list rather than rely on directory globs. |
unmanaged_files
Section titled “unmanaged_files”Files in primitive target directories that are not recorded in apm.lock.yaml.
| Field | Type | Default | Notes |
|---|---|---|---|
action | enum | ignore | ignore / warn / deny. deny blocks installs that would leave drift: under enforcement: block, apm install refuses when a governed directory would hold a file no lockfile row claims. --mcp and a local bundle refuse before writing anything; an install that deploys packages or local .apm/ content restores every file it deployed and its lockfile; --dry-run previews it; apm audit --ci fails the same state. Known limit: this verdict needs the deployed files, so an install killed between deploy and restore leaves them unrecorded. |
directories | list of paths | [] | Subset of target directories to check. Empty = all known target directories. |
exclude | list of globs | null | Workspace path globs to suppress from the report. Use to silence known harness-managed artifacts. Excluded paths are never reported. null = no opinion (transparent in the extends: merge); merges as a union down the chain. |
Each reported file is a divergence-visibility finding, not a security verdict
— apm.lock.yaml is hand-editable YAML, so this surfaces drift rather than
proving a supply-chain attack. Every finding is enriched in place:
- a factual reason —
not tracked in apm.lock.yaml; - a lazy primitive-type tag (
[type: skill|agent|instruction|mcp]) classified only for the already-flagged file, never the whole tree; - a deny-conflict note —
matches deny rule (<pattern>)— when the path matches this policy’s owndependencies.denyormcp.deny. This is surfaced for a human to resolve; APM never removes or blocks the file on this basis.
[!] .github/agents/rogue.agent.md [type: agent] -- not tracked in apm.lock.yaml; matches deny rule (**/rogue*)A merged hook config (for example .claude/settings.json) and its
apm-hooks.json sidecar count as managed only while their ownership is
attested by the committed lock or the committed apm.yml approval. Every entry
the sidecar records must name a dependency the lock records, or a local
bundle whose exact approval key apm.yml grants hooks: true, and the config’s
hooks must be exactly those entries. Any user-authored hook in the file, or a
linked, unreadable or hand-edited file, leaves both files unmanaged. Other
keys in the config are covered at file granularity. A special file (such as a
FIFO) in a governed directory is always reported.
With no executables block, bundle hook files count as unmanaged; approve them to attest.
security
Section titled “security”Rules over APM’s security checks. The audit.on_install, audit.external
and audit.scanners keys take effect only when the external-scanners
experimental flag is enabled; they are ignored otherwise.
audit.fail_on_drift and integrity.require_hashes always apply.
| Field | Type | Default | Notes |
|---|---|---|---|
audit.on_install | enum or null | null | off / warn / block. Minimum install-time audit mode (a floor). null = no opinion. warn records findings; block halts installs on critical findings. |
audit.external | list of strings | null | External SARIF scanner names (e.g. skillspector) that MUST run during the install audit. A required scanner that is unavailable fails the install closed. |
audit.scanners | mapping or null | null | Per-scanner governance, keyed by scanner name. Each value accepts allow_args (boolean). Restrict-only: see below. Unknown scanner names are a warning, not an error (forward-compat). |
audit.fail_on_drift | boolean | false | When true, a bare apm audit exits non-zero if the workspace content has drifted from the lockfile. Default-off keeps drift advisory (rendered, exit 0). Only changes the exit code — the drift scan itself is unchanged. apm audit --ci already gates on drift regardless of this key. |
integrity.require_hashes | boolean | false | When true, every non-local lockfile entry MUST carry a content hash; a missing or empty hash fails the install closed. Default-off preserves current behavior. Asserts hash-presence on the lockfile entry (no second hashing pass). Local dependencies are exempt (verified via deployed-file hashes). |
Per-scanner governance (audit.scanners)
Section titled “Per-scanner governance (audit.scanners)”security: audit: scanners: skillspector: allow_args: false # forbid extra-args passthrough at install timeaudit.scanners is restrict-only. A policy may tighten a scanner’s
behaviour but can never expand it:
allow_args: falsestrips any user/CLIexternal.<name>.args(and--external-args) for that scanner at install time, locking it to a vetted invocation.true/ omitted leaves the user’s args in place (still allowlist-validated by the adapter).- Policy never contributes argv tokens itself and never forces LLM mode
on. LLM opt-in stays a local user decision (
--external-llmorexternal.<name>.llm). This removes any project-policy argv-injection or egress-coercion surface.
The floor is enforced during apm install (where org policy is loaded). A bare
apm audit --external run does not load org policy and relies on the adapter’s
allowlist validation for arg safety.
audit.on_install is a floor: it can only raise the effective mode chosen by
apm install --audit / apm config set audit-on-install, never relax it. apm install --force downgrades a block to warn for that invocation; apm install --no-policy skips the policy floor entirely.
Integrity and drift enforcement
Section titled “Integrity and drift enforcement”security: integrity: require_hashes: true # fail the install if any locked entry lacks a hash audit: fail_on_drift: true # `apm audit` exits non-zero on workspace driftBoth keys are additive, optional, and default off. require_hashes is
enforced during apm install (the lockfile must record a content hash for
every non-local entry, or the install fails closed). fail_on_drift is
enforced by apm audit: when drift is detected it escalates the exit code to
1. Both keys only ever tighten — a child policy cannot relax a parent that
turned them on.
Inheritance
Section titled “Inheritance”extends: resolves a parent policy. Maximum chain depth is 5; cycles are rejected.
extends: accepts:
org— the same org’s auto-discovered policy repo.<owner>/<repo>— another repo on the same host.https://...— a direct URL.
For supply-chain safety, extends: references are pinned to the leaf policy’s host — a policy fetched from github.com cannot extend one on evil.example.com.
If any parent is unreachable, the chain is incomplete and enforcement fails
closed. APM never applies the weaker subset that happened to resolve.
Merge rules
Section titled “Merge rules”A child can add restrictions but never remove a parent’s. A child [] on a
deny or require list adds nothing and does not clear the inherited
entries. One field widens instead: unmanaged_files.exclude entries are
unioned, so a child can exclude more paths from the parent’s
unmanaged-files check.
| Field family | Merge rule |
|---|---|
enforcement | Stricter wins (block > warn > off). |
fetch_failure | Stricter wins (block > warn). |
cache.ttl | min(parent, child). |
*.allow lists | Set intersection. null is transparent (no opinion). |
*.deny / require lists | Union, deduplicated, parent order preserved. Omitting the field, null and [] all leave the parent list unchanged; a child cannot drop a parent entry. |
dependencies.max_depth | min(parent, child). |
manifest.require_explicit_includes | Logical OR; once enabled, descendants cannot relax it. |
dependencies.require_resolution | Stricter wins (block > policy-wins > project-wins). |
dependencies.require_pinned_constraint | Logical OR — once a parent enables it, child cannot relax. |
mcp.self_defined | Stricter wins (deny > warn > allow). |
mcp.trust_transitive | Logical AND (true only if both sides true). |
manifest.scripts | Stricter wins (deny > allow). |
unmanaged_files.action | Stricter wins (deny > warn > ignore). |
unmanaged_files.exclude | Union, deduplicated; additive-only. null and [] both preserve the parent list; a child cannot clear an inherited exclude. |
security.audit.on_install | Stricter wins (block > warn > off). null is transparent. |
security.audit.external | Union, deduplicated. null is transparent. |
security.audit.scanners | Union of scanner names; per scanner allow_args is AND-merged (any ancestor false wins — tightening). null is transparent. |
security.audit.fail_on_drift | Logical OR — once a parent enables it, a child cannot relax. |
security.integrity.require_hashes | Logical OR — once a parent enables it, a child cannot relax. |
executables.deny_all | Logical OR — any ancestor kill-switch (true) sticks. |
executables.deny / require / recommend / enforce | Union, deduplicated. A child adds packages but never drops a parent’s. |
compilation.*.enforce | First non-null wins (parent precedence). |
compilation.source_attribution | Logical OR. |
A merged chain is reported by apm policy status with each layer’s source attributed.
Allow-list semantics
Section titled “Allow-list semantics”For every allow: field, the three states are distinct:
| Value | Meaning | Inheritance behavior |
|---|---|---|
| omitted | ”no opinion” | Transparent during merge. |
[] | ”explicitly nothing” | Intersects to nothing downstream. |
[...] | ”only these patterns” | Intersected with child list. |
deny and require lists distinguish the same three values, but merge by union, so no value removes a parent entry:
| Value | Meaning | Inheritance behavior |
|---|---|---|
omitted / null | ”no opinion” | Transparent during merge — parent value passes through. |
[] | ”nothing to add” | Adds nothing; parent entries still apply. |
[...] | ”these entries” | Unioned with parent list (parent order preserved). |
Identity casing
Section titled “Identity casing”allow, deny, and exact require patterns match on each dependency’s canonical identity casing, not the pattern’s literal case. GitHub owner/repository identities, and registry-backed identities (already canonicalized that way), compare case-insensitively — Contoso/Repo and contoso/repo are the same package. Non-GitHub git hosts, ADO, local paths, marketplace identities, virtual in-repository subpaths (the path segment after owner/repo), Git refs/version strings (after #), MCP server names, and registry names stay case-sensitive.
A hostless allow or deny pattern such as owner/repo matches that package on any host (a hostless require entry names the default host only); a host-qualified pattern such as github.com/owner/** matches only dependencies whose effective host (written, or GITHUB_HOST/github.com by default) is that host. Hosts compare case-insensitively and exactly. Put the owner/repository segments before recursive **; when a leading or fused ** makes their position ambiguous, later literal segments remain case-sensitive. deny takes precedence whenever a pattern matches.
For example, a mixed-case deny written as **/Secure-Baseline does not fire against the canonical lowercase repository name; write the owner/repository prefix first. A mixed-case owner-prefix deny that older releases failed to match can correctly surface new violations after upgrade.
Lowercase owner/repository patterns match before and after this fix. APM 0.30.0 and earlier match patterns byte-exactly, so lowercase duplicates added as a workaround stay necessary until every runner runs a release whose notes carry this fix.
Upgrading can also broaden allow matches on case-insensitive sources when a
case-variant entry previously missed. Re-audit allow lists alongside deny and
require entries during rollout.
Complete example
Section titled “Complete example”# .github/apm-policy.yml -- shipped from the first auto-discovered policy reponame: contoso-baselineversion: "2025.05"extends: contoso-enterprise/policy
enforcement: blockfetch_failure: block
cache: ttl: 1800
dependencies: allow: - contoso/* - microsoft/apm-skills-* deny: - "*/legacy-*" require: - contoso/security-baseline require_resolution: policy-wins max_depth: 25
mcp: allow: - github/github-mcp-server - contoso/internal-mcp-* transport: allow: - stdio - streamable-http self_defined: deny trust_transitive: false
compilation: target: allow: - copilot - claude strategy: enforce: distributed source_attribution: true
manifest: required_fields: - description - license scripts: deny content_types: allow: - skill - prompt - instruction require_explicit_includes: true
unmanaged_files: action: deny directories: - .github/instructions - .github/prompts exclude: - .github/copilot-instructions.mdregistry_source
Section titled “registry_source”Mandate that APM dependencies come from configured registries. Checks apply transitively (including transitive deps pulled in by registry packages).
| Field | Type | Default | Description |
|---|---|---|---|
require | list<string> | [] | Registry names that MUST be reachable. APM fails-closed if a listed name has no URL in the merged registry map (from project apm.yml, workspace ~/.apm/apm.yml, or ~/.apm/config.json) — this is intentional: a missing registry config is treated as a policy violation, not a no-op. |
allow_non_registry | bool | true | When false, APM blocks installation of any dependency not routed through a configured registry. |
registry_source: require: - jf-skills allow_non_registry: falsemarketplace
Section titled “marketplace”Restrict the marketplace catalogs a root project apm.yml may declare under
marketplaces:, and the catalogs its
marketplace packages are installed from: the catalog origin apm.lock.yaml
records (source_url) and that of each fresh resolution, whether it came
through the map or a registration. A locked package with no recorded origin
is refused. Checked by the install policy gate and apm audit --ci. To clear
a refused package, remove its apm.yml entry and run apm install, then add
it back from an allowed catalog (apm update keeps the recorded catalog).
| Field | Type | Default | Description |
|---|---|---|---|
allow | list<string> or null | null | Catalog origins every declared marketplace and every locked or resolved marketplace package must match, as host/path globs (* = one segment, ** = any depth). A scheme, userinfo, .git and host case are ignored. null = no opinion; [] = no project may declare or install from a marketplace. A local-path catalog never matches. |
marketplace: allow: - github.com/contoso/* - gitlab.example.com/platform/agent-marketplaceexecutables
Section titled “executables”The org ceiling for executable-primitive trust. Unifies the executable-trust
vocabulary onto one noun, executables, governing all five gated types: hooks,
bin/ executables, self-defined MCP servers (registry: false), LSP servers,
and canvas extensions. The org layer is the ceiling on deny — it can deny
and require fleet-wide, and recommend a vetted set, but personal or project
consent can never widen past an org deny.
| Field | Type | Default | Description |
|---|---|---|---|
deny_all | bool | false | When true, blocks every executable type for every package org-wide. |
deny | list<string> | [] | Canonical package strings whose executables must not deploy. Deny is the ceiling and always wins, and is the only side that supports fnmatch globs in v1, e.g. evil/* blocks every package under evil/. |
require | list<string> | [] | Packages whose executables MUST be present and trusted (exact-match only in v1). A required package whose executables are untrusted hard-fails the required-executable-untrusted audit check in CI. require mandates presence + trust but does not grant execution — it stays a developer-consent decision. To mandate AND auto-deploy fleet-wide, list the package in BOTH require and recommend. |
recommend | list<string> | [] | Org-vetted set (exact-match only in v1): default-allowed unless locally denied. Bulk-accepted with apm approve --recommended. |
enforce | list<string> | [] | v2 mandate tier; accepted but INERT in v1 — it degrades to recommend (no force-execute; a user deny still overrides). Writing it emits a deprecation-style warning. |
Glob scope (v1): only
denysupports glob patterns (it is the safety ceiling — broad denial is safety-positive).allow,recommend, andrequireare exact-match only; widening the GRANT side with a wildcard has a larger blast radius and is deferred.
Ports: a dependency on a non-default port has the key
host:port/owner/repo.denyignores the port, soacme/toolalso deniesgithub.com:8443/acme/tool.allow,recommend, andrequiremust name the ported key.
executables: deny_all: false deny: ["evil/*"] require: ["acme/ci"] recommend: ["acme/fmt"]The install gate and apm audit resolve trust through one shared deny-wins,
first-match-wins ladder (org deny > user deny > project deny > project allow >
user allow > org recommend > default-deny). Each locked dependency records the
resolved state in the exec_status field of apm.lock.yaml (one of
deployed, gated_pending_approval, denied, absent). For the consumer-side
commands that write project and personal trust, see
apm approve and apm deny.
There is no enforce mandate runtime or cryptographic signing in this release:
an executables.enforce rung is accepted in policy but fail-safe degrades to
recommend (allowed, still overridable by a deny). Ordinary dependency grants
remain package-scoped. Local bundle hook, MCP, LSP, and canvas grants use the exact
SHA-256 content key printed by apm install; changed bundle content requires a
new grant.
bin_deploy
Section titled “bin_deploy”Deprecated:
bin_deployis the bin-scoped predecessor ofexecutables. It is folded intoexecutables.deny(bin type only) and honored as an alias for one minor cycle. Preferexecutables.denyfor new policies.
A Claude marketplace or native plugin loads as one unit: APM deploys it whole, bin/ included, and Claude Code adds the plugin’s root bin/ to the Bash tool’s PATH. The contract is Claude-specific, so bin/ deployment only targets Claude. Restart Claude Code (or run /reload-plugins) after install for new executables to be picked up.
Security note: deployed executables are tightened to 0o700 on POSIX systems and placed on Claude Code’s PATH, so Claude can invoke them without further confirmation. Use this field to opt out globally or per-package in enterprise environments. The --trust-bin / --no-trust-bin flags on apm install give per-invocation consent: --trust-bin deploys bin/ without the trust-posture warning. Because the plugin is one unit, --no-trust-bin, or a non-interactive install without --trust-bin, parks the whole plugin, not only bin/.
Scope: for the claude target, bin/ stays inside the plugin APM deploys whole to .agents/plugins/<plugin>/ (~/.agents/plugins/ with -g); a denied bin/ parks the whole plugin. See Native plugins.
Authoring plugins that ship bin/: see Repo shapes for marketplace producers for the producer-side contract (directory layout, executable bit, scope and trust posture).
| Field | Type | Default | Description |
|---|---|---|---|
deny_all | bool | false | When true, suppresses bin/ deployment for every marketplace_plugin package, regardless of individual deny entries. |
deny | list<string> | [] | Package identities whose bin/ executables must not be deployed. Entries are normalized before matching, so MyOrg/MyPlugin, github.com/myorg/myplugin, and https://github.com/myorg/myplugin.git all match myorg/myplugin. |
bin_deploy: # Block all bin/ deploys organisation-wide: deny_all: truebin_deploy: # Allow bin/ deploys except for one specific package: deny: - myorg/untrusted-pluginDoes my harness’s managed configuration replace APM?
No. apm-policy.yml controls what gets installed; your harness controls what runs; they do not overlap.
See also
Section titled “See also”- apm policy — the
apm policy statuscommand. - Govern with apm-policy.yml — end-to-end rollout guide.
- Enforce in CI — wiring
apm audit --ciinto branch protection. - Governance deep-dive — the full enterprise control surface.
Copyright (c) Microsoft Corporation. General documentation: CC-BY-4.0. Software, code examples and OpenAPM: Apache-2.0. See scope and exclusions.