docs(openspec): flag-level bash permissions proposal - #16
Open
preved911 wants to merge 3 commits into
Open
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
👀 AI Code ReviewSomething went wrong: <urlopen error [Errno -2] Name or service not known> Powered by GPT-4o via GitHub Models |
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
OpenSpec change proposal for
flag-level-permissions— adds granular, flag-aware command permission control. No implementation yet; this PR is the reviewed proposal (proposal → design → spec → tasks). Implementation follows via/opsx-apply.Why
permission.bashglobs match the whole command string, so flag-level intent can't be expressed reliably:"curl *": "ask"always catchescurl -X GET https://api.comeven if a narrower allow rule exists. Dangerous flags (find ... -delete,git push --force) deserve their own actions.Proposed config
{ "permission": { "bash": { "*": "ask", "git *": "allow" }, "bash_args": [ { "pattern": "curl -X GET *", "action": "allow" }, { "pattern": "curl *", "action": "ask" }, { "pattern": "find * -delete", "action": "ask" }, { "pattern": "git push --force *", "action": "deny" } ] } }Key design decisions
*matches zero+ whitespace tokens (find * -deletematchesfind /tmp -name "*.log" -delete, not plainfind /tmp)permission.bashglob matching when no args rule matchesallowoverrides a native opencodeaskviapermission.ask(status = "allow"), without this thecurl -X GET * → allowuse case wouldn't work end-to-endpermission.bash_argsis absentArtifacts
openspec/changes/flag-level-permissions/proposal.md— what & whyopenspec/changes/flag-level-permissions/design.md— 7 decisions + risksopenspec/changes/flag-level-permissions/specs/args-permission-matching/spec.md— 5 requirements, 24 scenariosopenspec/changes/flag-level-permissions/tasks.md— 6 sections, 30 tasksNext steps
/opsx-applyto implement (tasks 1–6)Ultraworked with Sisyphus