openai / openai/codex

`codex debug models` exposes full model instruction templates by default

Open
#43,705 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of Codex?

Observed on Windows while diagnosing model availability. The host ChatGPT/Codex app About dialog reports version 26.721.41059 (released July 24, 2026). The exact PATH-resolved CLI version was not separately captured before filing.

Platform

Windows x64.

What issue are you seeing?

codex debug models and codex debug models --bundled emit the complete model catalog objects, including fields such as:

{
  "model_messages": {
    "instructions_template": "<large internal instruction template>"
  },
  "base_instructions": "<large internal instruction text>"
}

The output is extremely large and includes full agent instruction templates alongside ordinary model metadata such as slug, display name, reasoning levels, visibility, and context-window information.

This is a share-safety / diagnostic-output footgun. A user trying to diagnose model availability can reasonably expect debug models to print model-catalog metadata and may paste the result into an issue, support conversation, or public forum without realizing that the same JSON also contains the full embedded instruction text.

I hit this while troubleshooting why a model was available on macOS but absent on Windows. The diagnostic command was useful, but it unexpectedly produced hundreds of KB of model configuration/instruction content that was unrelated to the availability question.

No prompt contents are included in this report.

Steps to reproduce
  1. Run:
codex debug models --bundled
  1. Inspect one returned model object.
  2. Observe that the object contains model_messages.instructions_template and/or base_instructions with the complete embedded instruction text.
  3. Run:
codex debug models
  1. Observe the same class of fields in the server-resolved model catalog.
Expected behavior

The default output should be safe and practical to share for routine diagnostics.

For example, codex debug models could omit or redact instruction-bearing fields by default and return only model metadata such as:

  • slug / display name
  • visibility / availability
  • reasoning levels
  • context-window metadata
  • tool/capability flags
  • catalog/source information

Full instruction-bearing model objects could remain available behind an explicit opt-in such as:

codex debug models --full

or:

codex debug models --include-instructions

At minimum, the command could print a warning when instruction fields are included.

Why this matters

debug models is already used in public Codex bug reports for model-picker, cache, rollout, and catalog diagnostics. The current default makes accidental disclosure easy because the sensitive/high-noise fields are embedded inside otherwise normal diagnostic JSON.

A redacted-by-default output would also make the command dramatically easier to inspect and attach to bug reports.

Related issues / precedent
  • #34869 requests share-safe redaction for /status because diagnostic output is commonly screenshotted/shared.
  • #35706 proposes an explicit --full opt-in for exposing a complete prompt snapshot from debug prompt-input; a similar explicit opt-in would be a good fit here.

This report is specifically about the default output shape of debug models, not model entitlement or picker behavior.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the codex debug models and codex debug models --bundled entry points, reproducing their current JSON output. Ensure the default output contains share-safe model metadata without full instruction-bearing fields, while preserving any complete output behind an explicit opt-in such as --full; verify both commands afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
60/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.