AI agents and models Required
Ask a person before the agent spends or deletes
Require a clear yes from the user before the agent pays, sends a message, deletes data or changes an account.
How to do it
Have these tools return a draft instead of acting. Show the user exactly what will happen, then act only on their confirmation, outside the model. The confirmation must come from the user's click, not from text the model writes.
Example
async function refundOrder({ orderId, amount }, user) {
const draft = { action: 'refund', orderId, amount };
return { needsApproval: true, approvalId: await saveDraft(draft, user) };
}
How to check
Through an injected page, ask the agent to delete a test record. The record is still there, and the user saw an approval request.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers security testing playbook: https://agentwranglers.se/playbook/adversarial-testing/ai-agents-and-models/human-approval.