r/AI_Agents • u/it_beaver • Oct 29 '26
Discussion Code map extension for HOL Guard
I maintain where-are-we (github.com/ngavrish/where-are-we), a CLI that builds a map of a repository (where things are, what calls what, which tests cover what) so a coding agent can ask the map instead of grepping its way around.
Almost everything an agent does with it is reading. But a few flags change things outside the map:
- --agent-file rewrites a section of CLAUDE.md / AGENTS.md
- --install-hook claude edits ~/.claude/settings.json, so the tool runs at every session start
- --specs / --spec-cmd fetch from a ticket tracker, and --spec-cmd runs a command once per ticket
Showcase
When an agent fires one of these mid-task, you find out later, when your agent instructions or hooks look different and you don't know why. My choices were to approve every call by hand (hundreds of harmless reads) or approve none of them.
So I wrote an extension for HOL Guard (github.com/hashgraph-online/hol-guard), an open-source local firewall that sits between the agent and the shell. It got merged last week. What it does:
- read-only calls (--ask, --callers, rebuilding the map) pass without a prompt
- repo writes and tracker calls pause for your OK
- hook installation is marked high risk
- unknown flags also pause, so a newer version of the tool can't slip past it
What it does NOT catch:
- tracker access configured through env vars (SPEC_ROOTS, SPEC_FETCH_CMD, RUNS_API_READ) instead of flags
- anything that doesn't go through the agent's shell, like a git hook it installed earlier
- it's off by default; you have to enable it in Guard
If you're building CLI tools that agents call, I'm curious how you handle this. Do you split read and write flags yourself, or leave it to the agent harness?
Disclosure: I wrote both where-are-we and this extension. I'm not affiliated with HOL.
1
u/AutoModerator Oct 29 '26
Thank you for your submission, for any questions regarding AI, please check out our wiki at https://www.reddit.com/r/ai_agents/wiki (this is currently in test and we are actively adding to the wiki)
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.