All Products
Search
Document Center

Elastic Compute Service:Use the Workbench AI Agent mode for intelligent O&M on the cloud

Last Updated:Mar 31, 2026

The Workbench AI Agent mode lets you manage ECS instances using natural language instead of memorizing and typing shell commands. Describe what you want to do — install software, diagnose a slow server, or change SSH settings — and the agent plans and runs the commands for you.

How it works

The AI Agent mode is built into Alibaba Cloud Workbench. When you enter a natural language instruction, the agent breaks it down into a sequence of shell commands, runs them one by one, and adjusts its next steps based on each result.

The agent handles the following automatically:

CapabilityDescription
Shell command recognitionEntering a shell command like ls runs it directly, without starting a conversation.
Task decompositionHigh-level requests like install Docker or check CPU are broken into specific, executable steps.
Dynamic workflow adjustmentBased on whether a command succeeds, fails, or produces specific output, the agent adapts what it does next.
Decision-making and planningWith clear instructions, the agent plans the steps needed to complete a task. For example, when installing software, the agent resolves dependencies automatically.
Context awarenessThe agent tracks the current directory and previous command history to give more accurate suggestions.
OpenAPI integrationThe agent calls OpenAPI to retrieve instance information when needed, such as disk or security group details. Currently supported APIs: DescribeInstanceAttribute, DescribeSecurityGroupAttribute, and DescribeDisks.

Use cases

ScenarioExample prompt
Issue diagnosis — Server responding slowlyMy instance is a bit slow. Help me analyze and fix it.
Software installation — Install DockerPlease install Docker for me.
System O&M — Disable password-based SSH logonDisable password-based logon for SSH.

Prerequisites

Before you begin, ensure that you have:

  • A Workbench logon permission for the target ECS instance (required for your Alibaba Cloud account or Resource Access Management (RAM) user). See Workbench permissions.

  • (Optional) Public network access configured on the ECS instance, if the task requires downloading software from the internet (for example, installing Nginx or WordPress). Configure access via a public IP address or NAT Gateway.

Use the AI Agent mode

  1. Log on to a Linux instance using Workbench. In the ECS console, find the target instance and click Connect in the Actions column. Then click Sign in now next to Workbench.

  2. Enter AI Agent mode. Use one of the following methods:

    • Button (new Workbench version only): At the top of the terminal interface, click Agent. image

    • Keyboard shortcut: Press Command + I on macOS or Ctrl + Shift + I on Windows.

    • Context menu: Right-click in the terminal and select AI Terminal Mode.

  3. Enter an instruction. After switching to Agent mode, the input prompt changes style. Type a natural language instruction and press Enter. For example:

    My instance is a bit slow. Help me analyze and fix it.
    To force the agent to treat your input as natural language rather than a shell command, press Shift + Enter.
  4. Review and run the command. The agent plans the shell commands needed for your request. Review each command before running it, then click Run.

    Important

    AI-generated content is for reference only. Verify each command before running it. You are responsible for any consequences of command execution.

    image

    image

    High-risk commands — such as using kill to stop a process — are highlighted in red. Confirm the command a second time before running it.

    image

    To stop the agent while it is generating a response, click the image icon next to the AI output, or press Ctrl/Command + C.

    image

    To edit a command before running it, click Edit above the command box or press Ctrl/Command + E. After editing, click Save or press ESC.

    image

  5. Start a new session. After completing a task, click New Conversation below the AI output to clear the conversation history and start fresh.

Allow the agent to auto-execute commands

By default, the agent asks for confirmation before running every command. If you regularly run specific trusted commands — such as npm or git — configure a command whitelist to let the agent run them automatically.

  1. Click the image icon in the lower-right corner and go to AI Settings > Agent. Set Execution Mode to Use Whitelist.

  2. In the Command whitelist section, add the prefixes for commands you want to allow.

The whitelist uses prefix matching:

  • Adding npm allows all commands starting with npm, such as npm install and npm run dev.

  • Adding npm run allows only commands starting with npm run, such as npm run dev and npm run build. Commands like npm install still require confirmation.

Important

Use narrow prefixes. A broad prefix like rm causes high-risk commands to run without confirmation. Add only commands you trust completely.

After saving the configuration, whitelisted commands run automatically. All other commands still require confirmation. To revert to manual confirmation for all commands, set Execution Mode back to Each inquiry.

If a command still prompts for confirmation after you add it to the whitelist, check whether the command prefix you entered matches exactly. The whitelist uses prefix matching, so npm run does not cover npm install.

Upload and download files

In Agent mode, transfer files using natural language:

Query instance information via OpenAPI

The agent calls OpenAPI to retrieve instance-related information when needed. Currently supported APIs: DescribeInstanceAttribute, DescribeSecurityGroupAttribute, and DescribeDisks.

Example prompt: Check if the security group of this instance allows access from 192.168.2.10

2026-01-09_14-01-31.mp4

FAQ

Is there an extra charge for using the Workbench AI Agent mode?

No. The AI Agent mode is included at no additional cost.