The Question You'll Be Asked
"Explain how tool use works in LLMs and describe the agent loop."
The moment you move from "I've used ChatGPT" to "I build AI systems," this is the question that draws the line. Deliver it in 60–90 seconds without reciting.
5 Beats Interviewers Listen For
Miss one and they probe.
- Who executes — the LLM requests, your code runs it, never the reverse
- The loop cycle — observe → reason → act (tool call) → execute → inject result → observe again
- What makes a good tool definition — name, description (the field that matters most), typed schema
- Failure modes + one fix each — infinite loop, hallucinated tool call, tool output poisoning
- When NOT to loop — a single prompt with sufficient context beats a loop every time
The Model Answer
"Tool use is the mechanism where an LLM produces a structured call — a tool name and arguments — and the host application decides whether to execute it. The model never runs code directly. An agent loop wraps this in a cycle: observe the context, reason, emit a tool call, inject the result, and reason again, until a stop condition — usually the model returning plain text instead of a tool call. A good tool definition needs three things: a precise name, a description that tells the model when to use it — not just what it does — and a typed parameter schema. The main failure modes are infinite loops from missing stop conditions, hallucinated tool names, and tool output poisoning when untrusted content is injected directly into context. The key judgment call: if a single prompt with the right context can answer the question, don't build a loop — loops add latency, cost, and failure surfaces."
Say This, Not That
Say
- "The model requests, my code executes"
- "The description is the most important field"
- "Validate the tool name against an allowlist"
- "Loops add latency — use one only when needed"
Avoid
- "The LLM calls the function" (it never does — it only requests)
- "Just give it lots of tools and let it figure it out"
- Skipping tool output poisoning — the most probed security follow-up
- Claiming an agent loop is always better than a single prompt
🔒
Introduction is locked
Session 5's introduction content unlocks by email. Subscribe and we'll review and grant access as more of the course opens up.
No spam. Unsubscribe anytime. Replies go to a real person.
🔒
Deep Dive is locked
Session 5's deep dive content unlocks by email. Subscribe and we'll review and grant access as more of the course opens up.
No spam. Unsubscribe anytime. Replies go to a real person.
🔒
Quiz is locked
Session 5's quiz content unlocks by email. Subscribe and we'll review and grant access as more of the course opens up.
No spam. Unsubscribe anytime. Replies go to a real person.
🔒
Assignment is locked
Session 5's assignment content unlocks by email. Subscribe and we'll review and grant access as more of the course opens up.
No spam. Unsubscribe anytime. Replies go to a real person.