Reactive Machines

Customize AI agent browsing with proxies, profiles, and extensions in Amazon Bedrock AgentCore Browser

AI agents browsing the web need more than basic page navigation. Our customers tell us that they need agents that maintain session state across interactions, route traffic through enterprise proxy infrastructure, and use custom browser settings. AgentCore Browser provides a secure, single browser environment for your agents to interact with web applications. Until now, in the Agent Core Browser, each browser session started from a blank slate with default settings and direct Internet access, limiting what agents could accomplish in real business environments.

Today, we're announcing three new capabilities that address these needs: proxy configuration, browser profiles, and browser extensions. Together, these features give you precise control over how your AI agents interact with the web.

These three capabilities give you control over how AgentCore Browser sessions connect to the Internet, what state they store, and how they behave. A proxy configuration allows you to route browser traffic through your own proxy servers, providing IP stability and integration with the corporate network infrastructure. Browser profiles persist cookies and local storage across sessions, so agents can resume authenticated workflows without repeating logins. Browser extensions load Chrome extensions into sessions so you can customize the browser's behavior for your use case. This post will walk through each capability with configuration examples and real-world use cases to help you get started.

How persistent browser profiles keep AI Agents running efficiently

Customer-build agents for e-commerce testing, validated workflows, and multi-step user journeys require state-of-the-art browser sessions. Without persistent profiles, agents need to re-authenticate and rebuild the context at the start of each session, adding delays and fragility to automated workflows. Browser profiles solve this by saving and restoring cookies and local storage between sessions, so that an agent who logged into the portal yesterday can pick up where they left off today.

IP stability is another common requirement. Healthcare and financial sites authenticate sessions based on the source IP address, and rotating AWS IP addresses cause frequent re-authentication cycles that break long-running workflows. Proxy support allows you to route traffic through servers with stable egress IPs, maintain session continuity and meet IP whitelist requirements. Organizations that route traffic through corporate proxies need to extend this practice to AI agents in browser sessions. Proxy configuration allows access to internal web pages and resources that require proxy-based communication.

Browser extensions allow customizations such as ad blocking, authentication assistants, or other browser-level customizations. When combined with proxy logging, these capabilities help provide access control and authentication it is possible compliance programs such as FedRAMP, HITRUST, and PCI.

Feature 1: Proxy configuration

Browser now supports routing of browser traffic through your external hosting servers. When you create a browser session with a proxy configuration, AgentCore configures the browser to route HTTP and HTTPS traffic through your specified proxy servers.

How does this work

You are calling StartBrowserSession with proxyConfiguration specifies your proxy server. When using authentication, AgentCore retrieves the agent's credentials from AWS Identity Manager. A browser session starts with your proxy configuration being used, and the browser routes traffic through your proxy server based on the rules of your routing domain.

Getting started with proxies

Complete these requirements before proceeding.

import boto3 
import json 
client = boto3.client('secretsmanager') 
client.create_secret( 
    Name="my-proxy-credentials", 
    SecretString=json.dumps({ 
        'username': '', 
        'password': '' 
    }) 
) 

Step 2: Create a browser session with proxy configuration

session_client = boto3.client('bedrock-agentcore', region_name="") 
 
response = session_client.start_browser_session( 
    browserIdentifier="aws.browser.v1", 
    name="my-proxy-session", 
    proxyConfiguration={ 
        "proxies": [{ 
            "externalProxy": { 
                "server": "", 
                "port": 8080, 
                "credentials": { 
                    "basicAuth": { 
                        "secretArn": "arn:aws:secretsmanager:::secret:" 
                    } 
                } 
            } 
        }] 
    } 
) 
print(f"Session ID: {response['sessionId']}")

The details field is optional for proxies without authentication.

Domain-based routing

Use it domainPatterns to move certain domains through designated proxies, and bypass.domainPatterns For domains that should be linked directly:

proxyConfiguration={ 
    "proxies": [ 
        { 
            "externalProxy": { 
                "server": "corp-proxy.example.com", 
                "port": 8080, 
                "domainPatterns": [".company.com", ".internal.corp"] 
            } 
        }, 
        { 
            "externalProxy": { 
                "server": "general-proxy.example.com", 
                "port": 8080 
            } 
        } 
    ], 
    "bypass": { 
        "domainPatterns": [".amazonaws.com"] 
    } 
}

