new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

codex/setup

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Codex harness setup packages

The Codex harness adapter requires three packages to be installed: @ai-sdk/harness, @ai-sdk/harness-codex, and @ai-sdk/sandbox-vercel. The adapter bootstraps the Codex bridge dependencies inside the sandbox when the first session starts.

Codex harness import statements

Import codex and createCodex from @ai-sdk/harness-codex. The codex export is equivalent to createCodex() with its default configuration.

Codex harness basic usage example

Example code showing HarnessAgent with Codex harness and Vercel Sandbox. Create agent with createVercelSandbox(runtime: 'node24', ports: [4000]), create session, then stream results from agent.stream() with prompt parameter. Must include error handling and session.destroy().

Codex authentication environment variables

The adapter checks for these environment variables in order: VERCEL_OIDC_TOKEN, AI_GATEWAY_API_KEY, AI_GATEWAY_BASE_URL, OPENAI_API_KEY, CODEX_API_KEY, OPENAI_BASE_URL, OPENAI_ORGANIZATION, and OPENAI_PROJECT. Authentication is resolved from host environment and forwarded to sandbox bridge.

Codex sandbox requirements

Codex requires a network sandbox with at least one exposed port. The example uses @ai-sdk/sandbox-vercel with createVercelSandbox() specifying runtime 'node24' and ports array with at least one port such as [4000].

Codex built-in tool approval limitation

Codex does not currently support built-in tool approval requests. Use permissionMode: 'allow-all' with this adapter. Host-executed AI SDK tool approvals still work.

Codex built-in tool filtering limitation

Codex does not currently support built-in tool filtering. activeTools and inactiveTools can filter host-executed tools, but filtering Codex built-ins such as bash or webSearch will throw an error.

Codex environment variables for authentication

To use the Codex agent, ensure VERCEL_OIDC_TOKEN environment variable is set for Vercel Sandbox, and one of the following is set: AI_GATEWAY_API_KEY, OPENAI_API_KEY, or CODEX_API_KEY.

Give your agent this brain