| name | codex-playwright-sandbox |
|---|---|
| description | Run long autonomous coding tasks through the persistent codex-playwright Docker Sandbox, with Playwright/Chromium and web tooling already available. Use when the user asks to delegate substantial implementation, debugging, refactoring, e2e/browser work, AFK coding, background coding, or long-running autonomous work via sbx, especially with `sbx run codex-playwright -- exec "..."`. |
Use the codex-playwright sandbox for substantial coding work that can run independently, especially frontend, browser, Playwright, or repo-wide tasks. The sandbox is expected to contain Node, pnpm, Playwright, Chromium, Python, and Codex.
Run an autonomous task:
sbx run codex-playwright -- exec "Implement <task>. Read AGENTS.md first, preserve unrelated changes, run relevant tests, and report changed files plus verification."Use this sandbox when the task is:
- Long-running or AFK-friendly.
- Likely to need browser automation, Playwright, Chromium, screenshots, or video smoke tests.
- Large enough that isolating work in a sandbox is safer than doing everything in the current thread.
Do not use it for tiny edits, sensitive credential handling, destructive git operations, or tasks that require continuous user judgment.
- Check whether the sandbox exists:
sbx ls- If missing, ask the user before creating it. Prefer the prebuilt Playwright template:
sbx create --name codex-playwright --template docker.io/lapps/codex-pp:0.1.13 codex .- If creation fails with EROFS, extraction, or
No space left on device, stop and report host disk pressure. The template intentionally includes Chromium and is large.
Every exec prompt should include:
- The concrete objective.
- Instructions to read
AGENTS.mdfirst. - Preserve unrelated user changes.
- Expected verification commands and final report format.
Good default:
sbx run codex-playwright -- exec "In /Users/dima/work/fastapi-02, read AGENTS.md first. Implement <objective>. Preserve unrelated changes. Use rg/git ls-files, not find. Run the narrowest relevant tests, then report changed files, tests run, and any blockers."For autonomous tasks, ask the sandboxed agent to work in phases:
sbx run codex-playwright -- exec "Read AGENTS.md, inspect the code, make a short plan, implement the smallest complete slice, run verification, then continue until the objective is complete or genuinely blocked. Preserve unrelated changes. At the end, summarize changed files and test results."For multi-iteration tasks, include a progress artifact:
sbx run codex-playwright -- exec "Maintain .scratch/codex-playwright-progress.md with decisions, commands, failures, and next steps while completing <objective>."Verify preinstalled browser support:
sbx run codex-playwright -- exec "Run bash scripts/web-sandbox-smoke.sh and summarize whether pnpm used offline cache, Chromium launched, and a video artifact was produced."Use sbx run codex-playwright to reconnect if the agent is interactive or still running.
If a command appears stuck, ask for a status check rather than starting duplicate work:
sbx run codex-playwright -- exec "Report current git status, running processes relevant to the task, and the last completed step. Do not make changes."Inspect sandbox changes from the host before trusting them:
git status --short
git diff --stat- Never ask the sandboxed agent to run
git reset --hard, delete broad directories, or rewrite history unless the user explicitly requested it. - Do not put secrets in the
execprompt. - Do not run multiple autonomous agents against the same worktree unless their file scopes are clearly disjoint.
- Prefer explicit test commands over "run everything" when the repo has expensive suites.
- If the sandbox reports missing auth, use
codex logininside the sandbox or configuresbx secret; do not paste credentials into prompts.