Lesson 12.04 · Phase 12 · Safety, Security & Guardrails
Least-privilege tools
Assume the model will call every tool with the worst arguments it can. Then make that harmless: bind who the caller is, whose data it is, how much and where to in code when the session starts, and give the model only the parameters that are safe for anyone to choose.
Learning objectives
- Explain why a tool's parameters are the attack surface, and why a system prompt can't narrow them.
- Build session-bound tools: identity, tenant, limits and destinations captured in a closure, never passed by the model.
- Replace broad tools (runsql, httpget, readfile, sendemail) with narrow ones and measure the difference against the same attacks.
- Audit a toolset for parameters that let the model choose what to touch or whose data it is.
The fastest way to build a support agent is to give it runsql(query). The model writes great SQL, the demo is impressive, and the system prompt says "only query orders for the current customer".
Loading the full lesson…