start_browser_session¶
Operation¶
start_browser_session
async
¶
start_browser_session(input: StartBrowserSessionInput, plugins: list[Plugin] | None = None) -> StartBrowserSessionOutput
Creates and initializes a browser session in Amazon Bedrock AgentCore. The session enables agents to navigate and interact with web content, extract information from websites, and perform web-based tasks as part of their response generation.
To create a session, you must specify a browser identifier and a name.
You can also configure the viewport dimensions to control the visible
area of web content. The session remains active until it times out or
you explicitly stop it using the StopBrowserSession operation.
The following operations are related to StartBrowserSession:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
StartBrowserSessionInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
StartBrowserSessionOutput
|
An instance of |
Input¶
StartBrowserSessionInput
dataclass
¶
Dataclass for StartBrowserSessionInput structure.
Attributes¶
browser_identifier
class-attribute
instance-attribute
¶
browser_identifier: str | None = None
The unique identifier of the browser to use for this session. This identifier specifies which browser environment to initialize for the session.
certificates
class-attribute
instance-attribute
¶
certificates: list[Certificate] | None = None
A list of certificates to install in the browser session.
client_token
class-attribute
instance-attribute
¶
client_token: str | None = None
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.
enterprise_policies
class-attribute
instance-attribute
¶
enterprise_policies: list[BrowserEnterprisePolicy] | None = None
A list of files containing enterprise policies for the browser.
extensions
class-attribute
instance-attribute
¶
extensions: list[BrowserExtension] | None = None
A list of browser extensions to load into the browser session.
filesystem_configurations
class-attribute
instance-attribute
¶
filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None
The file system configurations to mount into the browser session. Use these configurations to mount your own Amazon Simple Storage Service (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access points. Your session can then read and write your data. If you don't specify this field, no additional file systems are mounted.
name
class-attribute
instance-attribute
¶
name: str | None = None
The name of the browser session. This name helps you identify and manage the session. The name does not need to be unique.
profile_configuration
class-attribute
instance-attribute
¶
profile_configuration: BrowserProfileConfiguration | None = None
The browser profile configuration to use for this session. A browser profile contains persistent data such as cookies and local storage that can be reused across multiple browser sessions. If specified, the session initializes with the profile's stored data, enabling continuity for tasks that require authentication or personalized settings.
proxy_configuration
class-attribute
instance-attribute
¶
proxy_configuration: ProxyConfiguration | None = None
Optional proxy configuration for routing browser traffic through
customer-specified proxy servers. When provided, enables HTTP Basic
authentication via Amazon Web Services Secrets Manager and domain-based
routing rules. Requires secretsmanager:GetSecretValue IAM permission
for the specified secret ARNs.
session_timeout_seconds
class-attribute
instance-attribute
¶
session_timeout_seconds: int = 3600
The duration in seconds (time-to-live) after which the session automatically terminates, regardless of ongoing activity. Defaults to 3600 seconds (1 hour). Recommended minimum: 60 seconds. Maximum allowed: 28,800 seconds (8 hours).
trace_id
class-attribute
instance-attribute
¶
trace_id: str | None = None
The trace identifier for request tracking.
trace_parent
class-attribute
instance-attribute
¶
trace_parent: str | None = None
The parent trace information for distributed tracing.
view_port
class-attribute
instance-attribute
¶
view_port: ViewPort | None = None
The dimensions of the browser viewport for this session. This determines the visible area of the web content and affects how web pages are rendered. If not specified, Amazon Bedrock AgentCore uses a default viewport size.
Output¶
StartBrowserSessionOutput
dataclass
¶
Dataclass for StartBrowserSessionOutput structure.
Attributes¶
created_at
instance-attribute
¶
created_at: datetime
The timestamp when the browser session was created.
session_id
instance-attribute
¶
session_id: str
The unique identifier of the created browser session.
streams
class-attribute
instance-attribute
¶
streams: BrowserSessionStream | None = None
The streams associated with this browser session. These include the automation stream and live view stream.