Skip to content
Get started

AI providers and sign-in

Saffron needs an AI agent only to record a scenario the first time and to heal it when your app changes. Every other run replays at zero tokens and needs no AI at all. The agent runs on an AI subscription you already pay for: Claude by default, or Codex, Google AI (through Antigravity) or Cursor. This page shows how to choose one, how each one signs in, and what saffron login does for each.

At a glance

provider Subscription Saffron runs it through Set up once Status
claude (default) Claude Pro or Max, an API key, or Claude on Amazon Bedrock or Google Vertex AI the Claude Agent SDK, bundled with Saffron a Claude Code login (or Bedrock's or Vertex's environment variables) verified; Bedrock and Vertex not yet verified live
codex ChatGPT Plus or Pro, or an OpenAI API key OpenAI's @openai/codex-sdk install the SDK, then npx @openai/codex login (or set CODEX_API_KEY) verified (macOS and Linux), the key too
antigravity Google AI Pro or Ultra, or a Gemini API key Google's Antigravity CLI, agy install agy, sign in (or set GEMINI_API_KEY), then npx saffron login antigravity verified, experimental; the key not yet verified live
cursor Cursor Pro or Business Cursor's @cursor/sdk install the SDK, then npx saffron login cursor not yet verified live

Choose one in saffron.config.json:

{ "provider": "codex" }

or for a single run:

npx saffron run --provider antigravity

Each provider runs through its vendor's official client, on the login that client keeps on your machine, the way the Claude provider runs Claude Code through the Claude Agent SDK. Saffron never reads or copies those logins.

saffron login: check and set up

npx saffron login              # the provider in saffron.config.json
npx saffron login antigravity  # or name one

It tells you whether the provider can record and heal on this machine, and lists what is missing if not. It exits 0 when all is set (Codex: ready to record and heal.) and 1 with the list otherwise. For two providers it also does the one-time setup:

  • saffron login cursor opens Cursor's sign-in in your browser.
  • saffron login antigravity allows Saffron's tools in agy's settings.

Run it again whenever you like: it leaves anything already set up as it is. saffron run shows the same list as a note before a run that may need the agent. Replay-only runs (--no-agent) never need a provider.

Claude (the default)

Runs through the Claude Agent SDK, which ships with Saffron and runs Claude Code on your login.

Sign in, one of:

  • Log in to Claude Code on this machine: install it (npm install -g @anthropic-ai/claude-code), run claude, then /login with your Claude Pro or Max account.
  • Or set ANTHROPIC_API_KEY=sk-ant-... (console.anthropic.com, API keys).
  • Or use Claude on Amazon Bedrock or Google Vertex AI (below).

Check with npx saffron login claude.

Good to know. On a subscription the report shows your 5-hour plan window before and after the run, and prices the run at API rates for comparison. Saffron keeps your claude.ai connectors (Gmail, Figma and the like) out of its sessions: they would add hundreds of tool definitions to every model call.

Claude on Amazon Bedrock

If your team already runs its AI agents on Amazon Bedrock, Saffron can record and heal on the same AWS account. It stays the claude provider: Claude Code, which the Claude Agent SDK runs, calls Claude models on Bedrock instead of Anthropic's API. Only Claude models work this way; other Bedrock models (Llama, Nova, Mistral and the like) cannot drive Saffron.

  1. In AWS. In the Bedrock console, enable access to the Claude models you want, in your region. Give the user or role that runs Saffron bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream and bedrock:ListInferenceProfiles.

  2. In the shell or pipeline that runs Saffron, set:

    export CLAUDE_CODE_USE_BEDROCK=1
    export AWS_REGION=us-east-1      # required: not read from ~/.aws/config
    export AWS_PROFILE=my-profile    # or access keys, or the machine's role
    

    Credentials come from the usual AWS chain. Set these as real environment variables: Saffron's sessions do not read Claude Code's ~/.claude/settings.json, so an env block there has no effect.

  3. In saffron.config.json, pin the model to a Bedrock inference profile id for a Claude model, copied from the Bedrock console, so every recording is made on the same model:

    { "provider": "claude", "model": "<Bedrock inference profile id>" }
    
  4. Check with npx saffron login claude, then run as usual.

In CI, let the job assume an IAM role (on GitHub Actions through OIDC with aws-actions/configure-aws-credentials) and set CLAUDE_CODE_USE_BEDROCK and AWS_REGION in the job. No Anthropic key or long-lived AWS secret is stored.

Usage is billed to your AWS account. The report's cost is an estimate at Anthropic's API prices and shows no plan window; your AWS bill is the real figure. Bedrock support comes from the Claude Agent SDK and has not yet been verified live with Saffron, so try one scenario before moving a whole suite.

Google Vertex AI works the same way: set CLAUDE_CODE_USE_VERTEX=1, CLOUD_ML_REGION and ANTHROPIC_VERTEX_PROJECT_ID, sign in with Google Cloud credentials, and pin a Vertex model id in model.

Codex (ChatGPT Plus or Pro)

