Overview
Browser automation in OpenSandbox allows you to:- Run Chrome with remote debugging enabled
- Access browsers via VNC for visual monitoring
- Control browsers programmatically via Chrome DevTools Protocol
- Isolate browser sessions for security and reproducibility
- Scale browser instances independently
Architecture
The Chrome sandbox includes:- Chromium browser with headless/headful modes
- VNC server (port 5901) for remote desktop access
- Chrome DevTools (port 9222) for programmatic control
- execd daemon (port 44772) for command execution
Getting Started
1. Pull or Build the Chrome Image
2. Start OpenSandbox Server
3. Create a Chrome Sandbox
examples/chrome/
Access Methods
VNC Access
Connect to the browser visually using any VNC client:- See the browser UI in real-time
- Debug visual rendering issues
- Monitor agent interactions
- Take screenshots and recordings
Chrome DevTools Protocol
Control the browser programmatically via DevTools:MCP Integration
Use the Chrome DevTools MCP server for AI agent integration:Use Cases
Web Scraping
Extract data from dynamic websites that require JavaScript:Automated Testing
Run browser tests in isolated environments:AI Web Agents
Enable AI agents to browse the web and interact with pages:Screenshot and PDF Generation
Generate visual snapshots of web pages:Configuration
Environment Variables
SANDBOX_DOMAIN: Sandbox server address (default:localhost:8080)SANDBOX_API_KEY: API key for authentication
Chrome Image Customization
Build custom Chrome images with additional tools:Integration with Automation Frameworks
Playwright
Selenium
Puppeteer
Security Best Practices
Network Isolation
Limit browser network access:Resource Limits
Prevent resource exhaustion:Ephemeral Sessions
Create fresh browser instances for each task:Performance Optimization
Headless Mode
Use headless mode when visual rendering isn’t needed:Disable Unnecessary Features
Connection Pooling
Reuse browser connections for multiple operations:Troubleshooting
Browser Won’t Start
Check sandbox logs:DevTools Connection Failed
Verify port exposure:VNC Display Issues
Check VNC server status:Related Resources
Chrome Example
Complete browser automation example
Playwright Example
Playwright integration example
AI Coding Agents
AI agents with code execution
Python SDK
SDK reference documentation