Skip to content

Codex ignores explicit ambiguity rule and writes unapproved code #61882

Open

Description

@sharpninja

Summary

Codex ignored an explicit instruction to stop and ask when scope was ambiguous, then wrote unapproved product and test code during a planning-only phase.

This is an instruction-following and tool-decision failure, separate from sandbox or approval prompts. A permissive execution policy can allow a tool call, but it should not override request-level constraints.

Environment

  • Surface: Codex IDE extension in Visual Studio
  • Incident date: 2026-11-16
  • Sandbox mode: danger-full-access
  • Approval policy: never
  • Auto-review: none
  • Session ID: 01a1e4f7-6c82-75f2-bbec-11b022f94068

Explicit operating constraint

The session had an explicit standing instruction: when a request is ambiguous in a way that changes scope, state the ambiguity and ask rather than assuming.

The implementation plan had not been approved. The work was still in architecture and planning.

Reproduction

  1. Establish a request-level rule requiring clarification when scope is ambiguous.
  2. Keep the implementation plan unapproved.
  3. Ask Codex to reverse engineer an application into C4/Structurizr and then say: "add the new interfaces and other code definitions for the Reqs management."
  4. Do not explicitly repeat whether those definitions belong in C4 data or source code.
  5. Observe whether Codex asks one clarification question or starts writing code.

Actual behavior

Codex chose the broader, write-capable interpretation without asking. It:

  • created five temporary C# source/test files;
  • patched three shared UI.Core files;
  • invoked a build that failed with 14 errors;
  • stopped only after the user asked, "Why are you writing code? I have not approved the plan, we are still building it."

The user clarified that "add the new interfaces and other code definitions" meant adding them to the C4 data.

Codex later stated: "I assumed the broader interpretation instead of asking."

The temporary code was removed and the three shared files were restored. No product-code diff from the incident remains.

Expected behavior

Before any write or build, Codex should have asked one concise question, for example:

Should the proposed interfaces and code definitions be represented only in the Structurizr/C4 model, or should I also create C# definitions now?

Because the plan was unapproved, the safer interpretation was planning-only. The explicit ambiguity rule should have made clarification mandatory.

Why permission settings are not the root cause

danger-full-access plus approval_policy: never explains why the runtime did not show a system approval prompt. It does not explain or excuse ignoring a request-level instruction to clarify ambiguity. Permission to write is not an instruction to write.

Impact

  • Broke operator trust in explicit scope controls.
  • Added working-tree risk during a planning-only phase.
  • Wasted time and model/tool usage on code creation, a failed build, and cleanup.
  • Forced the operator to interrupt work and restate a standing ambiguity rule.

Requested fix

  • Treat explicit request-level "ask when ambiguous" instructions as hard preconditions for write/exec decisions.
  • Treat an unapproved implementation plan as a tool-use boundary when the task is still planning or architecture work.
  • When two plausible interpretations materially change write scope, ask one concise clarification question before mutating files or starting builds.
  • Distinguish execution authorization from user intent in tool-decision logic.

Evidence

A minimized local JSONL evidence artifact was generated from the session transcript. It contains only five relevant messages, safe target paths, the build result summary, and cleanup verification. The full transcript was intentionally excluded because it contains unrelated private session content. The session ID above should allow internal correlation.

Activity

  1. added
    bug
    extension
    model-behavior
    plan
    on Nov 16, 2026
  2. github-actions commented on Nov 16, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. sharpninja commented on Nov 16, 2026

    @sharpninja
    Author

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

    Not a duplicate. Maybe another instance of a recurring problem, but not a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextensionmodel-behaviorplan

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions