Define Tool-Use Boundaries for an AI Agent
You give an AI agent tools — search, draft, send, refund — and say "use them as needed," so it drafts a reply and reports the refund as done without asking. Here's how to write tool-use boundaries: which tool for what, read vs write, and what needs a human before it fires.
Build an Agent System Prompt With Tool BoundariesWhen "use tools as needed" becomes "do anything"
You wire up a support agent with the tools it needs — knowledge-base search, a CRM lookup, an email drafter, an email sender, a refund tool, an account-update tool — and tell it to "use the tools to resolve customer requests." On the first real ticket it looks up the account, writes a reply, and reports back: "I've processed the refund and emailed the customer." Except a refund is money leaving the business, the email went out with no one reading it first, and when the CRM lookup failed it just tried again four more times. Nothing in your instruction said which of those tools it was allowed to actually fire, so it treated all six the same — as things to use whenever using them seemed helpful.
That's the gap this guide closes. Handing an agent a tool is not the same as granting it permission, and "use tools as needed" answers the wrong question — it says the tools are available, not which one may be used for which job, which actions need a human first, and what to do when a call fails. Tool-use boundaries are the missing half: for each tool, its allowed purpose, whether it only reads or can act, what it may never do, and what has to be approved before it runs. NewPrompt helps you write those boundaries into the agent's prompt; it doesn't run the agent, call a tool, or enforce a single permission. The prompt is an instruction, not a fence — the real fence is the tool permissions and API scopes you set in your own agent framework, and the boundaries you write here only hold if the system behind them is configured to hold too.
Why availability reads as permission
The agent isn't reckless — it's optimizing for the goal you gave it with the tools you put in reach, and nothing told it that reach and permission are different things. A model rewarded for being helpful will use a capability that moves the task forward unless a rule stops it, and "as needed" is not a rule. Five ways an unbounded tool list goes wrong:
- It reads availability as permission. A tool in the list looks like a tool it's meant to use; without a stated purpose and limit, "can call" becomes "should call."
- It blurs read and write. Looking up an account and changing one are different risk classes, but a single "use the CRM" instruction lets the agent slide from reading a field to editing it.
- It blurs draft and send. "Handle the email" reads as permission to send; the safe default — write the draft and stop — is only safe if you say the send is a separate, gated step.
- It takes irreversible actions to be helpful. A refund, a deletion, a plan change — the model will do the thing that resolves the ticket, and money or data is gone before anyone approved it.
- It loops on failure and invents results. When a tool errors or returns nothing, an agent with no failure rule retries in a loop, or worse, reports a result it never got — "refund processed" when the call never succeeded.
Step 1: List every tool and split reading from acting
Before writing a single rule, lay out every tool the agent can reach and sort it by what it does to the world, because that sort decides how tightly each one needs fencing. The cleanest split is read versus act: a tool that only retrieves information (search a knowledge base, look up an order) is low-risk and can usually run freely; a tool that changes something (send an email, update a record, issue a refund) carries a side effect and needs a gate. Between those sit the useful middle cases — a drafter that produces a message but doesn't send it, an action that's reversible internally versus one that isn't — and naming which bucket each tool falls in is the whole foundation the boundaries attach to.
The categories worth separating, from safest to most dangerous: read-only (retrieves, changes nothing), draft-only (produces something for a human to send or use, but doesn't act), reversible internal action (changes state you can easily undo), external-visible action (a customer or third party sees it), and irreversible or high-stakes action (money, deletion, account, legal, security). The same tool can even span two — a CRM tool that reads and writes is really two permissions wearing one name, and the safe move is to treat the read and the write separately rather than let one grant cover both.
Step 2: Give each tool a boundary row, not just a name
Now turn the sorted list into a per-tool boundary — the difference between naming a tool and defining how it may be used. For each one, state: its allowed purpose (the specific job it exists for here), its action type (read, draft, or act), what it may never do, whether approval is required before it runs, a cap on attempts, and what to do when it fails. "crm_lookup: read account status and order history; may not edit any field; no approval needed to read; if the customer's identity is uncertain, stop and ask" is a boundary; "crm_lookup" is just an entry in a list.
Because that's a repeating shape — the same columns for every tool — it reads best as a table the agent can follow row by row. The Markdown Output Builder builds a prompt that holds it in a fixed structure — Tool, Allowed Purpose, Action Type, Forbidden, Approval Required, Max Attempts, Failure Behavior — so each tool comes with its limits attached instead of floating free. And the boundaries belong in the agent's standing instructions, not in a one-off message: the System Prompt Generator bakes the tool policy into the system prompt the agent carries across the whole conversation, and the AI Agent System Prompt is a worked example of the discipline — a plan-act-observe loop that uses one tool at a time, acts only on real results, and stops before anything irreversible. Both give you a prompt you run in your own agent framework; neither makes the agent obey it.
Step 3: Put an approval gate before every action that can't be taken back
The rule that prevents the worst outcomes is simple to state and easy to forget: the agent does not send, delete, update, charge, publish, or approve anything without explicit human approval in the moment. Reading is free; acting on the outside world is gated. Write it so the agent's job on a high-stakes action is to prepare it and stop — draft the email and wait, check refund eligibility and hand the decision up, propose the account change and ask — rather than to complete it and report back. The approval isn't a formality; it's the point where a human sees the action before it becomes real.
Be explicit about which actions cross the line, because the model won't infer your risk tolerance. Irreversible (a deletion, a charge), external-facing (a message a customer receives), monetary (a refund, a purchase), and account- or data-changing (a plan switch, a permission edit) all require a gate; a low-stakes reversible internal action may not. And name the tempting shortcut so the agent doesn't take it: it may not treat the availability of a send or refund tool as standing approval to use it, and it may not batch an irreversible step in with the reversible ones to get the task done faster. The gate holds only if it's stated as non-negotiable — approval is required, and its absence means the action does not happen.
Step 4: Tell it what to do when a tool fails
A tool that errors, times out, or returns nothing is where a quiet agent turns dangerous, so every tool needs a failure rule as much as a purpose. Two behaviors to forbid outright: looping — retrying the same failing call indefinitely — and inventing — reporting a result the tool never returned. Set a hard cap ("if the lookup fails twice, stop and report the failure; do not retry further") and a hard honesty rule ("never state that an action succeeded unless you received a success result; if you don't know, say you don't know"). The most damaging line an agent can write is "refund processed" when the refund tool never confirmed it — a failure rule is what stops that sentence from existing.
Failure handling is also where boundaries get tested rather than just written, and it's worth checking before you trust the agent with anything real. The Agent Tool-Use Evaluation Prompt is built for exactly this: it checks whether an agent selects the right tool, passes valid arguments, calls at the right time, and — the part this step is about — recovers gracefully when a tool errors or returns empty instead of breaking or hallucinating a result, treating a made-up tool result as a critical failure. Run your boundary cases through a check like that, because a boundary you wrote and never tested is a boundary you're only hoping holds.
Step 5: Test the boundaries, and back them with real permissions
Before this agent touches production, run it through the cases that exercise each boundary and read what it does against what you wrote. A short set covers most of it: a read-only request (does it retrieve without trying to act?), a draft-only request (does it produce the draft and stop, or send?), an action that needs approval (does it wait, or complete it?), a destructive or high-stakes request (does it refuse and escalate?), and a tool failure (does it stop and report, or loop and invent?). Where the agent crosses a line, the fix is usually a sharper boundary — a clearer forbidden clause, an approval gate you left implicit — and the test is what surfaces it while the stakes are still a test.
The boundary that matters most, though, isn't in the prompt at all. A tool-use boundary you write is an instruction, and an instruction is a request the model usually follows, not a wall it cannot pass — a bounded agent can still call a tool it was told not to, especially under an unusual request or a prompt-injection attempt in the data it reads. So the prompt-level boundaries are the first layer, not the only one: the read-only tool has to be read-only in its actual API scope, the send and refund tools have to require a real approval step in your own stack, and runtime guardrails, permission configuration, and monitoring are what make the boundaries true. NewPrompt helps you write the policy; configuring the permissions, the approval gates, and the monitoring — and owning the decision to deploy — is your stack and your team's, because a prompt cannot enforce what only the system can.
Common mistakes
The habits that turn a helpful agent into a risky one:
- Saying "use tools as needed." That grants availability, not permission; name the purpose, the limit, and the gate for each tool instead.
- Letting one grant cover read and write. A tool that both reads and changes data is two permissions; fence the write separately from the read.
- Treating draft and send as one step. "Handle the email" reads as send; make the draft the default and the send a separate, approved action.
- Leaving irreversible actions ungated. A refund, a deletion, a plan change must stop for approval — availability of the tool is not standing permission to fire it.
- Writing no failure rule. Without a cap and an honesty rule, a failing tool gets retried in a loop or its result gets invented — "done" when nothing happened.
- Trusting the prompt to enforce the boundary. A prompt is an instruction; the read-only scope, the approval gate, and the monitoring have to be real in your own stack.
A worked example: a support agent with six tools
Take the "use tools as needed" agent that overreaches, and give each of its tools a boundary — read from write, draft from send, and a gate on the money.
A "use tools as needed" agent sends and refunds unasked; a per-tool boundary table separates read from write and gates every irreversible action — but the real fence is the runtime permissions, not the promptTHE WEAK INSTRUCTION, AND WHAT THE AGENT DOES:
"Use the tools to resolve customer requests efficiently."
-> looks up the account, drafts a reply, SENDS it unreviewed,
reports "refund processed" (the tool never confirmed), updates the
CRM status, and retries the failed lookup four more times. No
approval, anywhere.
THE TOOL-USE BOUNDARY TABLE (put this in the agent's system prompt):
tool allowed use forbidden approval on failure
kb_search find + cite a policy invent a policy no after 2 misses,
that isn't there report "no policy"
crm_lookup read status / history edit any field no (read) stop at 2; if
identity unclear, ask
email_draft draft a customer reply send it no output the draft only
email_send send ONLY the approved send anything YES, if no approval,
draft, after approval unreviewed always do not use
refund_tool check eligibility (read) approve/process YES, escalate to a human
a refund always
account_update nothing by default change plan / explicit refuse; ask the
delete / billing owner account owner
WHAT A BOUNDED RUN LOOKS LIKE:
crm_lookup -> read_only -> completed
email_draft -> draft_only -> draft created, NOT sent
refund_tool -> blocked -> approval required; escalated, not processed
account_update -> refused -> owner approval needed
failure note -> lookup failed once; will stop at 2, no invented result
the agent's report: "Draft ready for your review; refund needs your
approval before I can proceed. I did not send or refund anything."
STILL YOUR JOB (the prompt is not the fence):
email_send and refund_tool must require a REAL approval step in your
stack; crm_lookup must be read-scoped in its actual API. The prompt
writes the policy; the system has to enforce it, and you own the deploy.
Where this fits in NewPrompt
Writing tool-use boundaries is one piece of defining an agent, and the pieces are small. The System Prompt Generator bakes the tool policy into the standing system prompt the agent carries; the Markdown Output Builder holds the boundary table in a fixed shape; the AI Agent System Prompt shows the plan-act-observe, stop-before-irreversible discipline the boundaries plug into; and the Agent Tool-Use Evaluation Prompt is how you test tool selection, timing, and failure handling before you rely on any of it. They structure the agent's instructions; none of them runs the agent, and what the agent can actually do stays a matter for your own stack.
It helps to see where this sits among its neighbors, because they solve adjacent problems. Giving an agent clear stop conditions decides when it halts; setting escalation rules decides when it hands a whole situation to a human; writing a role prompt that doesn't overreach limits the authority the model claims in its reasoning. Tool-use boundaries sit alongside all three, aimed at the tools themselves — and you often want the whole set, because they reinforce each other: a stop condition and an approval gate catch different failures on the same tool.
The distinction underneath all of it is the one to hold onto: a prompt describes how you want the agent to behave, and the system decides what the agent can actually do. Tool-use boundaries written into a prompt lower the odds of an unasked-for refund or an unreviewed email, and that's worth doing — but the cheapest place to stop a destructive action is the permission that never granted it, not the sentence asking the model to be careful. The prompt draws the line; the system has to hold it, and the deploy is yours to sign off on once both do.