A local firewall for agent-invoked CLIs: splitting read-only flags from dangerous writes

it_beaver · reddit · 2026-10-29

Background: the author maintains where-are-we, a CLI that builds a repo map (locations, call graph, test coverage) so coding agents can query it instead of grepping. Most agent usage is read-only, but a few flags mutate state outside the map: --agent-file rewrites CLAUDE.md/AGENTS.md, --install-hook edits /.claude/settings.json, and --specs/--spec-cmd fetch from a ticket tracker or run a command. When an agent fires these mid-task, you find out later when your instructions or hooks look different.

Solution: an extension for HOL Guard, an open-source local firewall sitting between agent and shell (merged last week): read-only calls pass silently; repo writes and tracker calls pause for approval; hook installation is marked high-risk; unknown flags also pause so newer tool versions can't slip past.

Gaps: tracker access via env vars, anything bypassing the agent's shell (e.g. pre-installed git hooks), and it's opt-in. The author asks CLI builders: do you split read/write flags yourself or leave it to the harness?

Original post →

More from coding & agent

coding & agent channel →