With this configuration, requests to again internal.corp route within the company representative, applications to amazonaws.com bypass all proxiesand everything else goes through a standard proxy. Thesin the fields there is just an example. Bypass domains can be compatible bypass.domainPatterns direct connection again outside representative it can be a it is permissible proxy domainPatterns route through that proxy (first game wins based on program order).

The beginning of the route

When the AgentCore Browser processes an outgoing request, it goes through three stages of routing rules to decide where to send the traffic. It starts checking the pass list. If the destination domain is the same as a bypass.domainPatterns login, the application connects directly to the Internet without using any proxy. If the domain does not match the pass rule, AgentCore checks each agent domainPatterns respectively and routes the request through the first proxy whose pattern is the same. If no proxy pattern matches any other, the request falls to the default proxy, which is the incoming proxy input domainPatterns explained.

Check out the new proxy feature with this code example.

Feature 2: Browser profiles

Browser profiles allow you to persist and reuse session data across multiple browsing sessions, including cookies and local storage. An agent who authenticates through the web portal in one session can restore that status in a later session without logging in again. This is useful for validated workflows where re-signing adds latency, e-commerce testing where shopping carts and form data need to survive between sessions, and multi-step user journeys that include multiple browser appeals.

The life cycle of a profile has four stages. You start by calling create_browser_profile() to create a named profile. At the end of the session, you call save_browser_session_profile() to capture current cookies and local storage for that profile. When you start a new session, you pass the profile identifier to profileConfiguration parameter of start_browser_session()which returns the saved state to the new browser. If you no longer need the profile, you call delete_browser_profile() cleaning it up.

The following example shows an agent that adds items to the shopping cart in one session and ensures that they continue in the next session.

Complete these requirements before proceeding.

import boto3 

control_client = boto3.client('bedrock-agentcore-control', region_name="") # replace by your region 

session_client = boto3.client('bedrock-agentcore', region_name="") # replace by your region  
 
# Create a browser profile 
profile = control_client.create_browser_profile(name="ecommerce_profile") 
profile_id = profile['profileId'] 
 
# Session 1: Add items to cart 
session1 = session_client.start_browser_session( 
    browserIdentifier=”aws.browser.v1”, 
    name="shopping-session-1" 
) 
# ... agent navigates and adds items to cart ... 
 
# Save session state to profile 
session_client.save_browser_session_profile( 
    sessionId=session1['sessionId'], 
    browserIdentifier=”aws.browser.v1”, 
    profileIdentifier=profile_id 
) 
session_client.stop_browser_session(sessionId=session1['sessionId'], browserIdentifier="aws.browser.v1") 
 
# Session 2: Resume with saved profile 
session2 = session_client.start_browser_session( 
    browserIdentifier=”aws.browser.v1”, 
    name="shopping-session-2", 
    profileConfiguration={"profileIdentifier": profile_id} 
) 
# Cart items from Session 1 are now available 

Check out the new profile feature with this code example.

Feature 3: Browser extensions

Browser extensions allow you to load Chrome extensions into AgentCore Browser sessions to customize the way the browser behaves. You package the extensions as ZIP files, and upload them to it Amazon Simple Storage service (Amazon S3), and refer to them when you start a browser session. This provides access to functionality available through the Chrome API extension, from proxy routing and ad blocking to authentication assistants and content modification. For example, you can inject authentication tokens for internal applications, remove ads, and track scripts that interfere with agent navigation, or change page content to improve how agents interact with the site.

Your extension must follow the standard Chromium extension format and comply with the Chromium extension guidelines.

