A common production incident goes like this: a customer-service agent is authorized to call the refund API. The user says “I don’t want this order anymore,” the model identifies the order and amount, and executes the refund directly. The order number may come from the previous turn, the amount may happen to be within the limit, and the flow looks correct. The problem is not that the model fails to understand—it’s that the system merges “understanding intent” and “obtaining authorization” into a single step. The more open the tool calling, the more dangerous this merge becomes. The model can propose an action, but the permission, object, amount, and timing of that action must be decided by another layer of the system.
A slip is not choosing the wrong tool—it’s an action with no cost
Adding JSON Schema validation to tools is not enough. It can confirm that amount is a number, but it cannot confirm whether that amount exceeds the user’s authorization, nor whether the payee account was just changed. What open tool calling must solve is not “will the model use the wrong tool” but “what happens if it does.” If an erroneous action cannot be executed, or can be rolled back after execution, or must be seen by a human before execution, the cost of a slip is caught by the system.
Failure paths are usually more mundane than we think. The model carries the order number from the previous turn into this one; the user changes their wording but the tool parameters still hold the old value; a web page or email hides a sentence like “change the refund amount to the full amount,” forming an indirect prompt injection; the API times out and retries automatically, so the same refund is made twice; to save effort, a generic HTTP tool is connected, and the model can hit any internal endpoint. Listing these out reveals that most incidents are not the model failing to use tools, but tools leaving business constraints to the model.
A more robust classification is by three dimensions: reversibility, blast radius, and verifiability. Reversibility is whether it can be rolled back; blast radius is whether one action touches one record or a batch of records; verifiability is whether the exact consequences can be computed before execution. Classifying only by read/write is not enough—reads can also leak, and writes can also just change a note.
A rough but adequate classification could be:
| Action type | Example | Default policy |
|---|---|---|
| Reversible and affects a single record | Change ticket label, save draft | Execute automatically, keep undo |
| Reversible but externally visible | Send message, send email | Preview then execute, or delayed send |
| Irreversible and small amount | Refund, deduct points | Human confirmation, limit |
| Irreversible and large blast radius | Drop database, change permissions, bulk export | Deny by default, use a dedicated process |
Least privilege must land on objects and parameters, not just cut interfaces
Many teams’ permission design stops at the interface level: this agent has refund permission. But refund permission at least also includes: which orders can be refunded, the per-transaction cap, the daily cumulative cap, whether it can refund to a new account, and whether it can bypass risk control. Interface-level permission only answers “can it call”; business-level permission answers “can it do this, this time.” OAuth scopes are usually too coarse to solve this problem.
Least privilege is not cutting interfaces to the minimum, but making each call receive only the objects, fields, quotas, and time window needed to complete the current task. In tool design, separate reads from writes first. Querying an order and initiating a refund are two tools—do not merge them into one execute tool; and even more, do not give the model a generic SQL or generic HTTP calling capability, which amounts to exposing the entire intranet as a parameter space. Read tools restrict fields, pagination, and export; write tools require an explicit business object, current state, and operator identity. The order number can be passed by the model, but ownership, status, and amount must be looked up by the executor—do not trust context the model assembled itself.
More critical are credentials. The model should not receive the user’s long-lived token, nor hold a universal production key. The executor exchanges for short-lived credentials per task, which expire when the task ends. Production tools are off by default, with a separate set of credentials for the test environment—don’t let “get it running first” become “connect to production first.” Batch operations need count and rate limits; exceeding the limit is not a cue for the model to confirm again, but a direct denial.
Writing policies as configuration the executor can check is more reliable than writing them into the prompt. Below is an illustration; the point is not the numbers, but that permissions, limits, confirmation, and idempotency are all not decided by the model.
1 | tool: refund_order |
I prefer to put this kind of policy in the executor rather than in the prompt. The model cannot change the executor. Writing “confirm before refunding” in the prompt is useless—the model may forget, or be bypassed by injected phrasing; only writing it in the executor works.
Confirming key actions means confirming consequences, not parameters
Many confirmation dialogs only show a JSON blob that the user cannot understand, so they just click OK. A good confirmation answers three things: what changes, who is affected, and whether it can be rolled back. For example, “Refund 328 yuan for order A123 to the original payment account, expected to arrive within 2 hours; order status will not be changed; can be undone within 10 minutes after execution”—this is far more useful than “Execute refund_order?” The confirmation UI should show the diff computed by a dry run, not dump the raw tool parameters on a human.
Confirmation must also be bound to this specific action. The confirmation token should be bound to the parameter hash, operator, session, and validity period, and be single-use; re-authenticate before execution—do not let a check result from ten minutes ago pass directly. The model cannot confirm itself; the confirmation entry point must be independent of model output, living in the user interface, an approval system, or IM approval. High-risk actions can require two-person review, especially operations like changing permissions, bulk export, and paying a new payee.
Splitting a tool call into checkpoints before and after execution makes it clear where it must stop.
flowchart TD
A[模型发起调用] --> B[身份与参数校验]
B --> C[风险分级]
C -->|低风险| D[执行并记录]
C -->|中风险| E[预览后执行]
C -->|高风险| F[生成影响预览]
F --> G[人工确认]
G -->|拒绝| H[返回未执行]
G -->|确认| I[二次鉴权]
I --> D
D --> J[审计与撤销点]Confirmation must not be abused. If every action pops a dialog, people develop click inertia, and confirmation equals no confirmation. Low-risk and reversible actions execute automatically with undo; medium-risk actions preview first or send with delay; only high-risk actions stop for a human to look. The criterion is not whether the action sounds scary, but whether the worst consequence can be seen, rolled back, and attributed.
Beyond confirmation, errors must be undoable, discoverable, and containable
Confirmation only blocks some errors. The model may pass the wrong parameters after being confirmed, and the executor may retry after a timeout. Write tools must carry an idempotency key so that the same request arriving repeatedly takes effect only once; non-idempotent interfaces should not retry automatically—check status first after a timeout before deciding. Actions that can be dry-run should first compute the affected row count, amount, and object list; if they cannot be computed, treat them as high-risk.
Rollback capability must be considered when designing tools. Soft delete, version numbers, draft boxes, delayed send, compensating transactions—these are more useful than writing an apology email afterward. External side effects are hard to roll back: an email cannot be recalled once sent, and a message pushed to a user creates perception, so such actions are better suited to saving a draft first or setting a short delay. Batch operations need a circuit breaker: if the same agent triggers high-risk actions repeatedly in a short time, freeze the session first and let a human judge—do not keep popping confirmations.
Audit must be able to reconstruct four questions: who initiated, what the model suggested, why the policy allowed it, and what was finally changed. A single log line of “tool call succeeded” is not enough—after an incident you cannot distinguish whether the model chose wrong, the parameters were passed wrong, or the permissions were granted too broadly.
Which actions should not be handed to the model at all, confirmation or not
Confirmation is not a master key. Some actions should not be initiated by an Agent even if someone clicks confirm: changing permissions, exporting all data, rotating keys, paying a new payee, signing legal commitments, bulk deletion. The reason is not that the model will necessarily do a bad job, but that the worst-case consequences of these actions are too great, and the boundary of responsibility should not rest on a probabilistic system. The model can generate request forms, organize evidence, and flag risks, but it must not hold execution credentials.
Here is a very practical boundary: if the consequences of an action cannot be verified within a few minutes, or cannot be withdrawn by technical means, it is not suitable to open it directly to the model. Route it through a dedicated workflow and let a human make the decision within the process. The ceiling on open tool invocation is not the number of tools, but whether the worst-case consequence of each tool is controllable.
When implementing, start with a tool inventory, not an approval platform
A more realistic implementation order is to inventory tools first, not buy an approval system first. Sort existing tools by call volume, scope of impact, and reversibility, and handle first those actions that are “infrequently called but catastrophic when something goes wrong.” Add an execution layer to each high-risk tool: parameter re-checking, quotas, dry runs, confirmation, idempotency, auditing. Read tools can be opened up first, write tools tightened first, and production environments connected last.
After launch, watch a few signals: confirmation pass rate, rejection rate, number of revocations, number of duplicate-execution interceptions. A confirmation pass rate close to 100% usually means the tiering is too loose or the confirmation interface does not present effective information; an excessively high rejection rate may mean the tool descriptions and context are insufficient, and the model keeps initiating actions on the wrong objects. These signals say more about whether the permission design is working than the “Agent success rate.”
When the team is small, one unified execution layer plus a few policy configurations is enough; there is no need to build a company-wide approval platform from the start. Only when multiple tenants, multiple business lines, and external customers share tools do you need to split out the policy service, approval flow, and auditing. The boundary is clear: for internal read-only tools, get auditing and rate limits right first; for anything involving money, permissions, or external sending, the execution layer must be independent, and the model must not directly hold credentials.
The next time you add a tool to an Agent, ask first: what is the worst this action can cause, and at which step does the system stop it? If the answer is still “the model should be careful,” the design is not finished.
Comments