Runs through OpenAI's Codex SDK, which runs the Codex CLI on your ChatGPT login. macOS and Linux only for now.

Set up:

  1. npm install --save-dev "@openai/codex-sdk@>=0.158.0". It brings the Codex CLI with it (about 300 MB), so only projects that use Codex install it.
  2. npx @openai/codex login, and sign in with ChatGPT. Use the full name: npx codex alone runs an unrelated npm package when OpenAI's is not installed in the project. If you already use Codex on this machine, you are signed in; a login kept in the keyring works too.
  3. npx saffron login codex to check.

In a session Saffron runs Codex without your ~/.codex/config.toml: your own MCP servers, plugins, hooks and model defaults stay out, and only its login settings are kept. It saves no session files, and the agent can use only Saffron's browser and recording tools. To do this Saffron keeps a two-line wrapper script in ~/.cache/saffron/. Codex's code-mode tool host is enabled so models using it can reach these same tools. Each nested call still passes through the recording gateway. The gateway counts calls across both the browser and recording servers, refuses calls past maxTurns before dispatch, and interrupts Codex. Shell access, extra browsers, subagents and the user's own integrations stay disabled. No dependency patch or global Codex setting change is needed. On interruption, Saffron refuses queued calls and waits for started browser calls to finish recording before finalizing the session and closing their clients. The browser may already have performed an action even if the agent stopped waiting for its reply.

Models are Codex's own, for example "model": "gpt-5.5"; unset, Codex picks its default.

With an API key instead (a CI machine, or no ChatGPT plan): set CODEX_API_KEY to an OpenAI API key (platform.openai.com, API keys); OPENAI_API_KEY works too when CODEX_API_KEY is not set. Runs then bill your OpenAI API account. A ChatGPT login on the machine wins over a key, so a key set for other tools never moves your runs off your plan. Saffron asks Codex whether there is a login (codex login status) only when the first session starts, and only when a key is set; only a clear "Not logged in" counts, so a check that fails for another reason keeps the login. The run's first line says how sessions will sign in ("signs in with Codex login if there is one, else API key (CODEX_API_KEY)"), and the first session says which one it used ("Codex: signed in with API key (CODEX_API_KEY)"); a key stored by codex login --with-api-key reads "API key stored by codex login" (a session run with no key set reads "Codex login"), and bills your API account too. npx saffron login codex says which sign-in sessions will use. An expired or broken login still counts as a login: the session it fails says so, and to sign in again, or sign out (npx @openai/codex logout) to use the key. A forced_login_method in your ~/.codex/config.toml decides alone: "chatgpt" never takes a key, "api" always does (a key in the environment, else one stored by codex login --with-api-key; with neither, npx saffron login codex says the key is missing), and a refused session names that setting. The key is handed to Codex alone and never written into a recording, report or error.

Sign out with npx @openai/codex logout.

