Skip to content

Conversation

@jsamuel1
Copy link

This commit adds support for the AgentCore Browser.

It allows the creation of an AgentCore Browser session, including recording support, and then connects to the session using PlayWright and CDP, per the existing pattern.

@google-cla
Copy link

google-cla bot commented Oct 13, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jsamuel1 jsamuel1 marked this pull request as ready for review October 13, 2025 06:37
@jsamuel1
Copy link
Author

CLA Updated.

@jsamuel1 jsamuel1 force-pushed the main branch 3 times, most recently from b7b0dbf to fc3d200 Compare November 1, 2025 02:54
Add comprehensive AgentCore browser integration with browser signing enabled:

Core Features:
- AgentCoreComputer class with CDP connection to AgentCore Browser
- Browser signing enabled for cryptographic agent identification
- Session recording to S3 with configurable bucket and prefix
- Auto-created IAM roles with minimal scoped permissions
- Configurable browser identifier via CLI, env var, or default
- Region detection with fallback chain (param > env > boto > default)

Browser Management:
- Browser reuse logic to avoid duplicate browser creation
- Dynamic browser ID generation for recording configurations
- Robust error handling and resource cleanup in session lifecycle
- Support for custom browser recording with unique identifiers

Browser Signing:
- Enables HTTP message signatures for web bot authentication
- Helps reduce CAPTCHAs when AI agents browse the web
- Cryptographically signs requests to identify as AI agent

IAM & Security:
- Browser identifier included in role names for clarity
- Bucket/prefix-based policy names for readability
- Always update IAM policy to match current bucket/prefix
- Trust policy scoped to bedrock-agentcore.amazonaws.com
- S3 permissions: PutObject, ListMultipartUploadParts, AbortMultipartUpload

CLI Arguments:
- --env=agentcore: Use AgentCore browser backend
- --recording_bucket: S3 bucket for session recordings
- --recording_prefix: S3 prefix for recordings (default: "recordings")
- --execution_role_arn: IAM role ARN for browser execution
- --create_execution_role: Auto-create IAM role if needed
- --browser_identifier: Browser identifier (default: "aws.browser.v1")

🤖 Assisted by Amazon Q Developer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant