Communitygithub.com

AWS Bedrock AgentCore

在 AWS Bedrock AgentCore 雲端瀏覽器上執行 agent-browser。當使用者想要使用 AgentCore、在 AWS 上執行瀏覽器自動化、使用 AWS 憑證的雲端瀏覽器,或需要由 AWS 基礎設施支援的受管瀏覽器工作階段時使用。觸發詞包括「使用 AgentCore」、「在 AWS 上執行」、「使用 AWS 的雲端瀏覽器」、「Bedrock 瀏覽器」、「AgentCore 工作階段」,或任何需要 AWS 託管瀏覽器自動化的任務。

AWS Bedrock AgentCore 是什麼?

這項技能讓 AI 代理能夠利用 AWS Bedrock AgentCore 服務,在雲端託管的瀏覽器上執行瀏覽器自動化。所有標準的 agent-browser 指令(例如 open、snapshot、click、screenshot、close)在雲端環境中運作方式完全相同,無需修改任何工作流程。使用者只要具備有效的 AWS 憑證即可使用,系統會自動從環境變數或 AWS CLI 解析憑證,支援 SSO、IAM 角色和具名設定檔。 主要功能包括:透過 `AGENTCORE_PROFILE_ID` 使用持久性瀏覽器設定檔,以跨工作階段保持 Cookie 和 localStorage 狀態;透過 Live View URL 即時監控瀏覽器工作階段;以及透過環境變數設定 AWS 區域、瀏覽器 ID 和工作階段逾時。使用者可以將 `AGENT_BROWSER_PROVIDER` 設為 `agentcore`,避免每個指令都要指定提供者。常見問題包含 AWS CLI 未安裝、SSO 憑證過期和工作階段逾時,這些問題都有對應的解決方法。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/vercel-labs/agent-browser/tree/main/skill-data/agentcore

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

AWS Bedrock AgentCore 是做什麼的?

在 AWS Bedrock AgentCore 託管的雲端瀏覽器工作階段上執行 agent-browser。所有標準的 agent-browser 指令運作方式完全相同;唯一的差別在於瀏覽器執行的位置。

設定

憑證會自動解析:

  1. 環境變數(AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY,選擇性 AWS_SESSION_TOKEN)
  2. AWS CLI 備援(aws configure export-credentials),支援 SSO、IAM 角色和具名設定檔

如果使用者已經有可用的 AWS 憑證,則不需要額外設定。

核心工作流程

#在 AgentCore 雲端瀏覽器上開啟頁面
agent-browser -p agentcore open https://example.com

#其餘部分與本機 Chrome 相同
agent-browser snapshot -i
agent-browser click @e1
agent-browser screenshot page.png
agent-browser close

環境變數

變數說明預設值
AGENTCORE_REGIONAWS 區域us-east-1
AGENTCORE_BROWSER_ID瀏覽器識別碼aws.browser.v1
AGENTCORE_PROFILE_ID持久性瀏覽器設定檔(Cookie、localStorage)(無)
AGENTCORE_SESSION_TIMEOUT工作階段逾時(秒)3600
AWS_PROFILE用於憑證解析的 AWS CLI 設定檔default

持久性設定檔

使用 AGENTCORE_PROFILE_ID 跨工作階段持久化瀏覽器狀態。這對於維持登入工作階段非常有用:

#第一次執行:登入
AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "[email protected]"
agent-browser fill @e2 "password"
agent-browser click @e3
agent-browser close

#後續執行:已通過驗證
AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/dashboard

即時檢視

工作階段啟動時,AgentCore 會在 stderr 輸出一個 Live View URL。在瀏覽器中開啟它,即可從 AWS 主控台即時監控工作階段:

Session: abc123-def456
Live View: https://us-east-1.console.aws.amazon.com/bedrock-agentcore/browser/aws.browser.v1/session/abc123-def456#

區域選擇

#預設值:us-east-1
agent-browser -p agentcore open https://example.com

#指定區域
AGENTCORE_REGION=eu-west-1 agent-browser -p agentcore open https://example.com

憑證模式

#明確指定憑證(CI/CD、腳本)
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
agent-browser -p agentcore open https://example.com

#SSO(互動式)
aws sso login --profile my-profile
AWS_PROFILE=my-profile agent-browser -p agentcore open https://example.com

#IAM 角色 / 預設憑證鏈
agent-browser -p agentcore open https://example.com

使用 AGENT_BROWSER_PROVIDER

透過環境變數設定提供者,避免每次指令都加上 -p agentcore:

export AGENT_BROWSER_PROVIDER=agentcore
export AGENTCORE_REGION=us-east-2

agent-browser open https://example.com
agent-browser snapshot -i
agent-browser click @e1
agent-browser close

常見問題

「執行 AWS CLI 失敗」 表示 AWS CLI 未安裝或不在 PATH 中。請安裝它,或直接設定 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY。

「AWS CLI 失敗:... 執行 'aws sso login'」 表示 SSO 憑證已過期。執行 aws sso login 以重新整理憑證。

工作階段逾時: 預設值為 3600 秒(1 小時)。對於較長的任務,請使用 AGENTCORE_SESSION_TIMEOUT=7200 增加時長。

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to

vercel-labs/derive-client

Reverse-engineer a website's internal API by recording browser traffic into a HAR file, then generate a standalone client or CLI that calls the endpoints directly, with no browser needed after the first recording. Use when asked to "derive a client", "build a CLI for <site>", "reverse engineer this site's API", "record network requests", "turn this site into an API", or when the same site will be automated repeatedly and direct HTTP calls would beat driving the browser every time.

vercel-labs/dogfood

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.

vercel-labs/electron

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.

vercel-labs/protected-vercel-deployments

Access and test Vercel deployments protected by Vercel Authentication, SSO, or Deployment Protection with agent-browser. Use when a preview or production URL redirects to a Vercel login page, returns a protection 401 or 403, or needs short-lived Trusted Sources OIDC authentication instead of a static bypass secret or public exception.

vercel-labs/slack

Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include "check my Slack", "what channels have unreads", "send a message to", "search Slack for", "extract from Slack", "find who said", or any task requiring programmatic Slack interaction.

vercel-labs/vercel-sandbox

Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "agent-browser in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.

vercel-labs/webmcp-gen

Build and validate experimental WebMCP tools for an existing web page. Use when an agent needs to expose a site's real workflows as page tools, create webmcp.init.js, define deterministic checks, or compare WebMCP with accessibility-tree automation.

相關技能