AWS Security ChangesHomeSearch

AWS bedrock-agentcore documentation change

Service: bedrock-agentcore · 2025-10-16 · Documentation low

File: bedrock-agentcore/latest/devguide/browser-building-agents.md

Summary

Updated installation instructions and code example for browser agent, added CLI arguments for API key and parameters, restructured code flow

Security assessment

The change moves API key handling from hardcoded values to command-line arguments, but does not implement secure credential handling practices or mention security considerations. No concrete evidence of addressing a vulnerability.

Diff

diff --git a/bedrock-agentcore/latest/devguide/browser-building-agents.md b/bedrock-agentcore/latest/devguide/browser-building-agents.md
index 0b05c486e..c654314ea 100644
--- a//bedrock-agentcore/latest/devguide/browser-building-agents.md
+++ b//bedrock-agentcore/latest/devguide/browser-building-agents.md
@@ -5,2 +4,0 @@
-Amazon Bedrock AgentCore is in preview release and is subject to change. 
-
@@ -21 +19 @@ Get Nova ACT API key at https://nova.amazon.com/act
-    pip install nova-act
+    pip install bedrock-agentcore nova-act rich boto3
@@ -28 +25,0 @@ The following Python code shows how to write a browser agent using Nova Act. For
-    import time
@@ -32,4 +29,3 @@ The following Python code shows how to write a browser agent using Nova Act. For
-    
-    from browser_viewer import BrowserViewerServer
-     
-    NOVA_ACT_API_KEY = "YOUR_NOVA_ACT_API_KEY"
+    import argparse
+    import json
+    import boto3
@@ -39,6 +35 @@ The following Python code shows how to write a browser agent using Nova Act. For
-    def main():
-        try:
-            # Step 1: Create browser session
-            with browser_session('us-west-2') as client:
-                print("\r   ✅ Browser ready!                    ")
-                ws_url, headers = client.generate_ws_headers()
+    from boto3.session import Session
@@ -46,4 +37,3 @@ The following Python code shows how to write a browser agent using Nova Act. For
-                # Step 2: Start viewer server
-                console.print("\n[cyan]Step 3: Starting viewer server...[/cyan]")
-                viewer = BrowserViewerServer(client, port=8005)
-                viewer_url = viewer.start(open_browser=True)
+    boto_session = Session()
+    region = boto_session.region_name
+    print("using region", region)
@@ -51 +41,5 @@ The following Python code shows how to write a browser agent using Nova Act. For
-                # Step 3: Use Nova Act to interact with the browser with NovaAct
+    def browser_with_nova_act(prompt, starting_page, nova_act_key, region="us-west-2"):
+        result = None
+        with browser_session(region) as client:
+            ws_url, headers = client.generate_ws_headers()
+            try:
@@ -55,3 +49,2 @@ The following Python code shows how to write a browser agent using Nova Act. For
-                        preview={"playwright_actuation": True},
-                        nova_act_api_key=NOVA_ACT_API_KEY,
-                        starting_page="https://www.amazon.com",
+                    nova_act_api_key=nova_act_key,
+                    starting_page=starting_page,
@@ -59 +52,19 @@ The following Python code shows how to write a browser agent using Nova Act. For
-                        result = nova_act.act("Search for coffee maker and get the details of the lowest priced one on the first page")
+                    result = nova_act.act(prompt)
+            except Exception as e:
+                console.print(f"NovaAct error: {e}")
+            finally:
+                return result
+    
+    
+    if __name__ == "__main__":
+        parser = argparse.ArgumentParser()
+        parser.add_argument("--prompt", required=True, help="Browser Search instruction")
+        parser.add_argument("--starting-page", required=True, help="Starting URL")
+        parser.add_argument("--nova-act-key", required=True, help="Nova Act API key")
+        parser.add_argument("--region", default="us-west-2", help="AWS region")
+        args = parser.parse_args()
+    
+        result = browser_with_nova_act(
+            args.prompt, args.starting_page, args.nova_act_key, args.region
+        )
+        console.print(f"\n[cyan] Response[/cyan] {result.response}")
@@ -62,3 +72,0 @@ The following Python code shows how to write a browser agent using Nova Act. For
-                # Keep running
-                while True:
-                    time.sleep(1)
@@ -66,9 +74,3 @@ The following Python code shows how to write a browser agent using Nova Act. For
-        except KeyboardInterrupt:
-            console.print("\n\n[yellow]Shutting down...[/yellow]")
-            if 'client' in locals():
-                client.stop()
-                print("✅ Browser session terminated")
-        except Exception as e:
-            print(f"\n[red]Error: {e}[/red]")
-            import traceback
-            traceback.print_exc()
+###### Run the agent
+
+Execute the script (Replace with your Nova Act API key in the command):
@@ -76,2 +77,0 @@ The following Python code shows how to write a browser agent using Nova Act. For
-    if __name__ == "__main__":
-        main()
@@ -78,0 +79 @@ The following Python code shows how to write a browser agent using Nova Act. For
+    python nova_act_browser_agent.py --prompt "What are the common usecases of Bedrock AgentCore?" --starting-page "https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html" --nova-act-key "your-nova-act-API-key"
@@ -185 +186 @@ To use the Amazon Web Services Documentation, Javascript must be enabled. Please
-Get started
+Get started with AgentCore Browser