AgentCore Browser Service
Status: ✅ Available
Overview
Amazon Bedrock AgentCore Browser provides a fast, secure, cloud-based browser runtime enabling AI agents to interact with websites at scale without infrastructure management.
Core Capabilities
Cloud-Based Runtime
- Fast Execution: High-performance browser instances with minimal latency
- Auto Scaling: Automatic scaling based on demand without configuration
- Zero Infrastructure: No servers or containers to manage
- Multi-Region: Deploy browser instances across AWS regions globally
Security and Compliance
- Enterprise Security: Industry-standard security controls and encryption
- Isolated Sessions: Each browsing session runs in complete isolation
- Data Protection: Secure data handling and privacy controls
- Compliance Ready: Meets enterprise compliance requirements (SOC, HIPAA, GDPR)
Web Interaction Capabilities
- Full Automation: Complete browser automation capabilities
- JavaScript Support: Execute JavaScript in browser context
- Form Interaction: Fill forms, click buttons, navigate pages
- Content Extraction: Extract text, data, and media from pages
- Session Management: Handle cookies, local storage, and sessions
- Screenshot Capture: Take screenshots of pages and elements
Observability
- Execution Logging: Comprehensive logs of browser actions
- Performance Metrics: Track page load times and operation latency
- Error Tracking: Detailed error capture and debugging information
- Request Monitoring: Monitor network requests and responses
Use Cases
Web Scraping and Data Extraction
Enable agents to:
- Extract data from websites at scale
- Scrape content from dynamic pages
- Collect structured data from multiple sources
- Monitor website changes over time
Automated Testing and QA
Support scenarios like:
- Automated UI testing of web applications
- Regression testing for web features
- Cross-browser compatibility testing
- Performance testing and monitoring
Form Filling and Workflow Automation
Allow agents to:
- Automate form submissions
- Complete multi-step workflows
- Handle authentication and logins
- Process batch operations on web interfaces
Real-Time Monitoring
Enable agents to:
- Monitor website availability and uptime
- Track content changes and updates
- Verify website functionality
- Gather competitive intelligence
Content Verification
Support tasks like:
- Validate web content accuracy
- Check link integrity
- Verify page rendering
- Test responsive designs
Architecture
Browser Execution Flow
Agent Request
↓
┌─────────────────────────────────────────┐
│ Browser Service API │
│ - Parse browser action request │
│ - Validate parameters │
│ - Allocate browser instance │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Browser Instance │
│ - Navigate to URL │
│ - Execute JavaScript │
│ - Interact with page elements │
│ - Extract content and data │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Result Processing │
│ - Package extracted data │
│ - Capture screenshots (if requested) │
│ - Log execution details │
│ - Return results to agent │
└─────────────────────────────────────────┘Security Architecture
- Session Isolation: Each browser session runs in isolated environment
- Network Security: Controlled outbound internet access
- Data Encryption: All data encrypted in transit and at rest
- Resource Limits: CPU, memory, and time limits per session
- Access Control: IAM-based authentication and authorization
Configuration
Basic Browser Session
# Configure browser service for agent
aws bedrock-agentcore-control configure-browser \
--agent-id <AGENT_ID> \
--session-timeout 600 \
--viewport-width 1920 \
--viewport-height 1080 \
--region <REGION>Advanced Configuration
# Set browser preferences and capabilities
aws bedrock-agentcore-control update-browser-config \
--agent-id <AGENT_ID> \
--browser-config '{
"headless": true,
"javascript": true,
"images": true,
"cookies": true,
"userAgent": "CustomUserAgent/1.0",
"timeout": 30000
}' \
--region <REGION>Browser Actions
Navigation
// Navigate to URL
{
"action": "navigate",
"url": "https://example.com"
}
// Go back
{
"action": "goBack"
}
// Refresh page
{
"action": "reload"
}Element Interaction
// Click element
{
"action": "click",
"selector": "#submit-button"
}
// Fill input field
{
"action": "type",
"selector": "#username",
"text": "user@example.com"
}
// Select option
{
"action": "select",
"selector": "#country",
"value": "US"
}Content Extraction
// Extract text
{
"action": "getText",
"selector": ".article-content"
}
// Get element attribute
{
"action": "getAttribute",
"selector": "img.logo",
"attribute": "src"
}
// Evaluate JavaScript
{
"action": "evaluate",
"script": "return document.title;"
}Screenshots
// Full page screenshot
{
"action": "screenshot",
"fullPage": true
}
// Element screenshot
{
"action": "screenshot",
"selector": "#chart-container"
}Best Practices
Performance Optimization
- Use headless mode for non-visual operations
- Disable unnecessary resources (images, stylesheets)
- Set appropriate timeouts for page loads
- Reuse browser sessions when possible
- Implement exponential backoff for retries
Reliability
- Handle network failures gracefully
- Implement proper error handling
- Use explicit waits for dynamic content
- Verify element existence before interaction
- Set reasonable timeout values
Security
- Validate all URLs before navigation
- Sanitize extracted data
- Use secure credential storage
- Implement rate limiting
- Monitor for suspicious patterns
Cost Optimization
- Close browser sessions when done
- Use session pooling for frequent operations
- Set appropriate resource limits
- Monitor usage patterns
- Implement caching where appropriate
Integration Patterns
With Memory Service
Browser ←→ Memory Service
- Store extracted data in memory
- Cache frequently accessed pages
- Share session state across agentsWith Identity Service
Browser ←→ Identity Service
- Authenticate browser sessions
- Access credentials for protected sites
- Manage authentication tokensWith Code Interpreter
Browser ←→ Code Interpreter
- Process scraped data with code
- Transform extracted content
- Analyze website dataTroubleshooting
Common Issues
Page Load Timeout
- Symptom: Page takes too long to load
- Solution: Increase timeout or optimize target page
Element Not Found
- Symptom: Cannot locate page element
- Solution: Use explicit waits or verify selector
JavaScript Errors
- Symptom: Page JavaScript fails
- Solution: Check console logs, handle errors
Session Terminated
- Symptom: Browser session unexpectedly ends
- Solution: Check resource limits and session timeout
Authentication Required
- Symptom: Cannot access protected pages
- Solution: Configure credentials via Identity service
Monitoring
Key Metrics
- Session Count: Number of active browser sessions
- Success Rate: Percentage of successful operations
- Page Load Time: Average time to load pages
- Error Rate: Percentage of failed operations
- Resource Usage: CPU and memory utilization
CloudWatch Integration
# Query browser metrics
aws cloudwatch get-metric-statistics \
--namespace AWS/BedrockAgentCore/Browser \
--metric-name SessionCount \
--dimensions Name=AgentId,Value=<AGENT_ID> \
--start-time <START> \
--end-time <END> \
--period 3600 \
--statistics AverageLogging
# View browser execution logs
aws logs tail /aws/bedrock-agentcore/browser/<AGENT_ID> \
--follow \
--format shortPerformance Considerations
Optimization Techniques
- Disable Unnecessary Resources: Turn off images/stylesheets when not needed
- Use Headless Mode: Faster execution without rendering overhead
- Implement Caching: Cache static resources and repeated queries
- Parallel Execution: Run multiple browser sessions concurrently
- Smart Waiting: Use explicit waits instead of fixed delays
Scaling Patterns
- Horizontal Scaling: Launch multiple browser instances
- Session Pooling: Reuse browser sessions for efficiency
- Request Queuing: Queue browser operations during high load
- Regional Distribution: Distribute load across AWS regions
Additional Resources
- AWS Documentation: Bedrock AgentCore Browser
- Best Practices: Browser Automation Guide
- API Reference: Browser API
- Selector Reference: CSS Selectors
Related Services:
- Runtime Service - Agent execution
- Code Interpreter - Data processing
- Memory Service - State management
- Observability Service - Monitoring