You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b80da69
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -85,7 +85,7 @@ The `--target` flag accepts a comma-separated list (`copilot,claude,cursor,openc
85
85
- Running `apm compile` does not re-run the security scan. The scan happens at install time. If you hand-edit primitives between installs, run `apm audit` to scan them.
86
86
-`--clean` removes orphaned `AGENTS.md` files from previous compilations. Without it, removed primitives can leave stale output behind.
- `apm audit --ci`exits 1 on any failure -- this is the gate you wire into branch protection. The local `apm audit` exits 0 even when findings exist, unless you also pass `--strip` and writes fail.
141
141
- The drift check rebuilds the full context from scratch; on large repos, expect a few seconds of overhead. If your CI loop cannot afford it, narrow with `--no-drift` and accept reduced coverage.
142
142
143
-
**Read more:** [`apm audit` reference](/apm/reference/cli/install/), [policy reference](/apm/enterprise/policy-reference/) for the full check list, [security](/apm/enterprise/security/).
143
+
**Read more:** [`apm audit` reference](/apm/reference/cli/audit/), [policy reference](/apm/enterprise/policy-reference/) for the full check list, [security](/apm/enterprise/security/).
Copy file name to clipboardExpand all lines: docs/src/content/docs/enterprise/apm-policy.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The `apm-policy.yml` schema, inheritance, and discovery ship today and are usabl
13
13
14
14
`apm-policy.yml` is a single YAML file that defines what AI agent dependencies, MCP servers, and compilation targets are allowed across an organization. It is the governance pillar of APM — the file your security team owns and your repos inherit.
15
15
16
-
This page is the mental model. For the full schema, see the [Policy Reference](../policy-reference/). For wiring it into CI, see the [CI Policy Enforcement guide](../../guides/ci-policy-setup/).
16
+
This page is the mental model. For the full schema, see the [Policy Reference](../policy-reference/). For wiring it into CI, see the [Enforce in CI guide](../enforce-in-ci/).
17
17
18
18
---
19
19
@@ -51,7 +51,7 @@ Alternative sources, useful for testing or non-GitHub setups:
See [Alternative policy sources](../../guides/ci-policy-setup/#alternative-policy-sources) for details.
54
+
See [Enforce in CI](../enforce-in-ci/) for alternativepolicysources and CI wiring details.
55
55
56
56
---
57
57
@@ -88,13 +88,13 @@ Policy is evaluated at two points. Both use the same policy file and the same me
88
88
89
89
`apm install`resolves the dependency tree, then runs the policy gate against the resolved set, then writes any files. A blocking violation halts the install with a non-zero exit code; nothing is written to disk. This protects developers who run `apm install` locally — they cannot accidentally deploy a denied package even without CI.
90
90
91
-
> **Bypass note:** `apm install --no-policy` and the `APM_POLICY_DISABLE=1` environment variable skip this gate locally. They also skip 16 of the 22 checks when `apm audit --ci` runs in the same shell. See the [Governance Guide bypass contract](../governance-guide/#7-the-bypass--non-bypass-contract) for the full surface.
91
+
> **Bypass note:** `apm install --no-policy` and the `APM_POLICY_DISABLE=1` environment variable skip this gate locally. The env var also skips all 17 policy checks when `apm audit --ci` runs in the same shell; the 8 baseline lockfile checks still run. See the [Governance Guide bypass contract](../governance-guide/#7-the-bypass--non-bypass-contract) for the full surface.
92
92
93
93
### CI time (audit gate)
94
94
95
95
`apm audit --ci --policy org`runs the same checks (plus 8 baseline lockfile checks) and is intended as a required status check on pull requests. It produces SARIF output that GitHub Code Scanning renders inline on the PR diff.
96
96
97
-
For setup, see [CI Policy Enforcement](../../guides/ci-policy-setup/).
97
+
For setup, see [Enforce in CI](../enforce-in-ci/).
98
98
99
99
---
100
100
@@ -155,5 +155,5 @@ For lockfile-based forensic recipes, see the [Governance Guide §13: enforcement
155
155
## Next steps
156
156
157
157
-**Schema and every field** — [Policy Reference](../policy-reference/)
158
-
-**Wire it into CI with SARIF** — [CI Policy Enforcement](../../guides/ci-policy-setup/)
158
+
-**Wire it into CI with SARIF** — [Enforce in CI](../enforce-in-ci/)
For richer customization (matrix builds, monorepo splits, vendored policy paths) see the [CI Policy Enforcement guide](../../guides/ci-policy-setup/).
421
+
For richer customization (matrix builds, monorepo splits, vendored policy paths) see the [Enforce in CI guide](../enforce-in-ci/).
422
422
423
423
:::caution[Warn mode does not fail CI]
424
424
`apm audit --ci`in warn mode rewrites violations to `passed=True` (audit.py:589-598), so the audit command exits 0 even on policy violations. Visibility is in the SARIF upload + Code Scanning UI, not in branch-protection status. To gate merges on policy violations, you must run in `block` mode.
**Circuit-breaker rollout for large fleets.** For 100+ repos, do not flip block org-wide in one commit. Stage: enable `block` for 10% of repos for 1 week (via team-level extends), monitor SARIF alert volume and on-call pages, expand to 50% for 1 week, then 100%. If SARIF volume spikes or on-call escalations cluster, revert to `warn` at the org level (one commit) while you triage.
432
432
433
-
For step-by-step CI YAML and SARIF upload examples beyond the snippet above, see the [CI Policy Enforcement guide](../../guides/ci-policy-setup/).
433
+
For step-by-step CI YAML and SARIF upload examples beyond the snippet above, see the [Enforce in CI guide](../enforce-in-ci/).
434
434
435
435
---
436
436
@@ -606,8 +606,8 @@ policy:
606
606
:::
607
607
608
608
- [`apm-policy.yml`](../apm-policy/) -- the file's mental model.
609
-
- [CI Policy Enforcement](../../guides/ci-policy-setup/) -- step-by-step CI wiring with YAML.
610
-
- [Policy Reference](../policy-reference/) -- complete schema, the canonical 7+17 check enumeration, the 12-row merge rule table, exit codes.
609
+
- [Enforce in CI](../enforce-in-ci/) -- step-by-step CI wiring with YAML.
610
+
- [Policy Reference](../policy-reference/) -- complete schema, the canonical 8+17 check enumeration, the 12-row merge rule table, exit codes.
- **`apm compile`** scans compiled output (AGENTS.md, CLAUDE.md, `.github/copilot-instructions.md`, commands) before writing to disk. Critical findings cause `apm compile` to exit with code 1 after writing — defense-in-depth since source files were already scanned at install, but compilation assembles content from multiple sources. `.github/copilot-instructions.md` is assembled from global instructions in `.apm/instructions/`, including those installed under `apm_modules/`.
139
139
- **`apm pack`** scans files before bundling. This catches hidden characters before a package is published, preventing authors from accidentally distributing tainted content.
140
-
- **`apm unpack`** scans bundle contents before deployment. This is a pre-deployment gate matching `apm install` — critical findings block deployment unless `--force` is used. (Note: `apm unpack` is DEPRECATED and scheduled for removal in v0.14; prefer `apm install <bundle-path>` for new pipelines -- it applies the same scan plus lockfile integration. See [Pack and distribute](../../guides/pack-distribute/).)
140
+
- **`apm unpack`** scans bundle contents before deployment. This is a pre-deployment gate matching `apm install` — critical findings block deployment unless `--force` is used. (Note: `apm unpack` is DEPRECATED; prefer `apm install <bundle-path>` for new pipelines -- it applies the same scan plus lockfile integration. See [Pack and distribute](../../producer/pack-a-bundle/).)
0 commit comments