A payment must never exceed the policy limit, whatever the model concludes. Where do you enforce it?
Why A is the answer
In a hook or tool check that runs in code
Prompts shape behavior but cannot guarantee it. Code-level enforcement holds even if the model is wrong or manipulated.
In detail
- A limit that must always hold is a business rule, so it belongs in code.
- A hook or tool check runs on every call and does not depend on what the model concludes.
- Prompts can guide behavior, but a model can be wrong or be manipulated.
- Return a clear reason when the check refuses, so the agent can escalate instead of retrying.
Use case
An illustrative scenario, not a real incident.
A procurement agent can pay invoices up to a set limit. A convincing message leads the model to attempt a larger payment. A check in the payment tool rejects it whatever the model concluded.
See it in different ways
flowchart LR
A["Claude requests a tool"] --> B{"PreToolUse hook"}
B -->|"Deny"| C["Blocked, reason returned"]
B -->|"Allow"| D["Tool runs"]sequenceDiagram
participant M as Claude
participant H as PreToolUse hook
participant T as Tool
M->>H: Requested tool call
alt Allowed by policy
H->>T: Call continues
T-->>M: Result
else Blocked
H-->>M: Deny, with a reason
endsequenceDiagram participant P0 as Agent participant P1 as Limit check participant P2 as Payment system P0->>P1: Pay this amount P1->>P2: Within the limit, so pay P1-->>P0: Over the limit, so refused
Key point: Put hard limits where the model cannot talk its way past them.
Why the other options are wrong
- B. In a firm instruction repeated at the top and bottom of the system prompt
- Repeating an instruction makes it more likely to be followed, but it never guarantees it.
- C. In a few examples showing the model refusing large payment requests
- Examples guide the model. They do not stop a large payment from being attempted.
- D. In a lower temperature, so that the model behaves more predictably
- A lower temperature changes variety in the output. It does not enforce a limit.

