Approve agent actions
This feature is in public preview. Features and behavior are subject to change.
Before the agent runs a command, changes a file, or fetches a web page, it might ask for your approval. This gives you a chance to review what the agent is about to do before it happens.
Your administrator decides how often the agent asks. Some actions are approved in advance, some are blocked, and the rest come to you.
Topics
What the agent asks about
Each request tells you which action the agent wants to take and what it will affect.
| Action | What you see |
|---|---|
Run a command |
The command |
Change a file |
The file name |
Fetch a web page or search the web |
The address, or the search words |
Use a connected service, such as GitHub |
The service and tool name, and the details the agent will send |
The agent shortens long commands in the request. To see the whole command, expand the agent's response. The agent doesn't ask before it reads files in the folder you're working in.
Approve or deny an action
A request appears in the chat where you gave the agent the task. If a request is waiting in a chat that you're not looking at, the Chat button shows an alert mark, and the chat is marked in Sessions.
To approve or deny an action
-
Read the action in the request.
-
Choose one of the following:
-
Choose Approve & run to have the agent take the action and continue.
-
Choose Not now to skip the action. The agent doesn't stop. It continues with the rest of your request, and might try something else or tell you what it couldn't finish.
-
To stop the agent completely, choose Stop.
-
When you approve a command, it runs with everything the agent can do, including programs that the command starts. Take extra care with commands that install packages or run scripts, because those can run code that isn't shown in the request.
The agent waits until you answer. Approvals don't time out, and nobody answers for you. The one exception is a follow-up that the agent starts on its own, such as after a background task finishes. If that follow-up waits more than 30 minutes while you're disconnected, it stops.
While a request is waiting, the agent pauses that chat. Your other chats keep working. If you reload the page or lose your connection, a request that's still waiting comes back when you return.
Why the agent doesn't always ask
Three things decide whether the agent asks you.
-
Which actions your administrator allows. Your administrator can approve some actions in advance and block others. A blocked action never runs, and you aren't asked about it, so there's nothing for you to approve. If the agent tells you it can't do something and you were never asked, the action is blocked. Ask your administrator. These rules apply wherever you work with the agent, including in the terminal.
-
How much the agent asks. Your administrator also sets the mode that the agent starts in. In the terminal, you can switch to another mode, but not to Auto unless your administrator chose it.
Setting What it means Default
The agent asks each time it wants to edit a file, run a command, or reach the network, unless your administrator approved that action in advance.
Accept edits
The agent changes files and runs common file commands, such as creating or moving files, in your working folders without asking. It still asks about other commands and actions.
Plan
The agent researches your request and proposes a plan without changing anything. The plan arrives as an approval request. To read all of it, expand the agent's response. Choose Approve & run to start the work.
Auto
The agent decides most actions itself and checks them against what you asked for. You see few or no requests.
-
Your answer, for everything the first two leave open.
The agent always has something checking each action, whether that's you, a rule
your administrator set, or its own check in Auto mode. There's
no setting that turns approvals off completely. Hooks are the exception: A hook set
up in the agent's settings, or in a project's .claude folder, runs its
command automatically without asking. Hooks run with the same limits as the
agent.
Approvals, questions, and sign-in requests
The agent can ask you for three different things.
| Request | What the agent wants | What you do |
|---|---|---|
Approval |
To take an action |
Choose Approve & run or Not now. |
Question |
To know which option you prefer |
Choose an option, or dismiss the question and tell the agent in the chat. |
Sign-in |
You to sign in to a connected service |
Choose Show desktop and sign in on the page that the agent opened in the browser on your WorkSpace. To open the page again, choose Open again. If the page didn't open, choose Open on desktop. |
A question isn't an approval. Answering it tells the agent what you want; it doesn't give the agent permission. A sign-in request expires after 10 minutes. For more information, see Connect to services.