Cross-platform (Windows, macOS, Linux), 100% read-only, offline forensic audit tool for local OpenAI Codex Desktop / CLI (~/.codex/) logs, SQLite databases, and installed client binaries.
Both implementations — zero-dependency Node.js (audit_codex.mjs) and Python 3 ( audit_codex.py) — have full feature parity and inspect only your own local data to verify:
- Quota Compliance: Actual 5-hour (
primary) and 7-day (secondary) subscription usage vs. reasoning anomalies; - Zero-Reasoning Suppression: Frequency of
reasoning_output_tokens = 0(with0reasoning blocks and0encrypted bytes) on flagshiphigh/ultrarequests — including the very first model call immediately after a user prompt; - Quantized
516-Token Cliff (518k - 2Harmonics): Exact discontinuity check around514..518and multi-block harmonics (1034,1552,2070), cryptographically cross-checked againstencrypted_contentciphertext byte lengths; - Silent Default & Summary Flips: Exact version/date timeline of
turn_context.summary(detailed→none), server-pushedconfiguration_updateeffort downgrades, and bundledmodels.jsondefaults inside your installedcodexbinary; - Local Storage & GDPR Hygiene (Arts. 5, 6, 15, 17, 32): SQLite foreign keys and cleanup trigger inspection (
thread_history_1.sqlite), unzeroed deleted SQLite freelist measurement (logs_2.sqlite), unencrypted local microphone retention (dictation-history/), and compiled telemetry flags (codex_accepted_line_fingerprints,disable_analytics).
- 100% Read-Only: Opens every SQLite database strictly in read-only mode (
{ readOnly: true }/?mode=ro). Never writes to, modifies, or deletes anything inside~/.codex/. - 100% Offline: Zero network imports, zero HTTP/DNS/WebSocket calls.
- Zero Credential Access: Never reads
auth.jsonor any token/key files. - Zero PII Output: Never prints user prompts, assistant replies, source code, project names, local file paths, or account emails. Server
response_id(resp_...) samples are omitted by default and only included if you explicitly pass--include-ids.
Clone the repository (or download audit_codex.mjs / audit_codex.py directly):
git clone https://github.com/NeHumorist/codex-local-audit.git
cd codex-local-audit
Uses built-in node:zlib (zstdDecompressSync) and node:sqlite (DatabaseSync). No npm install required.
macOS / Linux:
node audit_codex.mjs
Windows (PowerShell):
node .\audit_codex.mjs
Windows tip (no Node 24 installed globally?): Codex Desktop already ships a local Node 24 runtime on Windows. You can invoke it directly without installing anything:
$node24 = Get-ChildItem "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\*\bin\node.exe" | Select-Object -First 1 -ExpandProperty FullName
& $node24 .\audit_codex.mjs
Python 3.14+ includes compression.zstd in the standard library. On Python 3.10–3.13, run via uv (or install zstandard / system zstd) to decompress .jsonl.zst session files:
# Recommended on Python 3.10–3.13 (auto-provides zstandard in an isolated ephemeral env)
uv run --with zstandard python audit_codex.py
# Or with Python 3.14+ / if zstandard or the `zstd` CLI is already installed
python3 audit_codex.py
| Flag | Description | |---|---| | --codex-dir <dir> | Custom path to .codex directory (default:~/.codex ) | | --binary <path> | Explicitly point to an installed codex /codex.exe binary (auto-detected on Windows, macOS, and Linux when omitted) | | --skip-binary | Skip inspecting the installed client binary | | --json <file> | Save an anonymized machine-readable JSON summary | | --markdown <file> | Save an anonymized shareable Markdown table report | | --include-ids | (Off by default) Include up to 10 sample serverresponse_id (resp_... ) values for<80% -quota zero-reasoning &516 -cutoff events in--json /--markdown outputs (intended for private DSAR / regulator filings) |
# Export a clean anonymized Markdown table to share or compare across platforms
node audit_codex.mjs --markdown my_audit_summary.md
# Export full anonymized JSON + sample server resp_... IDs for a private GDPR/consumer filing
node audit_codex.mjs --json my_evidence.json --include-ids
[1] QUOTA COMPLIANCE: Checks whether your 5h (primary) and 7d (secondary) windows were actually exhausted. If most zero-reasoning or516-cutoff calls occurred whileboth windows were<80%, rate-limit exhaustion is ruled out.[2] REASONING BREAKDOWN: CompareZero%,1stStepZero%(the very first call after a user prompt), andMedRacross months and models. Also reports any server-pushedconfiguration_updatedowngrades (e.g.ultra→xhigh) andmodel_rerouteevents.[3] QUANTIZED 516-TOKEN CLIFF: Look at515vs[516]vs517and harmonics1034,1552,2070(518k - 2). IfMedEncryptedBclamps around~8,000 Bat516andMedBlocksjumps from1.0→2.0immediately at517..700, truncation is physically occurring at the 516-token block boundary.[4] REASONING SUMMARY TIMELINE: Shows whenturn_context.summaryswitched fromauto/detailedtononeand whether that flip happened across identical CLI versions.[5] SQLITE, DICTATION & TELEMETRY HYGIENE: -foreign_keys=0+broken_projection_trigger=trueindicatesthread_realtime_items_projection_cleanuponly cleansthread_realtime_items, leavingthread_turns/thread_itemswithout cascading deletes.
unzeroed_freelistshows how much oflogs_2.sqliteconsists of deleted but unzeroed plaintext SQLite pages.dictation-history/reports count and age of unencrypted local microphone recordings (without reading transcripts).cf_ray_popsreports only 3-letter Cloudflare airport codes (e.g.PRG,FRA,AMS) for regional jurisdiction verification.
[6] INSTALLED CLIENT BINARY CHECK: Reads the official bundledmodels.jsoninside your installedcodexbinary (default_reasoning_level,default_reasoning_summary,supports_ultra) and checks whethercodex_accepted_line_fingerprintsis compiled in and whether anydisable_analyticsflag exists.
Independently reproduced across multiple EU user installations (both macOS and Windows 11 x64, including signed Windows package OpenAI.Codex_26.1111.2228.0_x64__2p2nqsd0c76g0) well within subscription quotas:
- In an audited Windows dataset (215 session rollouts,
34,523deduplicated server calls, Jul–Nov 2026 ,plustier), median usage was34% (5h) and39% (7d), reaching 100% in only0.37%(5h) and0.09%(7d) of calls. - 73.4% (
2,848 / 3,878) of zero-reasoning calls onhigh/ultraoccurred whileboth quota windows were<80%. - On
gpt-6.1-sol::ultra(which officially lists"ultra"insupported_reasoning_levelsinside signedcodex.exe), zero-reasoning on thefirst step after a user prompt jumped from0.0% in Aug–Sep (0 / 238) to40.0%–80.0% (47.6%/151 / 317in October 2026), including 3,000–8,000-token code outputs emitted withreasoning_output_tokens = 0and0reasoning blocks. - On
gpt-6.1-terra::ultrain November 2026 (2,002calls), zero-reasoning reached24.2% with a median of21 reasoning tokens , alongside 4 server-emittedconfiguration_updatedowngrades (ultra→xhigh).
Across 34,523 calls: 514 (16×), 515 (15×), 516 (1,498× — 100× cliff), 517 (2×), 518 (2×), plus exact multi-block harmonics at 1034 (364×), 1552 (98×), and 2070 (41×).
| Bucket ( gpt-6.1-sol::ultra ) | Calls ( N ) | Median Reasoning Blocks | Median encrypted_content | P90 encrypted_content | |---|---|---|---|---| | rTok == 0 | 3,018 | 0.0 | 0 B | 0 B | | rTok 501..515 | 151 | 1.0 | 7,948 B | 8,688 B | | rTok == 516 | 1,467 ( 1,410 single-block) | 1.0 | 8,036 B | 8,504 B | | rTok 517..700 | 653 | 2.0 (block jump) | 10,584 B | 11,736 B | | rTok == 1034 | 352 ( 336 two-block) | 2.0 | 15,748 B | 16,900 B | | rTok == 1552 | 92 ( 85 three-block) | 3.0 | 23,238 B | 25,168 B | | rTok == 2070 | 38 ( 33 four-block) | 4.0 | 32,012 B | 42,876 B |
- Bundled
models.jsoninside signedcodex.exe(offset0x120ae528) ships"default_reasoning_level": "low"and"default_reasoning_summary": "none"forgpt-6-astra,gpt-6.1-sol, andgpt-6.1-terra, despite"supports_reasoning_summaries": true. turn_context.summaryflipped globally fromdetailed(924turns) tonone(466turns) on2026-10-22 across identical CLI builds (0.159.0and0.162.0-alpha.17.2) without a client update.
- Incomplete SQLite Deletion Trigger (
thread_history_1.sqlite):thread_realtime_items_projection_cleanupdeletes only fromthread_realtime_items; all four tables have 0FOREIGN KEY ... ON DELETE CASCADEconstraints. - Unzeroed SQLite Freelist (
logs_2.sqlite): Up to91.8% (66.9 MBof72.9 MB) consists of unzeroed deleted freelist pages (noPRAGMA secure_delete = ON/VACUUM). - Unencrypted Microphone Recordings (
dictation-history/): Rawaudio/webm;codecs=opusvoice chunks and JSON transcripts remain unencrypted on disk without automatic TTL purge (observed retained 54+ days). - Telemetry Without
disable_analytics:POST /backend-api/codex/analytics-events/events(codex_accepted_line_fingerprintscompiled intocodex.exe), OTLP toab.chatgpt.com/otlp/v1/metrics, and localshadow_selection_experimentexecute withdisable_analyticsabsent from the binary.
To maintain strict engineering rigor, this repository explicitly excludes several commonly misinterpreted artifacts observed during community reverse-engineering:
| Artifact / Header | Why It Is Excluded from Degradation / Security Claims | |---|---| | codex.response.receive_wait_ms | Emitted on every handle_output_item_done (reasoning ,message ,function_call ); measures per-item stream channel wait (down to0.0046 ms when buffered),not prompt Time-to-First-Token (TTFT). | | x-codex-safety-buffering-faster-model | Verified in codex.exe (safety_buffering.rs ) andapp.asar : supplies the model slug for the optional UI button*"Retry with a faster model"* during safety buffering — it doesnot silently auto-swap the model mid-turn. | | wham/remote/control | Verified in codex.exe (remote_control_cmd.rs ) andapp.asar : standard Remote Control / device-pairing feature gated by MFA and TPM/device-key challenge —not a "backdoor". (Any GDPR concern is strictly limited to whether enrollment occurred without opt-in consent.) | | shadow_selection_experiment | Verified in ext/skills/src/shadow_selection_experiment/mod.rs : local benchmark comparing 5 lexical/BM25/ngram rankers over installedSKILL.md files — unrelated to model throttling. | | Silent gpt-6-astra -> gpt-6-luna reroutes in Codex | Audited datasets showed 0 model_reroute events. Backgroundgpt-6-luna::low spans in logs stem from hardcoded helper models (ephemeralGenerationModel ,ambientSuggestionsModel ) inapp.asar (worker.js ). |
This repository provides a neutral, read-only local diagnostic tool and reproducible technical observations for educational, research, and consumer-transparency purposes. Users are solely responsible for verifying results on their own local data.
Licensed under the MIT License.
原文来源:github.com