PreToolUse hook
A callback the agent host invokes after the model has requested a tool call but before the call executes, handing over the tool name and arguments and accepting a decision back: allow, ask a human, or deny. It is the only place a control can stop an action rather than report it afterwards. It is also in-process, so it sees calls that never touch the network — a local rm, a file read — which a proxy or network gateway can never observe.
See also action layer · detection vs prevention · agent host
Related terms
-
Action layer
Agents & architecture
The enforcement surface at the tool call, as opposed to the prompt layer, which tries to classify text before the model sees it.
-
Detection vs prevention
Testing & measurement
Detection notices something and produces a record; prevention stops it from happening. They are routinely conflated in agent-security claims, and the gap…
-
Agent host
Agents & architecture
The program that runs the agent loop — the CLI, IDE extension or desktop app that assembles the context, sends it to the model, receives the tool calls…
Agents & architecture
Where the attacks above actually land. The vocabulary here is worth precision, because the difference between "the model decided" and "the tool ran" is the difference between a risk and an incident.