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.
About the package
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-writemeans writing only in the working folder,read-onlywithaccess: read. The-sflag overridessandbox_modefrom the user settings. - The network in the sandbox is off;
network: trueturns it on together with the model's web search. Verified on 28.11.2026 (codex-cli 0.166): withaccess: readandnetwork: truethe 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.
Actions 2
| Name | What it does | File | When |
|---|---|---|---|
| ask | Run an agent on the Codex harness (without a person, logged to the run log) | actions/ask.ts | shtuk run |
| version | Sensor: the CLI is found and answers --version (looks only) | checks/version.ts | check |
shtuk check runs the checks; shtuk run harness-codex <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.
Package files 4
They go into .shtukbase/packages/harness-codex/; actions run from there.