By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
You need to automate interactions with systems that have no API: legacy portals, government sites, vendor dashboards. A browser agent can click, type, and read pages the way a human does. Running that on a laptop doesn't scale and introduces risk. AgentCore Browser gives you a managed, isolated cloud Chrome instance that your agent can drive.
Your agent LLM controls a browser session through an automation library like Playwright or Nova Act. The session runs in a managed cloud environment, not on your machine. You can watch it happen in real time, take over control if needed, and replay recordings later from S3. Logs go to CloudWatch.
Start by creating a Browser tool or using the default one. You configure network settings, recording options, and IAM roles at tool creation time. When you start a session, it gets a timeout—15 minutes by default. Many sessions can run simultaneously for a single tool, each with its own state and environment. Stop the session when you're done to free resources.
Live View lets you watch the session in real time and even take over control from the automation. This is useful for handling CAPTCHAs or approvals that the agent can't solve alone. Session recordings are saved to your S3 bucket so you can review exactly what happened. CloudWatch logs appear under the AgentCore browser log group.
The SDK integration is straightforward. You create a browser session, generate WebSocket headers, and pass them to Playwright's CDP connection method.
# Shape of the SDK usage - see the Browser + Playwright quickstart
from bedrock_agentcore.tools.browser_client import browser_session
from playwright.sync_api import sync_playwright
with browser_session("us-west-2") as client:
ws_url, headers = client.generate_ws_headers()
with sync_playwright() as pw:
browser = pw.chromium.connect_over_cdp(ws_url, headers=headers)
page = browser.contexts[0].pages[0]
page.goto("https://example.com")
print(page.title())
The session client gives you a WebSocket URL and headers. Playwright connects over the Chrome DevTools Protocol using those credentials. From there, you interact with pages the same way you would with a local browser.
Never embed real passwords in prompts. Use Identity's token vault for logins instead. Treat all web page text as untrusted—a page can contain instructions designed to manipulate your agent (prompt injection). For risky actions like payments or deletions, pair the browser automation with Policy controls and human approval steps.
Official docs: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-tool.html and https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-quickstart.html
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.