Using the native Kernel provider
Agent Browser has built-in support for Kernel as a cloud browser provider. This is the simplest way to use Kernel with Agent Browser.Quick start
Use the-p flag to enable Kernel:
Configuration options
Configure Kernel via environment variables:| Variable | Description | Default |
|---|---|---|
KERNEL_HEADLESS | Run browser in headless mode (true/false) | false |
KERNEL_STEALTH | Enable stealth mode to avoid bot detection (true/false) | true |
KERNEL_TIMEOUT_SECONDS | Session timeout in seconds | 300 |
KERNEL_PROFILE_NAME | Browser profile name for persistent cookies/logins | (none) |
Profile persistence
WhenKERNEL_PROFILE_NAME is set, the profile will be created if it doesn’t already exist. Cookies, logins, and session data are automatically saved back to the profile when the browser session ends, making them available for future sessions.
Connecting via CDP (alternative)
If you need more control, you can connect Agent Browser to Kernel via CDP directly.1. Install the Kernel SDK
2. Initialize Kernel and create a browser
Import the libraries and create a cloud browser session:3. Connect Agent Browser to Kernel
Use Agent Browser’sconnect command to connect to Kernel’s CDP WebSocket URL:
<cdp_ws_url> is the cdp_ws_url from your Kernel browser session.
4. Use Agent Browser commands
Once connected, use Agent Browser’s commands with the Kernel-powered browser:5. Clean up
When you’re done, close the browser and clean up the Kernel session:Programmatic usage
You can also use Agent Browser programmatically with Kernel:Benefits of using Kernel with Agent Browser
- No local browser management: Run automations without installing or maintaining browsers locally
- Scalability: Launch multiple browser sessions in parallel
- Stealth mode: Built-in anti-detection features for web scraping
- Session state: Maintain browser state across runs via Profiles
- Live view: Debug your automations with real-time browser viewing
Next steps
- Check out live view for debugging your automations
- Learn about stealth mode for avoiding detection
- Learn how to properly terminate browser sessions

