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

by
0 comments
Customize AI agent browsing with proxies, profiles, and extensions in the Amazon Bedrock AgentCore browser

AI agents browsing the web need more than basic page navigation. Our customers tell us they need agents that maintain session state across interactions, route traffic through corporate proxy infrastructure, and run with custom browser configurations. AgentCore Browser provides a secure, isolated 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 the ability for agents to accomplish tasks in a real-world enterprise environment.

Today, we’re announcing three new capabilities that address these needs: proxy configuration, browser profiles, and browser extensions. Together, these features give you greater 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 reside in, and how they behave. Proxy configuration lets you route browser traffic through your own proxy server, providing IP stability and integration with corporate network infrastructure. Browser profiles retain cookies and local storage across sessions, so agents can resume authenticated workflows without repeating the login flow. Browser extensions load Chrome extensions into sessions to customize browser behavior for your use case. This post will walk you through each capability with configuration examples and practical use cases to help you get started.

How persistent browser profiles keep AI agents running smoothly

Customers building agents for e-commerce testing, authenticated workflows, and multi-step user journeys need browser sessions that remember state. Without a persistent profile, agents need to re-authenticate and rebuild the context at the beginning of each session, adding latency and fragility to automated workflows. The browser profile solves this by saving and restoring cookies and local storage between sessions, so an agent who logged into the portal yesterday can pick up where he left off today.

IP stability is another common requirement. Healthcare and financial portals validate sessions based on the source IP address, and rotating AWS IP addresses leads to repeated re-authentication cycles that break long-running workflows. Proxy support lets you route traffic through servers with static exit IPs, maintain session continuity, and meet IP allowlist requirements. Organizations that route traffic through corporate proxies need to extend this practice to AI agents for browser sessions. Proxy configuration enables access to internal webpages and resources that require proxy-based connectivity.

Browser extensions allow custom configuration such as ad blocking, authentication assistants, or other browser-level customizations. When combined with proxy logging, these capabilities help provide access control and audit evidence May compliance program Like FedRAMP, HITRUST, and PCI.

Feature 1: Proxy Configuration

browser Now supports routing browser traffic through your own external proxy server. When you create a browser session with a proxy configuration, AgentCore configures the browser to route HTTP and HTTPS traffic through your specified proxy server.

how it works

you call StartBrowserSession with proxyConfiguration Specifying your proxy server. If authentication is used, AgentCore retrieves the proxy credentials from AWS Secrets Manager. The browser session begins with your proxy configuration applied, and browser traffic is routed through your proxy server based on your domain routing rules.

Getting Started with Proxy

Complete these prerequisites 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 credential field is optional for proxies without authentication.

Domain-Based Routing

Use domainPatterns To route specific domains through the specified proxy, and bypass.domainPatterns For domains that must connect 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 And internal.corp route through corporate proxy, Demand To amazonaws.com bypass all proxiesAnd everything else is routed through the normal proxy. thESe field Are Just an example. bypass domain can mail bypass.domainPatterns to connect directly and external Representative could be the one valid of proxy domainPatterns Route through that proxy (first match based on array order wins).

routing priority

When the AgentCore browser processes an outbound request, it goes through three levels of routing rules to decide where to send the traffic. It first checks the bypass list. If the destination domain matches a bypass.domainPatterns The entry,request connects directly to the Internet without using any,proxy. AgentCore checks each proxy if the domain does not match the bypass rule. domainPatterns in order and routes the request through the first proxy whose pattern matches. If no proxy pattern matches, the request comes through the default proxy, which is the proxy entry that has none domainPatterns Defined.

Test the new proxy feature with code example.

Feature 2: Browser Profile

Browser profiles let you persist and reuse session data across multiple browser sessions, including cookies and local storage. An agent who authenticates with a web portal in one session can restore that state in a subsequent session without logging in again. This is useful for authenticated workflows where re-login adds latency, e-commerce testing where shopping cart and form data need to survive between sessions, and multi-step user journeys that span multiple browser invocations.

There are four stages in the profile lifecycle. 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 the current cookies and local storage in that profile. When you start a new session, you pass the profile identifier. profileConfiguration parameter of start_browser_session()Which restores the saved state in the new browser. When you no longer need the profile, you call delete_browser_profile() To clean it.

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

Complete these prerequisites 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 

Test the new profile feature with code example.

Feature 3: Browser Extension

Browser extensions let you load Chrome extensions into AgentCore browser sessions to customize the browser’s behavior. You package the extensions as zip files, upload them Amazon Simple Storage Service (Amazon S3), and refer to them when starting a browser session. This Chrome extension provides access to functionality available through the API, from proxy routing and ad blocking to authentication assistants and content modification. For example, you can inject authentication tokens for internal applications, remove advertisements and track scripts that interfere with agent navigation, or modify page content to improve how agents interact with a site.

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

Complete these prerequisites before proceeding.

  1. Upload extensions 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, pointing to the Amazon S3 bucket where you uploaded the zip file, start a session with the extension:
    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')}") 

Test the new extension feature with code example.

conclusion

Proxy configuration, browser profiles, and browser extensions AgentCore Browser provides the proxy routing, session persistence, and extensibility controls that customers need to deploy AI agents that browse the web in production. You can route traffic through your corporate proxy infrastructure, maintain session continuity across interactions, and customize browser behavior with extensions, all while keeping credentials secure in AWS Secrets Manager. Customers can move e-commerce context and information between sessions, create their own extension and test it in a secure environment before release, and, connect the browser to your network through a proxy.

To get started, watch the tutorial Amazon Bedrock AgentCore Samples Repositories and Amazon Bedrock AgentCore Browser documentation. For more information on pricing, visit Amazon Bedrock AgentCore pricing.


About the authors

joshua samuel

joshua samuel is a Senior AI/ML Specialist Solutions Architect at AWS, accelerating enterprise transformation through AI/ML and Generative AI solutions, based in Melbourne, Australia. A passionate disruptor, he specializes in agentic AI and coding techniques – anything that makes builders faster and happier. Outside of work, he works on home automation and AI coding projects, and enjoys life with his wife, children, and dog.

evandro franco

evandro franco is a Senior Data Scientist working at Amazon Web Services. He is part of the global GTM team that helps AWS customers address business challenges related to AI/ML on top of AWS, primarily on Amazon Bedrock AgentCore and Strands Agents. He has over 18 years of experience working with technology ranging from software development, infrastructure, serverless to machine learning. In his spare time, Evandro likes to play with his son, mainly building some fun Lego bricks.

Kosti Vasilkakis

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

yan maryam

yan maryam is a Senior GenAI Specialist Solutions Architect at Amazon Web Services, based in Brazil. As part of the LATAM Specialist team, he guides customers through their generative AI adoption journey, focusing on Amazon Bedrock and Agentic AI solutions. In his free time, Yan enjoys spending quality time with his wife and dog and watching football games.

kevin orellana

kevin orellana Seattle-based Bedrock is a software development engineer at Amazon Web Services on the AgentCore team. He builds and operates the core infrastructure powering agentic AI capabilities, including the browser, code interpreter, and runtime. Early in his career, Kevin worked on the bedrock estimation team hosting frontier models. In his free time, he likes hiking with his Goldendoodle, experimenting with multi-agent simulations, and working toward creating a personal AI assistant that speaks English, Spanish, and Mandarin.

Related Articles

Leave a Comment