Files
Holocron/plugins/kyberforge/docs/research/docs/microsoft-apm/approvals-and-executables.md
T
Defame1297andClaude Opus 5.5 5ca2056046 docs(research): refresh apm reference set to 0.39.3 (#265)
Add lockfile-and-compatibility, approvals-and-executables and
migration-0-28-to-0-39 topics; update installation, cli-reference, the
prompt, hooks and instructions topics for 0.39.x behaviour; label the
remaining 0.28.0 observations by version. Sources: the v0.39.3 source,
CHANGELOG and docs; Context7 was unavailable.

Refs #265

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-01 21:46:06 +00:00

5.4 KiB

topic, source_keys
topic source_keys
approvals-and-executables
apm-v0-39-3-source
apm-v0-39-3-changelog
apm-v0-39-3-docs

How apm 0.39.3 decides whether a package's executables may be deployed. Executables means hooks, MCP servers, bin, LSP servers, canvas extensions and native plugins. This also covers what apm approve writes and which apm audit --ci checks enforce it. Read from the v0.39.3 source, CHANGELOG and docs, and not run. Claims are marked source or doc.

The gate and its opt-in

  • Source: the executables gate is on when the project apm.yml has an executables: block (even {}) or the deprecated allowExecutables: block. Doc: a non-empty executables: block in org policy also turns it on.
  • Doc: without an opt-in, executables deploy unconditionally. The first project approval prompts that it turns the gate on. A --user approval never turns it on.
  • Source: allowExecutables: is still read as an alias of executables.allow, warned once per run, and migrated on the next approve or deny write.

Store shape

apm approve writes the project apm.yml under executables: {allow, deny} by default. --user writes $APM_HOME/config.json instead.

executables:
  allow:
    acme/agent-kit:
      hooks: { .apm/hooks/lint-on-save.json: sha256:<64 hex> }
      mcp: { kit-docs: sha256:<64 hex> }
    acme/tools: { bin: true }
  deny:
    evil/pkg: { hooks: true, mcp: true, bin: true, canvas: true, lsp: true }
  • Source: each package key is a version-blind identity, such as owner/repo, ./pkgs/x or local:pkgs/leaf.
  • Source: values by type:
    • hooks and mcp are maps of item: sha256:<64 hex>. The item is the package-relative hook file path, or the MCP server name.
    • bin, lsp and canvas are true.
    • A native plugin gets a single plugin: sha256:<hex>.
  • Source: deny entries stay booleans.
  • Source: malformed pins are rejected. A pinned item set to true, or a short digest, fails with expected 'sha256:<64 hex>'.

Grants are version-blind

  • Source: an ordinary grant key has its #version suffix stripped before matching. So owner/repo#1.2.0 matches any installed version of owner/repo, and apm approve folds such keys into the bare identity. This was already true in 0.28.0.
  • Source: the one exception is content-bound local-bundle keys of the form name#version@sha256:<digest>, which match only exactly.

Type-level versus content-pinned grants

  • Source/doc: type-level hooks: true and mcp: true still deploy any content. Each install warns once: N executable approval(s) not pinned to content: <pkg> (<type>) ... Upstream changes deploy without review.

  • Source/doc: mcp: true never admits a transitive MCP server.

  • Source/doc: re-running apm approve <pkg> converts a type-level grant to pins.

  • Source: a pinned item whose bytes change is parked as definition-changed and not deployed. A project pin decides alone; a user pin applies only when the project has none for that item.

  • Source (0.38.0, #4688): a hook pin covers everything the hook deploys:

    • the hook JSON;
    • every script it references;
    • every file the hook-bundle copier deploys from those script roots, such as helpers and nested package.json;
    • the Node module type.

    It does not cover code the hook downloads at run time. Pins written before 0.38 show as changed once, so re-run apm approve <pkg>.

  • Source: pinned approvals need apm 0.37 or later on every machine. The first pinned approval prints Teammates need APM 0.37 or later to read pinned approvals., and older clients reject the item form and fail closed.

  • Doc (0.39.3): re-run apm approve <package> after reinstalling a package.

Transitive MCP servers

  • Source: --trust-transitive-mcp still exists in 0.39.3 as a per-run install flag that is never saved. Doc: it never overrides a deny or a mismatched pin.
  • Doc (0.37.0, #3918): the durable replacement is apm approve <pkg>, with apm.yml committed.
  • Doc (0.39.0): a server trusted in 0.38 only via the flag is parked and removed on the first plain 0.39 install. Approve it to keep it.

Audit checks that enforce approvals (doc)

Check Fails when
config-consistency The lock admits an MCP server that apm.yml does not approve: admitted in apm.lock.yaml but not approved in apm.yml (<reason>); run 'apm approve <pkg>' and re-run 'apm install'. Admission is re-evaluated from apm.yml and org policy only, never from the lock or the user store.
hook-approval-pins A recorded deployed hook file no longer matches its pin; or an unrecorded file sits at a withheld package's hook path; or a merged-config entry matches such a package's hook with no ownership record.
exec-status-current A recorded exec_status differs from the current gate decision. Claude settings.json hooks are included. Not evaluated under --no-policy.
local-bundle-hooks A local-bundle hook entry was edited or is unrecorded. Needs the .claude/apm-hooks.json record.

apm install --frozen fails on the same pin mismatches.

apm approve and apm deny

  • Doc: flags are --pending, --all, --recommended, --list, --user/-g.
  • Doc: it exits 1 when:
    • a requested package is not installed or is refused;
    • the first-approval prompt is declined;
    • a blocking org policy applies;
    • installed files differ from apm.lock.yaml.
  • Source: apm deny [PACKAGES] --user/-g writes deny entries.