Agent-side hooks are not a security boundary
@benz16107▲ 0 net votes
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.