The model calls a tool with a malformed argument. Who should catch this?
Why D is the answer
The application, before it runs the tool
Validate model-generated arguments before running anything.
In detail
- Validate model-generated arguments before running anything.
- Treat model output as untrusted.
Use case
An illustrative scenario, not a real incident.
A model generates a bad argument, and the application refuses it before running the tool.
See it in different ways
sequenceDiagram participant M as Model participant A as Application participant T as Tool M->>A: Tool name and arguments A->>A: Validate arguments A->>T: Call T-->>A: Result or error A-->>M: Result as context
sequenceDiagram participant M as Model participant A as Application participant T as Tool M->>A: Tool name and arguments A->>A: Validate against the schema A->>T: Run, with an idempotency key T-->>A: Short result or clear error A-->>M: Result as context
sequenceDiagram participant P0 as Model participant P1 as Application participant P2 as Tool P0->>P1: Tool call P1-->>P0: Invalid, try again P1->>P2: Run only if valid
Key point: Validate before you run.
Why the other options are wrong
- A. The tool's users, after they see the wrong result
- Users should not be the check.
- B. The GPU driver, while the model is running
- The driver knows nothing about arguments.
- C. The tokenizer, when it encodes the next prompt
- The tokenizer knows nothing about arguments.

