$npx -y skills add vercel-labs/agent-browser --skill agentcoreRun agent-browser on AWS Bedrock AgentCore cloud browsers. Use when the user wants to use AgentCore, run browser automation on AWS, use a cloud browser with AWS credentials, or needs a managed browser session backed by AWS infrastructure. Triggers include "use agentcore", "run on
| 1 | # AWS Bedrock AgentCore |
| 2 | |
| 3 | Run agent-browser on cloud browser sessions hosted by AWS Bedrock AgentCore. All standard agent-browser commands work identically; the only difference is where the browser runs. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | Credentials are resolved automatically: |
| 8 | |
| 9 | 1. Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, optionally `AWS_SESSION_TOKEN`) |
| 10 | 2. AWS CLI fallback (`aws configure export-credentials`), which supports SSO, IAM roles, and named profiles |
| 11 | |
| 12 | No additional setup is needed if the user already has working AWS credentials. |
| 13 | |
| 14 | ## Core Workflow |
| 15 | |
| 16 | ```bash |
| 17 | # Open a page on an AgentCore cloud browser |
| 18 | agent-browser -p agentcore open https://example.com |
| 19 | |
| 20 | # Everything else is the same as local Chrome |
| 21 | agent-browser snapshot -i |
| 22 | agent-browser click @e1 |
| 23 | agent-browser screenshot page.png |
| 24 | agent-browser close |
| 25 | ``` |
| 26 | |
| 27 | ## Environment Variables |
| 28 | |
| 29 | | Variable | Description | Default | |
| 30 | |----------|-------------|---------| |
| 31 | | `AGENTCORE_REGION` | AWS region | `us-east-1` | |
| 32 | | `AGENTCORE_BROWSER_ID` | Browser identifier | `aws.browser.v1` | |
| 33 | | `AGENTCORE_PROFILE_ID` | Persistent browser profile (cookies, localStorage) | (none) | |
| 34 | | `AGENTCORE_SESSION_TIMEOUT` | Session timeout in seconds | `3600` | |
| 35 | | `AWS_PROFILE` | AWS CLI profile for credential resolution | `default` | |
| 36 | |
| 37 | ## Persistent Profiles |
| 38 | |
| 39 | Use `AGENTCORE_PROFILE_ID` to persist browser state across sessions. This is useful for maintaining login sessions: |
| 40 | |
| 41 | ```bash |
| 42 | # First run: log in |
| 43 | AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/login |
| 44 | agent-browser snapshot -i |
| 45 | agent-browser fill @e1 "user@example.com" |
| 46 | agent-browser fill @e2 "password" |
| 47 | agent-browser click @e3 |
| 48 | agent-browser close |
| 49 | |
| 50 | # Future runs: already authenticated |
| 51 | AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/dashboard |
| 52 | ``` |
| 53 | |
| 54 | ## Live View |
| 55 | |
| 56 | When a session starts, AgentCore prints a Live View URL to stderr. Open it in a browser to watch the session in real time from the AWS Console: |
| 57 | |
| 58 | ``` |
| 59 | Session: abc123-def456 |
| 60 | Live View: https://us-east-1.console.aws.amazon.com/bedrock-agentcore/browser/aws.browser.v1/session/abc123-def456# |
| 61 | ``` |
| 62 | |
| 63 | ## Region Selection |
| 64 | |
| 65 | ```bash |
| 66 | # Default: us-east-1 |
| 67 | agent-browser -p agentcore open https://example.com |
| 68 | |
| 69 | # Explicit region |
| 70 | AGENTCORE_REGION=eu-west-1 agent-browser -p agentcore open https://example.com |
| 71 | ``` |
| 72 | |
| 73 | ## Credential Patterns |
| 74 | |
| 75 | ```bash |
| 76 | # Explicit credentials (CI/CD, scripts) |
| 77 | export AWS_ACCESS_KEY_ID=AKIA... |
| 78 | export AWS_SECRET_ACCESS_KEY=... |
| 79 | agent-browser -p agentcore open https://example.com |
| 80 | |
| 81 | # SSO (interactive) |
| 82 | aws sso login --profile my-profile |
| 83 | AWS_PROFILE=my-profile agent-browser -p agentcore open https://example.com |
| 84 | |
| 85 | # IAM role / default credential chain |
| 86 | agent-browser -p agentcore open https://example.com |
| 87 | ``` |
| 88 | |
| 89 | ## Using with AGENT_BROWSER_PROVIDER |
| 90 | |
| 91 | Set the provider via environment variable to avoid passing `-p agentcore` on every command: |
| 92 | |
| 93 | ```bash |
| 94 | export AGENT_BROWSER_PROVIDER=agentcore |
| 95 | export AGENTCORE_REGION=us-east-2 |
| 96 | |
| 97 | agent-browser open https://example.com |
| 98 | agent-browser snapshot -i |
| 99 | agent-browser click @e1 |
| 100 | agent-browser close |
| 101 | ``` |
| 102 | |
| 103 | ## Common Issues |
| 104 | |
| 105 | **"Failed to run aws CLI"** means AWS CLI is not installed or not in PATH. Either install it or set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` directly. |
| 106 | |
| 107 | **"AWS CLI failed: ... Run 'aws sso login'"** means SSO credentials have expired. Run `aws sso login` to refresh them. |
| 108 | |
| 109 | **Session timeout:** The default is 3600 seconds (1 hour). For longer tasks, increase with `AGENTCORE_SESSION_TIMEOUT=7200`. |