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

Tool features

Available tools

The toolkit provides multiple tools for browser automation:

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. In its simplest form, only the AWS region is required:
The factory function also accepts optional parameters for proxy configuration, browser extensions, and browser profiles. See the sections below for details.

Proxy configuration

Route browser traffic through external proxies using the proxy_configuration parameter. This is useful for geo-targeting, IP rotation, or accessing region-restricted content.
The proxy_configuration parameter accepts either a ProxyConfiguration dataclass from bedrock-agentcore or an equivalent dictionary with proxies and optional bypass keys. Proxy credentials are stored securely in AWS Secrets Manager. For more details, see the AWS documentation on browser proxies.

Browser extensions

Load browser extensions from S3 into the managed browser session using the extensions parameter. Extensions are packaged as ZIP files and hosted in an S3 bucket.
The extensions parameter accepts a list of BrowserExtension dataclasses or equivalent dictionaries, each with an S3 location specifying the bucket and prefix. For more details, see the AWS documentation on browser extensions.

Browser profiles

Persist browser state (cookies, local storage, cached data) across sessions using the profile_configuration parameter. This allows agents to resume where they left off without re-authenticating or losing context. Create a profile using the AWS CLI or Boto3, then pass the returned profile ID:
The profile_configuration parameter accepts either a ProfileConfiguration dataclass from bedrock-agentcore or an equivalent dictionary with a profileIdentifier key. Profile IDs follow the format <name>-<10-char-suffix> and are returned when you create a profile via the Bedrock AgentCore control plane API. For more details, see the AWS documentation on browser profiles.

Combining configuration options

All three configuration options can be used together:

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: