shtukbasehub

Harness: Codex

Agents on Codex CLI: running codex exec without a person, with an OS sandbox in the project folder, the network off and no questions; a sensor that the CLI exists.

Packageharness-codexv0.1.15 files

Harness: Codex

Codex CLI is OpenAI's agent CLI (codex). Without a person it works through codex exec: a prompt in (- means from standard input), an answer out.

How to install. npm i -g @openai/codex or brew install codex, then codex login. It works on a ChatGPT subscription (Plus, Pro) or with an OpenAI API key. The package does not read keys.

Models. Those that codex knows on the machine: for example gpt-6-luna (the default in the package), gpt-6.2-sol, gpt-5.5. Not all models work with a ChatGPT subscription: Codex refuses gpt-5.4-mini, for example. The agent's effort goes to model_reasoning_effort.

Command.

codex exec -C <folder> -m <model> -s workspace-write -c sandbox_workspace_write.network_access=false
           -c approval_policy="never" --skip-git-repo-check --ephemeral --color never - < prompt

With network: true, -c web_search="live" is added: codex exec has no --search flag of its own (it exists only on codex without a subcommand and sets the same key).

Rights.

  • An OS sandbox: workspace-write means writing only in the working folder, read-only with access: read. The -s flag overrides sandbox_mode from the user settings.
  • The network in the sandbox is off; network: true turns it on together with the model's web search. Verified on 28.11.2026 (codex-cli 0.166): with access: read and network: true the agent opened https://example.com and answered with the h1 heading.
  • It asks no questions (approval_policy=never): what the sandbox does not allow is not done.
  • The session is not saved (--ephemeral).

Sensor version: codex --version. If there is no CLI, a warning; the check does not fail.