Limits. Your ChatGPT plan's usage limits apply: when you reach one, the scenario is red with Codex's message and the time it resets (a recording is counted as blocked by the agent's provider, not failed in the app). On Windows the provider refuses to start, because it cannot keep your own Codex config out of the session there.

Antigravity (Google AI Pro or Ultra)

Runs through Google's Antigravity CLI, agy, headless, on its own login. Gemini CLI stopped serving Google AI Pro and Ultra accounts in June 2026, which is why the Google provider uses Antigravity.

Experimental, with a risk to know about. Google's Antigravity terms forbid reaching Antigravity through third-party tools with your login. Saffron only runs Google's own agy binary, headless, the way Google's headless documentation describes, but no statement from Google covers a tool doing that on your behalf. Use this provider knowing that risk to your Google account.

Set up:

  1. Install agy: curl -fsSL https://antigravity.google/cli/install.sh | bash. It lands in ~/.local/bin/agy.

  2. Run agy once and sign in with your Google AI Pro or Ultra account.

  3. npx saffron login antigravity. It checks that agy is installed and signed in (by listing your models, which costs no quota), then adds two rules to ~/.gemini/antigravity-cli/settings.json:

    { "permissions": { "allow": ["mcp(saffron_browser/*)", "mcp(saffron_tools/*)"] } }
    

    Headless agy cannot ask you for permission, so without these rules it refuses every call to Saffron's tools. They allow Saffron's two tool servers and nothing else. The rules are global to agy: a repository whose own .agents/mcp_config.json names a server saffron_browser or saffron_tools would run its tools without a prompt in your own agy sessions too, so treat those two names as reserved. The rest of the file stays as it was; a file that is not valid JSON is left alone and reported instead. Until the rules are in, recording and healing refuse to start and tell you to run this.

In a session Saffron works in a throwaway folder: an agent carrying Saffron's instructions, Saffron's two tool servers, and a hook that allows only calls to those servers and reading their tool descriptions. Shell, files, web search, agy's own browser and any MCP server of yours are denied. agy's own permissions are the second fence, and agy runs terminal commands in its sandbox besides.

With an API key instead (a CI machine, or no Google AI plan): set GEMINI_API_KEY to a Gemini API key (aistudio.google.com, API keys); GOOGLE_API_KEY works too when GEMINI_API_KEY is not set. Runs then bill your Gemini API account. A Google login in agy wins over a key: when the first session starts, Saffron lists your models without the key, and only agy asking you to sign in counts as no login (a timeout or a network error keeps the login). The first session says which one it used, and so does npx saffron login antigravity. An expired login still counts as a login: the session it fails says so, and to sign in again. To use the key even beside a login (API billing, or a login that keeps expiring), set "antigravityApiKey": true in saffron.config.json: sessions then take the key without asking agy, in every command (saffron author too), and npx saffron login antigravity and the run's first line say so, or that the key is missing; with no key set, no session starts (none falls back to the login). Only true turns it on; a refused login's message names the setting. On a CI machine, install agy and run npx saffron login antigravity once in the job, with the key set, before recording: it allows Saffron's tools and lists your models with the key. Not yet verified live with a key.

Models are agy's, listed by agy models: for example "model": "gemini-3.8-flash-high" or "gemini-3.1-pro-high". Unset, agy picks its default.

Undo by removing the two rules from ~/.gemini/antigravity-cli/settings.json.

Good to know. agy still starts your own global MCP servers in each session (their tools are denied to the agent), and each Saffron session appears in agy's conversation history. agy has no ephemeral mode: it keeps every conversation, and the prompt it received, under ~/.gemini/antigravity-cli/. That prompt holds the resolved values of the {env:VAR} secrets a scenario uses, so on a shared machine clear that history after recording, or record with Claude or Codex, which keep nothing.

Cursor (Pro or Business)

Runs through Cursor's SDK: the agent loop runs on Cursor's servers under your plan, and the tools run on your machine. It needs Node.js 22.13 or newer. Not yet verified with a live recording.

Set up:

  1. npm install --save-dev "@cursor/sdk@^1.0.32".
  2. npx saffron login cursor. Cursor's SDK does not use the Cursor app's login, so this opens a sign-in page in your browser once. It stores a key for your account in ~/.cursor/sdk/auth.json (valid for 90 days by default), and runs bill your Cursor plan. A CURSOR_API_KEY in the environment works instead.
  3. Run npx saffron login cursor again to check: it says when you are already signed in.

In a session the agent can use only Saffron's tools, your own Cursor rules and MCP settings are left out, and the agent's records go to a throwaway folder.

Models are Cursor's, for example "model": "composer-2.5" or "auto"; unset, auto.

Sign out by deleting ~/.cursor/sdk/auth.json and revoking the key in your Cursor dashboard.

What every provider shares

  • The same recordings. The agent reaches the browser and Saffron's tools through Saffron, which records every call the same way whatever the provider. A recording made with Codex replays at zero tokens and heals like one made with Claude, and every recording is proof-replayed before you review it.
  • Only Saffron's tools. No provider's agent may run shell commands, edit files or search the web. Playwright's browser_run_code_unsafe, which would run code on your machine, is hidden from all of them; browser_evaluate, which runs inside the page, stays. The tools that remain are checked call by call: navigation opens web pages only (http(s) and about:blank, no file:, view-source: or data: URLs), uploads take files inside the project and never dotfiles such as .env, and the filename option, which would make a snapshot or a response body overwrite a project file, is dropped. Any file the vendor's tools produce lands in a temp folder. So are the tools a recording cannot replay (going back, reloading, resizing, dropping files, and what PLAYWRIGHT_MCP_CAPS adds), whatever your environment turns on.
  • Models belong to the provider. model and healModel take the configured provider's model names. A run switched with --provider uses that provider's defaults, and says so, unless --model names one.
  • Failures and stops. A recording the provider ended (a sign-in that expired, the network, a usage limit) is red, counted as blocked by the agent's provider rather than failed in the app. Saffron exiting (Ctrl-C, a cancelled CI job) stops a running Codex or Antigravity session with it. maxSessionMinutes makes a session's tools refuse once it has gone on that long; one still going two minutes later (waiting on a sign-in, a stalled model call) is stopped, and counts as failed.
  • Cost. Claude reports a price. Codex, Antigravity and Cursor report tokens only, so the report says "cost not reported by the provider" rather than showing $0.

Troubleshooting

You see Do this
note: the Codex agent is not set up here before a run Run npx saffron login codex and follow its list.
Antigravity cannot start here: Saffron's tools allowed in agy, once: npx saffron login antigravity Run that command once.
agy could not list your models Run agy and sign in again.
Codex: You've hit your usage limit ... Wait for the reset time in the message, or record with another provider, for example --provider claude.
Cursor: ... Invalid User API Key. Sign in once with: npx saffron login cursor Run it: the key is missing or has expired.
the cursor provider needs Node.js 22.13 or newer Upgrade Node, or use another provider.
the codex provider is not available on Windows yet Record on macOS or Linux, or use another provider.
note: model and healModel in saffron.config.json name Claude models; this Codex run uses its default models Expected with --provider. Pass --model to choose one.