# Require confirmation for an action

**Ask to confirm** makes the agent stop before it runs an action. The widget shows a confirmation card with what is about to happen and waits for the user to confirm or cancel. Use it for actions that delete data, cannot be undone, send something on the user's behalf or move money.

## How the analysis sets it

The analysis turns **Ask to confirm** on for every action it finds to be destructive. It decides from what the code does, not from the action's name. An action that makes a `DELETE` request always starts with the switch on.

A value you set yourself stays. Later updates and re-analyses do not change it.

## Turn on confirmation

To make the agent ask before an action:

1. In the portal, go to [**Web Agents**](https://auth.faustine.ai/go?to=%2Fweb-assistants) and select your agent.
2. Select the **Actions** tab.
3. In the action's row, turn on the switch in the **Confirmation** column. The same switch is labeled **Ask to confirm** when you open the action.
4. In the save bar, select **Save changes**.
5. Publish a version. See [Publish a version](https://docs.faustine.ai/web-agents/publish-a-version/).

Conversations get the change with the version you publish. The action shows an **Asks to confirm** badge in its editor.

## What the user sees

The model is told which actions ask for confirmation. Before it runs one, the agent replaces the place where the user types with a confirmation card and waits. The card has a title and the content the agent wrote to show what will change, such as the record that is about to be deleted.

- If the user confirms, the action runs and the agent reports the result.
- If the user cancels, the action does not run, and the agent asks what to do instead.

The agent gathers what it needs first and confirms once for the whole request. Asked to delete three contacts, it looks them up, then shows one card that lists the three.

Buttons that the agent draws in a reply follow the same switch. A button that runs an action with **Ask to confirm** on opens the card first, with the values it is about to send and the line **This cannot be undone from the chat.**

## Turn off confirmation

Turn the switch off, save and publish. The agent then runs the action as soon as the model decides to. Leave confirmation on for anything a user would not want done by a misread sentence.

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| The agent runs the action without asking | The change is in the draft, or the environment your site loads serves an older version. | Publish, and check which version the environment serves. See [Versions, environments and deployments](https://docs.faustine.ai/web-agents/versions-and-environments/). |

## Next steps

- [Turn an action on or off and test it](https://docs.faustine.ai/web-agents/test-an-action/): turn off what the agent should never do.
- [Actions](https://docs.faustine.ai/web-agents/actions/): how actions run in the user's session.
- [Read the logs](https://docs.faustine.ai/web-agents/logs/): see which actions ran in a conversation, and which the user declined.
