Skip to content

docs(agents): how to drive agent-browser through the auth wall#490

Merged
buremba merged 1 commit into
mainfrom
docs/agents-browser-verification
May 1, 2026
Merged

docs(agents): how to drive agent-browser through the auth wall#490
buremba merged 1 commit into
mainfrom
docs/agents-browser-verification

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 1, 2026

Summary

Adds a "Browser-driven verification (authenticated)" runbook to AGENTS.md after burning a couple of hours during PR #485 reproducing this end-to-end.

Covers:

  • Targets. Local dev backend (Tailscale: `https://buraks-macbook-pro-1.brill-kanyu.ts.net:8443\`) vs prod (`https://app.lobu.ai\`).
  • Secret sourcing. `.env` for local; `kubectl exec ... -- printenv BETTER_AUTH_SECRET` for prod.
  • Session token. SQL `SELECT FROM session`.
  • Cookie signing. HMAC-SHA256 + base64 + URL-encode. (base64url does not validate — that was the trap.)
  • Cookie name rule. `__Secure-better-auth.session_token` whenever baseURL is `https://`.
  • agent-browser flow. `open` → `eval` set cookie → navigate → `wait --text` → `snapshot -i` → `click @ref` → `screenshot`.
  • Footgun. Don't `git switch` while a dev server is running — sibling worktrees can hide files the import graph still references.

Test plan

UI verification past the auth wall needs a signed cookie. Add a
runbook so the next agent doesn't reinvent it (and doesn't fall into
the base64url trap, which silently fails signature validation).

Covers: which target to pick (Tailscale dev URL vs prod), where to
grab the BETTER_AUTH_SECRET (.env vs kubectl exec), how to mint and
sign the cookie correctly, the __Secure- prefix rule, and the typical
agent-browser flow from open through screenshot.

Also notes the dev-server-vs-branch-switch footgun: sibling worktrees
on neighbouring branches can hide files the import graph still
references, breaking server boot.
@buremba buremba merged commit dcd1aca into main May 1, 2026
14 checks passed
@buremba buremba deleted the docs/agents-browser-verification branch May 1, 2026 00:07
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@buremba buremba restored the docs/agents-browser-verification branch May 12, 2026 00:22
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.

2 participants