Communitygithub.com

AWS Bedrock AgentCore

在 AWS Bedrock AgentCore 云浏览器上运行 agent-browser。当用户需要使用 AgentCore、在 AWS 上运行浏览器自动化、使用 AWS 凭证访问云浏览器,或者需要由 AWS 基础设施支持的管理浏览器会话时使用。触发词包括“使用 agentcore”、“在 AWS 上运行”、“带有 AWS 的云浏览器”、“bedrock 浏览器”、“agentcore 会话”或任何需要 AWS 托管浏览器自动化的任务。

AWS Bedrock AgentCore 是什么?

该技能允许用户在 AWS Bedrock AgentCore 托管的云浏览器会话上运行 agent-browser。所有标准的 agent-browser 命令(如打开页面、截图、点击元素)均保持不变,仅浏览器运行位置变为 AWS 云端。它自动通过环境变量或 AWS CLI 解析凭证,支持 SSO、IAM 角色和命名配置文件。用户还可以利用 `AGENTCORE_PROFILE_ID` 持久化浏览器状态(如 cookies 和 localStorage),实现跨会话保持登录状态。此外,它还提供实时查看 URL,使用户可以从 AWS 控制台实时监控浏览器会话。

兼容平台~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持久化浏览器配置文件(cookies,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 会将实时查看 URL 打印到 stderr。在浏览器中打开它,即可从 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

常见问题

“Failed to run aws CLI” 表示 AWS CLI 未安装或不在 PATH 中。请安装它,或直接设置 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY。

“AWS CLI failed: ... Run '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.

相关技能