Skip to content

autobrowse: autonomous email inbox for signup/login/MFA tasks#119

Open
aq17 wants to merge 1 commit into
mainfrom
autobrowse-agentmail-inbox
Open

autobrowse: autonomous email inbox for signup/login/MFA tasks#119
aq17 wants to merge 1 commit into
mainfrom
autobrowse-agentmail-inbox

Conversation

@aq17
Copy link
Copy Markdown
Contributor

@aq17 aq17 commented May 26, 2026

Summary

  • Lets an autobrowse loop provision a throwaway inbox so the inner agent can register accounts, log in, and complete email verification — without the user ever supplying their own email or touching AgentMail.
  • New scripts/inbox.mjs CLI: create / wait-otp / wait-link / latest / release. It talks to the browse.sh /api/skills/inboxes endpoint (which owns the AgentMail key); the agent only ever sees the inbox address.
  • evaluate.mjs gains --inbox-email, injects an "Agent Inbox" section into the system prompt, and broadens the command allowlist so the agent can shell out to inbox.mjs.
  • SKILL.md documents the opt-in provision step, mandatory release/cleanup, a graduation note (inbox is loop-only — graduated skills expect the end user's own credentials), and the 3-concurrent-loop free-tier cap.

Verification coverage

Flow Support
Numeric OTP wait-otp (default 4–8 digits)
Alphanumeric code wait-otp --regex
Click / magic link wait-link [--match]browse open
Raw inspection latest

Test plan

  • CLI syntax + guard paths (missing state, missing webhook secret, unknown command)
  • Live local end-to-end against a claimed AgentMail org: create → wait-otp (extracted real code) → wait-link (extracted href URL) → release; no leaked inboxes
  • include_spam=true on polling — verification emails to a fresh inbox frequently get spam-flagged

Requires the inbox endpoint from browserbase/browse.sh#151 and BROWSE_SH_WEBHOOK_SECRET in the environment.

🤖 Generated with Claude Code


Note

Medium Risk
Expands inner-agent shell execution and adds authenticated remote inbox API calls; secrets stay in env headers, but misconfiguration or parallel runs can hit inbox limits or leak task state in .inbox.json until release.

Overview
Adds throwaway email inboxes for autobrowse training loops that need signup, login, or MFA—without exposing AgentMail credentials locally.

New scripts/inbox.mjs talks to browse.sh (/api/skills/inboxes) using BROWSE_SH_WEBHOOK_SECRET: create, wait-otp, wait-link, latest, and release, with per-task state in .inbox.json (gitignored). evaluate.mjs gains --inbox-email, injects an Agent Inbox system-prompt section, and widens the execute allowlist to node …/inbox.mjs (path-resolved) alongside browse.

SKILL.md, example-task.md, and .env.example document opt-in provisioning, passing the address on every run, mandatory cleanup, graduation rules (inbox is loop-only), and a 3 concurrent inbox cap.

Reviewed by Cursor Bugbot for commit 2087aca. Bugbot is set up for automated code reviews on this repo. Configure here.

Lets an autobrowse loop provision a throwaway inbox so the inner agent can
register accounts and complete email verification. A new scripts/inbox.mjs CLI
(create / wait-otp / wait-link / latest / release) talks to the browse.sh
inbox endpoint, which owns the AgentMail key — the agent only ever sees the
address. evaluate.mjs gains --inbox-email, injects the inbox into the system
prompt, and allows the agent to shell out to inbox.mjs. SKILL.md documents the
opt-in provision/release steps, graduation note (inbox is loop-only), and the
3-concurrent-loop free-tier cap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2087aca. Configure here.

}
}

function buildSystemPrompt(strategy, traceDir, browseEnv) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inbox wait killed by timeout

High Severity

Long-running inbox.mjs wait-otp and wait-link calls run through executeCommand with a fixed 30s execFileSync timeout, while the system prompt tells the agent to use --within 60. Polling is cut off early, so verification mail that arrives after 30 seconds fails even though the inbox helper would still be waiting.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2087aca. Configure here.

fs.mkdirSync(path.dirname(file), { recursive: true });
fs.writeFileSync(file, JSON.stringify({ email, inbox_id }, null, 2));
// The agent reads stdout — print only the address.
console.log(email);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recreate leaves orphan inboxes

Medium Severity

Running inbox.mjs create when .inbox.json already exists provisions a new remote inbox and overwrites local state without deleting the previous inbox_id. That contradicts SKILL.md’s claim that stale inboxes are swept on the next create, and consumes slots toward the three-inbox org limit.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2087aca. Configure here.

const systemPrompt = buildSystemPrompt(strategy, traceDir, browseEnv);
const inboxEmail = getArg("inbox-email");
const inboxSection = buildInboxSection(inboxEmail, workspace, taskName);
const systemPrompt = buildSystemPrompt(strategy, traceDir, browseEnv, inboxSection);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task placeholder never substituted

Medium Severity

SKILL.md and example-task.md say task authors can use {{inbox_email}}, but evaluate.mjs sends task.md to the model unchanged when --inbox-email is set. The user message can still contain the literal placeholder instead of the provisioned address.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2087aca. Configure here.

@aq17 aq17 requested review from shrey150 and shubh24 May 27, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant