Loading...
async function runTool(call) {
return tools[call.name](call.args);
}async function runTool(call) {
if (RISKY_TOOLS.has(call.name)) {
const ok = await requestApproval({ tool: call.name, args: call.args });
if (!ok) return { error: 'Rejected by the user' };
}
return tools[call.name](call.args);
}Approval is enforced in code and shows the exact tool and arguments, so the model cannot skip it.
Actions that are hard to undo or affect others: sending messages, payments, deleting data, deploying and changing permissions.
Auto-approve safe, read-only actions and ask only for risky ones, so each request deserves attention.
Return the rejection to the model as a tool result, so it can try another approach or stop.