A hook is not a boundary: why agents need a sandbox
A training group got an agent past a hook that guarded a secrets file. A hook filters the calls it was written for, a sandbox limits what the agent can reach, and the trade between the two is a company decision.
Written by
-
Benedikt Stemmildt Founder & Co-CEO
Published: 23 October 2026 Updated: 1 min read
From our experience in training: a group talked an agent past the hook that guarded the secrets file.
A rule is a request, a hook is a filter
Our training material says that a rule in a skill is a polite request. The agent mostly follows it, and once the context fills up it may not. For what must never happen, we recommended permissions or a hook.
How the group got past the hook
One of our trainers put that to the test. Working as a mob, the group tried to get the agent to read the .env file and tell them what was in it. A hook blocked every tool call that named the file.
It took them two sessions. First the agent wrote a script that went through every file in the folder. Then the script ran over the hidden files too. The hook never saw the file name.
A hook checks the calls it was written for. A shell has endless other ways to read a file, and an agent asked to find one finds one.
Limit what the agent can reach
So the trainer’s recommendation moved to a sandbox: limit what the agent can reach at all, instead of filtering what it asks for. Keep secrets out of the file system, and keep development keys apart from production keys, with tight limits.
A sandbox has a price. Another of our trainers tried working sandboxed every day and gave up: browsers, other apps and files outside the repository were out of reach.
The company owns the trade-off
That trade is not the engineer’s to make alone. How much an agent may reach, and which risk is left over, is a decision the company takes and owns.
Write it down, name who owns it, and let the hooks catch the honest mistakes.
Further reading
Written by
-
Benedikt Stemmildt · Founder & Co-CEO
More on Agent security and risk
- Well-built agents close compliance gaps that manual processes leave Compliance teams block agents as too risky while manual processes run on memory and reconstructed logs. Properly architected agents make audit trails and enforcement automatic.
- In a regulated enterprise, the committee is the AI bottleneck Code generation is solved. In a regulated enterprise the constraint is the approval process, so the fastest path to adoption is one that needs no new tool approved.
- Every automation needs a scoped, reversible sandbox Teams design what their automations do and neglect where they run. A written blast radius, a narrow scope and throwaway environments decide whether you can leave an automation unattended.
Scaling needs named owners
Coding agents scale across teams when named people own the platform, the team practice, the guardrails, and the measurement. Rollout & scale is where that ownership is built and handed to internal owners, in your stack.
Training on this topic: Agentic Engineering Security for Development TeamsWant to check one team first? The self-check: twelve yes or no questions, three minutes, instant result, no account. Take the self-check