Skip to main content
Amazon Bedrock AgentCore Browser enables agents to interact with web pages through a managed Chrome browser. Agents can navigate websites, extract content, fill forms, click elements, and take screenshots in a secure, managed environment.

Overview

Integration details

ClassPackageSerializableJS supportVersion
BrowserToolkitlangchain-awsPyPI - Version

Tool features

Returns artifactNative asyncSupports browser interactionPricing
Pay-per-use (AWS)

Available tools

The toolkit provides multiple tools for browser automation:
ToolDescription
navigate_browserNavigate to a URL
click_elementClick on an element using CSS selector
type_textType text into an input field
extract_textExtract all text content from the page
extract_hyperlinksExtract all hyperlinks from the page
get_elementsGet elements matching a CSS selector
current_webpageGet the current page URL and title
navigate_backGo back to the previous page
take_screenshotTake a screenshot of the page
scroll_pageScroll the page in a direction
wait_for_elementWait for an element to appear

Setup

The integration lives in the langchain-aws package. It also requires playwright and beautifulsoup4 for browser automation and HTML parsing.

Credentials

You need AWS credentials configured with permissions for Bedrock AgentCore Browser. See the Amazon Bedrock AgentCore documentation for required IAM permissions. It’s also helpful (but not needed) to set up LangSmith for best-in-class observability:

Instantiation

The toolkit is created using a factory function:

Invocation

Direct tool usage

Get specific tools and invoke them:

Use within an agent

Thread-based session isolation

The toolkit maintains separate browser sessions for each thread_id. This enables concurrent usage without interference:

Browser actions

Interacting with elements

Extracting content

Screenshots and scrolling

Session cleanup

Always clean up browser sessions when done to release resources:
Note: While create_browser_toolkit() is synchronous, the cleanup() method is asynchronous and must be awaited.

Concurrency protection

The toolkit includes built-in concurrency protection. Each browser session is tied to a specific thread_id, and attempting to access the same session while it’s already in use will raise a RuntimeError. Use different thread_id values for concurrent operations.

API reference

For detailed documentation of all features and configurations, see: