About
This CLI connection makes OpenAI’s Codex CLI (codex) available in the Sazabi agent’s sandbox. The agent can use it for AI-powered coding tasks. The tool is already installed in the sandbox; connecting it signs the CLI in with your OpenAI API key so the agent can run it non-interactively.
Sazabi also has a separate Codex integration under Settings > Integrations, where you sign in with ChatGPT to hand fixes off to Codex. That connection is independent of this one and does not supply the key the sandbox CLI uses.
Prerequisites
- A Sazabi project.
- An OpenAI API key (
OPENAI_API_KEY). The key is required for non-interactive use, which is how the agent runs the CLI.
Set up in the dashboard
Configure the sandbox in the dashboard under Settings > Sandbox CLIs.1
Find Codex in the catalog
In Settings > Sandbox CLIs, find Codex under Browse sandbox CLIs and choose to connect it.2
Provide credentials
Paste your key into OpenAI API key and save. Sazabi checks the key with OpenAI before saving, and a rejected key saves nothing. Once saved, the CLI is signed in whenever the agent runs.Set up with the CLI
You can also configure the Codex CLI connection with the Sazabi CLI (installed and authenticated; see CLI reference).connect tests the key first, and a failed test saves nothing. To validate the key without saving, run the same command with test in place of connect (the test command also requires the --env flags). To keep the key out of your shell history, pass --env-file <path> instead of --env.
Verify
In a thread, ask the agent to runcodex exec --skip-git-repo-check "Reply with exactly: codex-ok" and show the output. The check passes when the thread shows the reply codex-ok from your OpenAI account. A 401 or sign-in error means the key was not accepted; see Troubleshooting.
Troubleshooting
Command not found: Confirm the Codex CLI connection is enabled for the project under Settings > Sandbox CLIs. Connect or test fails: OpenAI rejected the key, so nothing was saved. Check that you copied the full key and that it is still active on the OpenAI API keys page. Authentication fails after it worked before: The key was probably rotated or revoked. Re-enter the new key under Settings > Sandbox CLIs or runsazabi sandbox-clis connect codex again.
Signed in with ChatGPT but the CLI still fails: The ChatGPT sign-in under Settings > Integrations does not authenticate the sandbox CLI. Add an OpenAI API key here.
Further reading
Working with the agent
Put the connected CLI to work in an investigation thread.
Set up the sandbox
How the sandbox works and its security model.
Sandbox CLIs
Browse the catalog and connect more tools.