Install
- Node.js 22.12+ (22.13+ for the Cursor provider)
- Chromium for Playwright:
npx playwright install chromium - AI access for recording/healing runs: a subscription you are already
logged in to on the machine (Claude by default; Codex, Google AI Pro/Ultra
and Cursor also work, see AI providers and sign-in), or
an API key:
ANTHROPIC_API_KEYfor Claude,CODEX_API_KEYfor Codex,GEMINI_API_KEYfor Antigravity,CURSOR_API_KEYfor Cursor. Replay-only runs (--no-agent) need no AI access at all.
npm install --save-dev saffron-ai
npx playwright install chromium
Choosing the AI provider
Recording and healing run on an AI subscription you already pay for.
Claude is the default; set provider in saffron.config.json (or pass
--provider for one run) to use another:
provider |
Subscription | Set up once |
|---|---|---|
claude (default) |
Claude Pro/Max, or ANTHROPIC_API_KEY |
a Claude Code login |
codex |
ChatGPT Plus/Pro, or CODEX_API_KEY |
npm install --save-dev "@openai/codex-sdk@>=0.158.0", then npx @openai/codex login |
antigravity |
Google AI Pro/Ultra, or GEMINI_API_KEY (experimental) |
install agy and sign in, then npx saffron login antigravity |
cursor |
Cursor Pro/Business | npm install --save-dev "@cursor/sdk@^1.0.32", then npx saffron login cursor |
npx saffron login checks the configured provider and lists what is
missing. Each provider's sign-in, what saffron login sets up for it,
what Saffron does in its sessions, and how to undo it are in
AI providers and sign-in.
Codex enables its code-mode tool host to reach Saffron's browser tools;
no dependency patch or global Codex setting change is needed. Every tool
call, including each call inside a code-mode batch, passes through the
recording gateway and counts toward maxTurns. Calls past that limit
are refused before reaching the browser.
If the agent stops while an allowed browser call is already running, Saffron
gives it up to five seconds to finish recording. If it does not finish,
Saffron cancels the call, closes its clients and fails the incomplete
recording with a shutdown timeout. Queued calls do not start during shutdown.