Skip to content

apm approve / apm deny

Terminal window
apm approve [PACKAGE_REF...] [OPTIONS]
apm deny [PACKAGE_REF...] [OPTIONS]

APM blocks executable primitives (hooks, bin/ executables) from dependency packages by default. The allowExecutables block in apm.yml records which packages have been explicitly approved to deploy executables.

apm approve adds a package to the allowlist. apm deny removes it.

When apm install encounters a dependency that ships hooks or bin/ executables:

  1. If allowExecutables is absent from apm.yml, everything is approved (backward-compatible, no gate).
  2. If allowExecutables is present (even empty {}), only listed packages may deploy executables.
  3. In interactive mode, apm install prompts for each unapproved package. In CI (non-interactive), unapproved executables cause a hard error.

Local project content (the root .apm/ directory) is always trusted.

TypeGatedNotes
Hooks (.apm/hooks/, hooks/)YesAuto-fire in IDE on lifecycle events
Bin executables (bin/)YesDeployed to agent PATH via symlinks
MCP serversNoEnforcement deferred to a future release
Text primitives (skills, agents, instructions)NoNo code execution risk
FlagDescription
PACKAGE_REFOne or more packages to approve (e.g. ci-hooks@acme).
--pendingList all packages with unapproved executables.
--allApprove all currently blocked packages.
FlagDescription
PACKAGE_REFOne or more packages to deny (removes from allowlist).

Approvals are stored in apm.yml under allowExecutables, keyed by name#version with per-type boolean flags:

allowExecutables:
"ci-hooks@acme#1.2.0":
hooks: true
bin: true
"dev-tools@org#0.5.0":
hooks: true

Version pinning means approval must be renewed when a package updates.

Approve a specific package:

Terminal window
apm approve ci-hooks@acme

Show all blocked packages:

Terminal window
apm approve --pending

Approve everything (migration helper):

Terminal window
apm approve --all

Revoke approval:

Terminal window
apm deny ci-hooks@acme

In CI environments (CI=true, APM_NON_INTERACTIVE=1, or when stdin is not a TTY), apm install fails with exit code 1 if any dependency has unapproved executables. Pre-approve packages in apm.yml before CI runs:

Terminal window
# One-time setup: approve all current dependencies
apm approve --all
git add apm.yml
git commit -m "Approve executable dependencies"