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:

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: