Repository navigation
Description
Summary
The GitHub Actions recipe in the CI guide cannot complete a scan on @openai/[email protected]. Every run authenticates, performs billed model work, then fails at the seal step and leaves the output directory empty. The underlying seal failure is #73; this issue is about the CI path specifically, because three things compound there that do not apply to a local run:
- It bills automatically, per push.
on: pull_requestre-triggers on every push to every open PR, so each one silently spends and produces nothing. Five runs cost $3.30 with zero findings. - The recipe has no off switch. Nothing in the documented workflow lets an operator stop the spend without editing and merging a change to the workflow file.
- The SARIF upload step cannot work on many private repos (details below), so even a successful scan would surface nothing through the documented path.
I am not asking for a second fix for #73 — the maintainer response there is clear. This is about the documented CI recipe being unusable as published, and about failing before spending money.
Environment
@openai/[email protected](installed exactly as the guide shows,npm install --prefix "$RUNNER_TEMP/..." --ignore-scripts)- GitHub Actions,
ubuntu-latest(also reproduced on a self-hosted arm64 Linux runner) - Node 22 via
actions/setup-node@v4, Python 3.12 viaactions/setup-python@v5 - Auth:
OPENAI_API_KEYfrom a repository/organization secret,--auth api-key - Private repository, Go + TypeScript monorepo
- No nested sandbox — this is a plain Actions runner, not a Codex desktop session
This last point addresses the caveat in #73 (the maintainer's macOS reproduction ran inside an already-sandboxed Codex command, and so did not independently establish the root cause). On ubuntu-latest there is no outer sandbox, python3 is on PATH at /opt/hostedtoolcache/Python/3.12.13/x64/bin/python3 and reports 3.12.13, and the failure is identical.
Reproduction
The documented workflow, unmodified in substance:
BASE_REVISION="$(git merge-base "$BASE_SHA" "$HEAD_SHA")"
"$CODEX_SECURITY_BIN" scan . \
--diff "$BASE_REVISION" \
--head "$HEAD_SHA" \
--auth api-key \
--output-dir "$SCAN_DIR" \
--max-cost 1 \
--fail-on-severity high \
--json > "$RUNNER_TEMP/codex-security.json"Observed
[00:06] Estimated cost: $0.09775 of $1.00 limit
[00:31] Estimated cost: $0.4639025 of $1.00 limit
codex-security: Could not save the Codex Security scan: scan-manifest.json: expected a regular file inside the scan directory.
codex-security: Partial output was kept at /home/runner/work/_temp/codex-security-state/ci-results.
Exit code 2. --json stdout is 0 bytes. The output directory is empty (find -type f returns nothing).
Five runs, changing one variable at a time:
| # | Variable changed | Runner | Effort | Duration | Billed | Result |
|---|---|---|---|---|---|---|
| 1 | baseline, exactly as documented | self-hosted arm64 | xhigh | 1m38s | $0.81 | seal failure |
| 2 | --output-dir nested inside CODEX_SECURITY_STATE_DIR |
self-hosted arm64 | xhigh | 2m00s | $1.13 | seal failure |
| 3 | diff containing real application code (3 Go files, 185 insertions) | self-hosted arm64 | low | 0m31s | $0.47 | seal failure |
| 4 | PYTHON pinned + --python passed |
self-hosted arm64 | low | 0m30s | $0.43 | seal failure |
| 5 | ubuntu-latest (GitHub-hosted x64) |
ubuntu-latest | low | 0m33s | $0.46 | seal failure |
Total: $3.30, no successful scan.
Ruled out along the way, in case it saves anyone else the money:
- Credentials — auth succeeds and every run is billed.
--output-dirplacement (run 2) — nesting it insideCODEX_SECURITY_STATE_DIR, which is where it defaults perscan --help, changes nothing.- Diff content (run 3) — a real Go diff fails identically to a docs-only diff. Consistent with Track remaining missing-artifact failures during scan completion #73 reproducing on a
print('hi')repo. - Reasoning effort (runs 3–5) —
--effort lowfails the same way asxhigh, at roughly half the cost. - Runner / architecture (run 5) — GitHub-hosted x64 with working Python fails identically to self-hosted arm64.
- Capability preflight — every
security_diff_scanrequirement inpreflight/capability-profiles.tomliswarnorsuggest; none can block.
Two smaller problems in the same recipe
1. --output-dir is not needed and is a footgun. scan --help documents the default as "Codex Security state; CODEX_SECURITY_STATE_DIR", so the flag in the CI recipe only adds a way to get the path wrong. Consider dropping it from the guide, or documenting that it must be a path the scan agent can write.
2. The SARIF upload step silently cannot work on private repos without GitHub Advanced Security. github/codeql-action/upload-sarif returns
403 Code Security must be enabled for this repository to use code scanning.
on a private or internal repository without Code Security. The guide presents SARIF upload as the way findings surface, with no mention of that prerequisite. Worth a note, since the alternative (job summary plus an uploaded artifact) is easy but has to be discovered.
Suggested direction
The maintainer conclusion in #73 already covers the important half:
The fix should restore authoritative artifact production and fail before model execution whenever that capability is unavailable.
For the CI recipe specifically, I would add:
- Verify the agent can write its draft artifacts before the first billed turn. In CI nobody is watching, and the current behaviour converts a tool defect directly into recurring spend.
- Make
Partial output was kept at <dir>conditional on the directory being non-empty. It is currently printed when nothing was written, which sends you looking for partial results that do not exist. - Show a cost kill switch in the guide — a repository variable gate costs three lines and means an operator can stop spending without merging a workflow change.
Happy to supply full run logs if useful.
Activity
mldangelo-oai commentedon Aug 3, 2026
Closed as a duplicate of #73; GitHub-hosted runner-specific behavior is also tracked in #191. This does not mean the missing-artifact failures or the private-repository SARIF prerequisite have been resolved. Thank you for the careful CI reproduction and for calling out the billing impact.