coily lockdown does not enforce its routes when a session runs from the coilysiren repo-parent directory #7
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?
Originally filed by @coilysiren on 2026-05-21T05:00:08Z - https://github.com/coilysiren/agent-guard/issues/25
Problem - coily's lockdown routes (including the
mcporterdeny) are not enforced when a Claude Code session runs from the coilysiren repo-parent directory~/projects/coilysiren.Mechanism - The PreToolUse hook calls
detectGuard(cwd)(cmd/agent-guard/hook.go), which walks up from cwd looking for a.coily/coily.yamlor.agent-guard/agent-guard.yamlmarker.~/projects/coilysirenhas no marker, nor does any parent (~/projects,~). SodetectGuardreaches itsparent == dirfallthrough and returns"agent-guard".routeHintthen consultsagentGuardRoutes, the smaller table.mcporterlives only incoilyRoutes. Result: baremcporterruns un-denied from the repo-parent cwd. Verified twice this session - once at/luca-inspectstart, once right after upgrading agent-guard to v0.1.0. Inside an actual coily repo (e.g.~/projects/coilysiren/luca, which has.coily/coily.yaml) the guard correctly resolves tocoilyandmcporteris denied.Why it matters - Sessions are deliberately launched from
~/projects/coilysirento widen the harness auto-allow scope for cross-repo work (the "elevated cwd" / Workspace Shape pattern). That is the intended workflow, so the repo-parent is a first-class working directory. Today every coily-only lockdown route silently no-ops there.Candidate fixes (pick one, design call):
mcportertoagentGuardRoutesas well. Cleanest formcporterspecifically - it is a host-level tool that should be denied regardless of which repo the cwd sits in. Does not fix coily-only routes that are genuinely repo-scoped.detectGuardresolve the coilysiren repo-parent tocoily- e.g. if every immediate child dir is a coily repo, or via an explicit marker dropped at~/projects/coilysiren. Fixes the whole class, but needs a non-repo marker convention..coily/coily.yaml(or a lighter marker file) at~/projects/coilysirenso the existing walk-up finds it. Smallest change, but puts a coily marker in a non-repo directory.Found via
/luca-inspecton 2026-05-20.