-
Notifications
You must be signed in to change notification settings - Fork 236
Add allowExecutables approval gate for dependency executables #1723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sergio-sisternes-epam
wants to merge
9
commits into
main
Choose a base branch
from
sergio-sisternes-epam/feat-allow-executables
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
76dbfb4
Add allowExecutables approval gate for dependency executables
5d17c61
Wire interactive approval prompt into install pipeline
dfc981a
Fix E2E bugs in executable approval gate
8328816
Merge branch 'main' into sergio-sisternes-epam/feat-allow-executables
sergio-sisternes-epam 6aef02d
Merge branch 'main' into sergio-sisternes-epam/feat-allow-executables
sergio-sisternes-epam 0ee17bf
Address Copilot review feedback on executable gate
c8a028f
Address Panel blockers: excise MCP from approval UI, add denial-path …
6b5812e
Add CLI reference docs for apm approve/deny
ce88bbd
Fix services.py LOC budget: inline _log_bin_status wrapper
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| --- | ||
| title: apm approve / apm deny | ||
| description: Manage the executable approval gate for dependency packages. | ||
| sidebar: | ||
| order: 25 | ||
| --- | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash | ||
| apm approve [PACKAGE_REF...] [OPTIONS] | ||
| apm deny [PACKAGE_REF...] [OPTIONS] | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| 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. | ||
|
|
||
| ### How the gate works | ||
|
|
||
| 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. | ||
|
|
||
| ### What is gated | ||
|
|
||
| | Type | Gated | Notes | | ||
| |------|-------|-------| | ||
| | Hooks (`.apm/hooks/`, `hooks/`) | Yes | Auto-fire in IDE on lifecycle events | | ||
| | Bin executables (`bin/`) | Yes | Deployed to agent PATH via symlinks | | ||
| | MCP servers | No | Enforcement deferred to a future release | | ||
| | Text primitives (skills, agents, instructions) | No | No code execution risk | | ||
|
|
||
| ## Options | ||
|
|
||
| ### `apm approve` | ||
|
|
||
| | Flag | Description | | ||
| |------|-------------| | ||
| | `PACKAGE_REF` | One or more packages to approve (e.g. `ci-hooks@acme`). | | ||
| | `--pending` | List all packages with unapproved executables. | | ||
| | `--all` | Approve all currently blocked packages. | | ||
|
|
||
| ### `apm deny` | ||
|
|
||
| | Flag | Description | | ||
| |------|-------------| | ||
| | `PACKAGE_REF` | One or more packages to deny (removes from allowlist). | | ||
|
|
||
| ## Manifest format | ||
|
|
||
| Approvals are stored in `apm.yml` under `allowExecutables`, keyed by | ||
| `name#version` with per-type boolean flags: | ||
|
|
||
| ```yaml | ||
| 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. | ||
|
|
||
| ## Examples | ||
|
|
||
| Approve a specific package: | ||
|
|
||
| ```bash | ||
| apm approve ci-hooks@acme | ||
| ``` | ||
|
|
||
| Show all blocked packages: | ||
|
|
||
| ```bash | ||
| apm approve --pending | ||
| ``` | ||
|
|
||
| Approve everything (migration helper): | ||
|
|
||
| ```bash | ||
| apm approve --all | ||
| ``` | ||
|
|
||
| Revoke approval: | ||
|
|
||
| ```bash | ||
| apm deny ci-hooks@acme | ||
| ``` | ||
|
|
||
| ## Non-interactive / CI usage | ||
|
|
||
| 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: | ||
|
|
||
| ```bash | ||
| # One-time setup: approve all current dependencies | ||
| apm approve --all | ||
| git add apm.yml | ||
| git commit -m "Approve executable dependencies" | ||
| ``` | ||
|
|
||
| ## See also | ||
|
|
||
| - [`apm install`](../install/) -- the install command that enforces the gate | ||
| - [`apm audit`](../audit/) -- audit installed packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.