README.md
May 9, 2026 · View on GitHub
The Cloud Sandbox Built for AI Agents
AgentBay provides on-demand cloud sandboxes for AI agents — isolated environments with browser, desktop, mobile, and code execution capabilities. Create a sandbox in seconds, let your agent do its work, and tear it down when done. No infrastructure to manage.
With SDKs for Python, TypeScript, Golang, and Java, AgentBay gives your agents a full cloud environment through a simple API: execute commands, browse the web, automate desktop apps, test mobile UIs, or run code — all in secure, disposable sandboxes.
🎯 What You Can Do
🌐 Browser UseAutomate web operations including content scraping, testing, and workflows. Cross-browser compatible with natural language control and remote access. |
🖥️ Computer UseCloud desktop environment for enterprise application automation. Standardized interfaces enable legacy software automation with intelligent resource scheduling. |
📱 Mobile UseCloud-based mobile environment for intelligent app automation. Precise UI recognition and control with parallel task processing for testing scenarios. |
💻 Code SpaceProfessional cloud development environment supporting multi-language code generation, compilation, and debugging. Secure, intelligent automated programming experience. |
✅ Prerequisites
Before using the SDK, you need to:
- Register an Alibaba Cloud account: https://aliyun.com
- Get APIKEY credentials: AgentBay Console
- Set environment variable:
- For Linux/MacOS:
export AGENTBAY_API_KEY=your_api_key_here - For Windows:
setx AGENTBAY_API_KEY your_api_key_here
- For Linux/MacOS:
📦 Installation
| Language | Install Command | Documentation |
|---|---|---|
| Python | pip install wuying-agentbay-sdk | Python Docs |
| TypeScript | npm install wuying-agentbay-sdk | TypeScript Docs |
| Golang | go get github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay | Golang Docs |
| Java | See Maven snippet below | Java Docs |
Java Maven dependency
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>agentbay-sdk</artifactId>
<version>0.20.0</version>
</dependency>
🚀 Quick Start
Python
from agentbay import AgentBay, CreateSessionParams
agent_bay = AgentBay()
# Create a cloud sandbox (options: "code_latest", "browser_latest", "desktop_latest")
session = agent_bay.create(CreateSessionParams(image_id="code_latest")).session
# Execute code in the sandbox
result = session.code.run_code("print('Hello AgentBay')", "python")
if result.success:
print(result.result) # Hello AgentBay
agent_bay.delete(session)
TypeScript
import { AgentBay } from 'wuying-agentbay-sdk';
const agentBay = new AgentBay();
// Create a cloud sandbox
const session = (await agentBay.create({ imageId: "code_latest" })).session;
// Execute code in the sandbox
const result = await session.code.runCode("print('Hello AgentBay')", "python");
if (result.success) {
console.log(result.result); // Hello AgentBay
}
await agentBay.delete(session);
Golang
import "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay"
client, _ := agentbay.NewAgentBay("", nil)
// Create a cloud sandbox
result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("code_latest"))
session := result.Session
// Execute code in the sandbox
res, _ := session.Code.RunCode("print('Hello AgentBay')", "python")
fmt.Println(res.Output) // Hello AgentBay
client.Delete(session, false)
Java
import com.aliyun.agentbay.*;
AgentBay agentBay = new AgentBay();
// Create a cloud sandbox
CreateSessionParams params = new CreateSessionParams().setImageId("code_latest");
Session session = agentBay.create(params).getSession();
// Execute code in the sandbox
CodeExecutionResult result = session.getCode().runCode("print('Hello AgentBay')", "python");
if (result.isSuccess()) {
System.out.println(result.getResult()); // Hello AgentBay
}
agentBay.delete(session, false);
📚 Documentation
New to AgentBay? Start with the Quick Start Tutorial — you'll be up and running in 5 minutes.
| Resource | Description |
|---|---|
| Quick Start Tutorial | Get started in 5 minutes |
| Core Concepts | Understand sessions, environments, and sandboxes |
| Feature Guides | In-depth guides for each capability |
| API Reference | Complete API docs (Python · TypeScript · Golang · Java) |
| Cookbook | Real-world examples and recipes |
🔧 Core Features
🎛️ Session Management
- Session Lifecycle — Create, manage, and delete cloud sandboxes on demand
- Environment Configuration — Configure regions, endpoints, and sandbox images
- Session Monitoring — Monitor status and health
🛠️ Built-in Modules
- Command Execution — Run shell commands in cloud sandboxes
- File Operations — Upload, download, and manage files
- Context & Data Persistence — Save and retrieve data across sessions
- Git Operations — Clone, commit, and manage repositories remotely
🤖 AI-Assisted Development
If you're using AI coding assistants (Claude, Cursor, GitHub Copilot, etc.) to develop with AgentBay SDK, use these files as context:
- llms.txt — Concise overview (~14k tokens, ~55 KB)
- llms-full.txt — Full SDK source, API docs, and examples (~211k tokens, ~827 KB)
🆘 Get Help
📞 Contact
Welcome to visit our product website and join our community!
- 🌐 AgentBay International Website: https://www.alibabacloud.com/product/agentbay
- 🇨🇳 AgentBay China Website (Chinese): https://www.aliyun.com/product/agentbay
- 💬 Discord Community: Join on Discord
- 💼 DingTalk Group: Click to join
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.