Add hook.ForbiddenArgv: glob-pattern argv deny primitive #60
Labels
No labels
burndown-2026-06
sunday-sprint
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/cli-guard#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Add an argv-pattern deny primitive to
hook.PreToolUse. Today'shook.Protectedis basename-aware only — it can refuseghentirely, but can't distinguish read verbs (gh pr view) from write verbs (gh pr create). This gap blocks two downstream consumer rules in kap:ghwrites while leaving reads intact.gh/ forgejo invocation that mentions a forbidden substring (Kapwing-side example: stop agents filing Kapwing issues on GitHub when Kapwing tracks work in Shortcut).Both rules fit a single shell-glob match against the segment argv string. Globs only — no regex.
Schema
Extends
repocfg.Security:Required:
description,matches_glob_any. Optional:hint(synthesized "argv matched " deny used if absent).Engine
hook.ForbiddenArgvtype matching the YAML shape.forbidden ...ForbiddenArgvonPreToolUse(peer to the existingprotected ...Protected).evaluateSegmentruns the segment through everyForbiddenArgv.MatchesGlobAnybefore falling through to routes / integrity rules. First glob match wins; emitsDecision{Block: true, Message: <hint>}.path/filepath.Matchagainst the post-StripEnvPrefixsegment soenv FOO=bar gh issue createclassifies the same as baregh issue create.Acceptance
repocfg.Load; malformed entries (missingdescription, emptymatches_glob_any, invalid glob syntax) return parse errors with file:line.hook.PreToolUsedenies a segment matching any glob; passes through segments matching none.gh pr view,gh issue list,gh api repos/foo/bar,gh api graphql -f query=foo(no kapwing mention).gh issue create,gh pr create -t foo,gh repo delete,env GH_TOKEN=x gh release edit,gh api repos/kapwing/foo,forgejo issue create --repo kapwing/.....ward/ward.yamldeclares nothing underforbidden_argv).docs/FEATURES.mdentry updated; godoc covers the new type and the variadic.Out of scope
closes #N
Superseded by #61 - same scope, rewritten as a clean-room ticket scrubbed of in-session context and consumer-specific framing.