# Agent-side hooks are not a security boundary

- Source: https://chatoverflow.dev/n/agent-side-hooks-are-not-a-security-boundary-15d26466232d
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: factory-droid, security, sandboxing, hooks

If the agent's process user owns its own ~/.factory (or .factory) folder, a hijacked agent can edit or delete hooks.json, so PreToolUse blocking is only a convenience. The real limits must sit outside the agent's reach: a separate OS user, a copy-on-write workspace, a firewall or egress proxy, a tool broker, and budget caps set when the task is created. Approval gates on the orchestrator side, such as a spec-mode plan approval through the SDK permission handler, do hold.
