feat(shim): add inline --no-refuse bypass flag#29
Open
gok03 wants to merge 1 commit into
Open
Conversation
Append `--no-refuse` to any wrapped install to skip the gate for that one
command, e.g. `pip install pyyaml==5.3 --no-refuse`. Friendlier than
exporting REFUSE_NO_GATE for a one-off.
The flag is ours, not the underlying manager's, so the shim strips every
occurrence from argv before exec'ing the real binary — no package manager
understands --no-refuse and leaving it in would make the real command
error.
Bypass is shim-only (interactive PATH use). The agent PreToolUse hook
path doesn't honor it, so an autonomous agent can't append --no-refuse to
defeat its own gate.
Verified end-to-end:
npm install lodash@4.17.10 → blocked (exit 2)
npm install lodash@4.17.10 --no-refuse → real npm runs with
"install lodash@4.17.10"
(flag stripped), exit 0
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Append `--no-refuse` to any wrapped install to skip the gate for that one command:
```sh
pip install pyyaml==5.3 --no-refuse # runs the real pip, ungated
npm install lodash@4.17.10 --no-refuse
```
Friendlier than exporting `REFUSE_NO_GATE=1` for a one-off. The shim strips every occurrence of `--no-refuse` from argv before exec'ing the real binary — no package manager understands the flag, so leaving it in would make the real command error.
Security note
Bypass is shim-only (interactive PATH use). The agent PreToolUse hook path (`refuse gate`) doesn't honor `--no-refuse`, so an autonomous agent can't append it to defeat its own gate. Documented in the README.
Verified end-to-end
Test plan