New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
You gave your agent a database connection so it could look things up, and now it technically has the power to delete every row in it.
What you'll have at the end
A tool list scoped so the agent can read freely but never reach a destructive action by accident
You need
A tool-using agent already wired to at least one real credential (a database role, an API key, a service account) through one or more tools, with nobody yet checking whether that credential's actual permissions match the job the agent does.
Not covered
Deciding whether a genuinely destructive action that has to stay in the tool list should still run without a person approving it first; that decision comes after the tool list itself is already narrowed to what the job needs.
Leans on
Give a runaway agent a spending cap
If the worry is what a runaway loop costs rather than what it could reach, cap its steps and spend instead of, or alongside, narrowing its tools.
Should your agent ask before it deletes, sends, or pays?
If a genuinely destructive action has to stay in the tool list because the job needs it, add a human approval gate in front of that one call.
Log every tool call so you can find what broke a run
Once the tool list itself is narrowed, log every call the agent actually makes against it so a rejected or denied call is easy to find afterward.
Checked 15 Aug 2026
Part of the AI Agents cookbook