Computer use tool
Give Claude screenshot, mouse, and keyboard control of a desktop environment with the computer use tool, the computer_toolset_20260801 client toolset.
Claude can interact with computer environments through the computer use tool, which provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
The computer use tool is an Anthropic-defined client toolset: one {"type": "computer_toolset_20260801"} entry in tools gives Claude 17 member tools such as screenshot, left_click, type, and zoom, and your application runs every call in an environment you control. It isn't currently available in Claude Managed Agents. Claude's calls are tool_use blocks whose name is the member and which carry "toolset_name": "computer", often several per turn (a batch action).
For tasks that stay inside webpages, the browser use tool is the closer fit: its member tools read and act on the page itself, and it doesn't need a full desktop environment.
Security considerations
Computer use has unique risks distinct from standard API features. These risks are heightened when interacting with the internet.
In some circumstances, Claude will follow commands found in content even when they conflict with your instructions. For example, instructions on webpages or contained in images might override your instructions or cause Claude to make mistakes. Take precautions to isolate Claude from sensitive data and actions to avoid risks related to prompt injection.
Anthropic has trained the model to resist these prompt injections and has added an extra layer of defense. If you use the computer use tools, classifiers will automatically run on your prompts to flag potential instances of prompt injections. When these classifiers identify potential prompt injections in screenshots, they will automatically steer the model to ask for user confirmation before proceeding with the next action. This extra protection won't be ideal for every use case (for example, use cases without a human in the loop), so if you'd like to opt out and turn it off, contact support.
These precautions remain important even with the classifier defense layer in place.
Inform end users of relevant risks and obtain their consent prior to enabling computer use in your own products.
Quick start
Add the computer use toolset to the tools array of a Messages API request as {"type": "computer_toolset_20260801"}. The request needs no beta header. This example also declares the text editor tool and bash tool, which Claude typically uses alongside computer use:
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-5",
max_tokens=1024,
tools=[
{"type": "computer_toolset_20260801"},
{"type": "text_editor_20250728", "name": "str_replace_based_edit_tool"},
{"type": "bash_20250124", "name": "bash"},
],
messages=[{"role": "user", "content": "Save a picture of a cat to my desktop."}],
)
print(response)When Claude acts on the desktop, the response has a stop_reason of tool_use and contains one or more member tool_use blocks, each naming a member tool and carrying "toolset_name": "computer". Partway through this task, after Claude has seen a screenshot of the desktop, a response might look like this:
{
"id": "msg_01UZ3bXcQH8mTqNhVfL9eK2p",
"type": "message",
"role": "assistant",
"model": "claude-opus-5",
"content": [
{
"type": "text",
"text": "I'll open the web browser to find a picture of a cat."
},
{
"type": "tool_use",
"id": "toolu_01WkoTUvSHDzTBu2xnGk8Ep8",
"name": "left_click",