Complete these requirements before proceeding.

  1. Upload the extension to Amazon S3:
    # Upload extension to S3 
    
    import boto3 
    s3 = boto3.client('s3') 
    s3.upload_file( 
        'my-extension.zip', 
        'amzn-s3-demo-bucket-extensions', 
        'extensions/my-extension.zip' 
    ) 

  2. Then, start a session with the extension, pointing to the Amazon S3 bucket where you uploaded the zip file:
    import boto3 
    region = "" # replace by your region 
    client = boto3.client('bedrock-agentcore', region_name=region) 
    
    response = client.start_browser_session( 
        browserIdentifier="aws.browser.v1", 
        name="my-session-with-extensions", 
        sessionTimeoutSeconds=1800, 
        viewPort={ 
            'height': 1080, 
            'width': 1920 
        }, 
        extensions=[ 
            { 
                "location": { 
                    "s3": { 
                        "bucket": "amzn-s3-demo-bucket-extensions", 
                        "prefix": "extensions/my-extension.zip" 
                    } 
                } 
            }, 
            { 
                "location": { 
                    "s3": { 
                        "bucket": "amzn-s3-demo-bucket-extensions", 
                        "prefix": "extensions/another-extension.zip", 
                        "versionId": "abc123"  # Optional - for versioned S3 buckets 
                    } 
                } 
            } 
        ] 
    ) 
     
    print(f"Session ID: {response['sessionId']}") 
    print(f"Status: {response['status']}") 
    print(f"Automation Stream: {response['streams']['automationStream']['streamEndpoint']}") 

Check out the new extensions feature with this code example.

The conclusion

Proxy configuration, browser profiles, and browser extensions provide AgentCore Browser with the proxy routing, session persistence, and scalability controls customers need to deploy web-browsing AI agents in production. You can route traffic using your company's proxy infrastructure, maintain session continuity across interactions, and customize browser behavior with extensions, all while keeping information secure in AWS Privacy Manager. Customers can manage e-commerce content and information between sessions, create your own extension and test it in a secure environment before release, and, have a browser that connects to your network through proxies.

To get started, see the tutorial at Amazon Bedrock AgentCore samples endpoint and Amazon Bedrock AgentCore Browser documents. For more information about pricing, visit Amazon Bedrock AgentCore Price.


About the Authors

Joshua Samuel

Joshua Samuel is a Senior AI/ML Specialist Solutions Architect at AWS accelerating business transformation through AI/ML, and productive AI solutions, based in Melbourne, Australia. A passionate debugger, he specializes in agent AI and coding techniques – Anything that makes developers fast and happy. Outside of work, he plays with home automation and AI coding projects, and enjoys life with his wife, kids and dog.

Evandro Franco

Evandro Franco Sr. Data Scientist working at Amazon Web Services. He is part of the Global GTM team helping AWS customers overcome business challenges related to AI/ML over AWS, specifically for Amazon Bedrock AgentCore and Strands Agents. He has over 18 years of experience working in technology, from software development, infrastructure, serverless, to machine learning. In his free time, Evandro enjoys playing with his son, especially building funny Lego bricks.

Kosti Vasilakakis

Kosti Vasilakakis is a Principal at AWS on the Agentic AI team, where he led the design and development of several Bedrock AgentCore services from the ground up, including Runtime, Browser, Code Interpreter, and Identity. He previously worked on Amazon SageMaker from its early days, introducing AI/ML capabilities that are now used by thousands of companies around the world. Earlier in his career, Kosti was a data scientist. Outside of work, he builds manufacturing automation, plays tennis, and enjoys life with his wife and children.

Yan Marim

Yan Marim Sr. GenAI Specialist Solutions Architect at Amazon Web Services, based in Brazil. As part of the LATAM Expert team, he guides clients on their productive AI adoption journey, focusing on Amazon Bedrock and agent AI solutions. In his free time, Yan enjoys spending quality time with his wife and dog, and watching football games.

Kevin Orellana

Kevin Orellana is a Software Development Engineer at Amazon Web Services on the Bedrock AgentCore team, based in Seattle. Builds and operates the core infrastructure that powers the agent's AI capabilities, including the Browser, Code Interpreter, and Runtime. Earlier in his career, Kevin worked on the Bedrock team holding boundary models. In her free time, she enjoys hiking with her Goldendoodle, trying to impersonate multiple agents, and working on building an AI personal assistant that speaks English, Spanish, and Mandarin.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button