Skip to content

Preserve completed Standard scan work when a policy refusal stops the scan #56

Open

Description

@LSQzzx

Summary

Standard scans have stopped after substantial discovery or validation work with a cybersecurity-policy refusal, leaving users without a usable report or a clear recovery path. Some saved records still reported phase: preflight despite evidence that review had progressed further.

Reported behavior

Reports in this thread include CLI 0.1.1 and 0.1.6 scans using stored ChatGPT credentials. Refusals occurred after roughly 25–78 minutes of work.

One 0.1.6 report recorded completed discovery and the start of candidate validation, but retained only discovery artifacts. No canonical scan-manifest.json, findings.json, coverage.json, or report.md was produced. The saved state was failed while the recorded phase remained preflight.

The diagnostic was:

This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. To get authorized for security work, join the Trusted Access for Cyber program: https://chatgpt.com/cyber

These are historical observations, not a fresh reproduction on the current release.

Current status

#236 added Trusted Access status reporting when the runtime supplies it. That signal is advisory: it does not guarantee an entitlement check before spend or prevent a later policy refusal. Later result-recovery work also does not, by itself, demonstrate that every refusal path here now retains usable results.

Expected behavior

  1. Report available access information before expensive work and distinguish an unavailable signal from a denial.
  2. Preserve supported completed findings and review evidence when a refusal stops the scan.
  3. Record the actual execution state, observed phase, usage, and unfinished work accurately.
  4. Explain which saved work can be inspected or resumed and which operation was refused.
  5. Keep a worker-level refusal distinct from a coordinator-wide failure where the workflow can support that distinction.

Recovery should respect the provider refusal; automatic retries of refused work are not the requested solution. Retained output must not be presented as a successful full scan when execution failed.

Related issues

Activity

  1. the-pavels commented on Jul 29, 2026

    @the-pavels

    Same here:

    npx codex-security scan .
    [00:00] Preparing scan
    [00:00] Authentication: stored Codex credentials.
    [00:01] Preparing scan
    [01:34] Running scan
    [01:35] Preflight: worker delegation supported (up to 6 worker slots).
    [27:27] Running scan
    codex-security: This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. To get authorized for security work, join the Trusted Access for Cyber program: https://chatgpt.com/cyber
    codex-security: Partial output was kept at ***
    
  2. gwen-fix commented on Jul 29, 2026

    @gwen-fix

    Ditto. After using tokens for 25 minutes. Consider checking for Trusted Access first.

    ✔ How would you like to authenticate this scan? ChatGPT subscription
    [00:00] Preparing scan
    [00:00] Authentication: stored Codex credentials.
    [00:00] Preparing scan
    [25:00] Running scan
    codex-security: This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. To get authorized for security work, join the Trusted Access for Cyber program: https://chatgpt.com/cyber
    
  3. LunchBox951 commented on Jul 29, 2026

    @LunchBox951

    Same failure here, but only after a 78-minute standard scan had consumed substantial usage.

    Environment

    • Codex Security CLI: 0.1.1
    • Bundled plugin: 0.1.14
    • Node.js: v26.5.0
    • npm: 12.0.1
    • Python: 3.14.6
    • OS: Arch Linux, x86_64
    • Authentication: ChatGPT subscription / stored Codex credentials
    • Model: gpt-5.6-sol
    • Reasoning effort: xhigh (default)
    • Mode: standard

    Observed behavior

    The scan ran for 78m17s, then stopped with:

    codex-security: This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. To get authorized for security work, join the Trusted Access for Cyber program: https://chatgpt.com/cyber codex-security: Partial output was kept at ...
    

    The saved scan record reports:

    status: failed
    mode: standard
    phase: preflight
    failure_message: This content was flagged for possible cybersecurity risk...
    

    The Result

    25% of my weekly limit burned on a 20x subscription in 78 minutes with no real result. At minimum, I would expect one or more of the following:

    1. Check Trusted Access eligibility before beginning expensive model work if it is required for this workflow.
    2. Treat a safeguard refusal from one validation worker as a failed/deferred candidate rather than terminating the entire scan.
    3. Allow a failed scan to resume from its durable discovery and validation checkpoints.
    4. Produce an incomplete report from successfully completed validations.
    5. Record the actual phase and completed work accurately when the scan fails.
  4. Agilo-DevTalents commented on Jul 30, 2026

    @Agilo-DevTalents

    Great.

    Image
    This content can't be shown
    We take extra caution with cybersecurity requests. If you’re a security professional, you may be able to apply for [Trusted Access](https://openai.com/form/enterprise-trusted-access-for-cyber/).
    
  5. added
    bug
    on Aug 3, 2026
  6. MaurUppi commented on Aug 6, 2026

    @MaurUppi

    Adding another reproducible case with the current npm release. This was a standard scan of an application that I own and develop; the only user action was invoking the repository scanner. I did not ask for exploit development, offensive actions, or assessment of a third-party target.

    Environment

    • Codex Security CLI: 0.1.6
    • Bundled plugin recorded by the scan: 0.1.15
    • Node.js: v22.17.0
    • Authentication: ChatGPT subscription / stored Codex credentials
    • Model: gpt-5.6-sol
    • Reasoning effort: high
    • Mode: standard

    Reproduction

    npx @openai/codex-security scan . --model gpt-5.6-sol --effort high

    Observed behavior

    The scan ran for approximately 32 minutes. It inventoried and reviewed 1,604 files, normalized 12 discovery candidates, and explicitly entered candidate validation. The runtime recorded about 18.84M total tokens (18.54M cached input and 28K output). During validation, after the scanner itself began examining potential browser injection paths, the turn ended with:

    This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. To get authorized for security work, join the Trusted Access for Cyber program: https://chatgpt.com/cyber
    

    Only partial discovery artifacts were retained. No scan-manifest.json, findings.json, coverage.json, or report.md was produced. The saved scan state says failed and still reports phase: preflight, even though the durable artifacts and transcript show that discovery completed and validation had started.

    I have omitted the repository name, local paths, source excerpts, candidate details, account identifiers, and scan IDs from this report.

    This is particularly disappointing because the refusal was triggered by work generated by the security scanner itself, after substantial time and token usage, rather than by an offensive user prompt.

    At minimum, I would expect the CLI to:

    1. Check and clearly report Trusted Access eligibility before starting expensive work when that access may be required.
    2. Treat a policy refusal during one validation as deferred/incomplete work instead of discarding the entire scan result.
    3. Support resuming from the durable discovery checkpoint.
    4. Generate an explicitly incomplete report from completed work.
    5. Record the actual failure phase and measured usage accurately.
  7. added
    area:auth
    area:cost
    area:reports
    priority:p1
    on Aug 15, 2026
  8. tscodeler commented on Sep 8, 2026

    @tscodeler

    Getting the same after 40 minutes:

    [00:00] Preparing scan
    [00:00] Authentication: stored Codex credentials.
    [00:01] Preparing scan
    [01:47] Running scan
    [01:47] Preflight: worker delegation supported (up to 8 worker slots).
    [44:46] Running scan
    codex-security: This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. To get authorized for security work, join the Trusted Access for Cyber program: https://chatgpt.com/cyber
    codex-security: Partial output was kept at
    
  9. mldangelo-oai commented on Oct 8, 2026

    @mldangelo-oai
    Collaborator

    Related: merged #236 displays Trusted Access status when the runtime provides it. It’s advisory, so it doesn’t guarantee an access check before spending or prevent a later refusal.

  10. added
    area:artifacts
    and removed
    area:cost
    area:reports
    on Oct 8, 2026
  11. changed the title [-]codex-security: This content was flagged for possible cybersecurity risk.[/-] [+]Preserve completed Standard scan work when a policy refusal stops the scan[/+] on Oct 19, 2026
  12. added
    status:needs-triage
    priority:p2
    and removed
    area:auth
    priority:p1
    on Oct 19, 2026
  13. mldangelo-oai commented on Oct 19, 2026

    @mldangelo-oai
    Collaborator

    Moving this to P2 and leaving it open. In a workbench test using the reported refusal message, saved findings and a report were retained, the original error was preserved, and the result remained marked failed. Checkpoint recovery tests also passed.

    That doesn't verify recovery of every discovery-only case described here. A reproduction on 0.4.0 or later, including which draft or checkpoint files existed when the refusal happened, would help identify the remaining gap. Trusted Access status is still advisory.

  14. mldangelo-oai commented on Oct 25, 2026

    @mldangelo-oai
    Collaborator

    #1269 preserves results that have already been saved when a scan stops. Two open PRs cover different parts of a refusal: #1132 would retain unresolved candidates and their evidence, and #1266 would surface the original error and an already-sealed result. Neither can recover a discovery checkpoint that was never written. An existing example from a current release showing which draft or checkpoint files were present would help; there’s no need for another paid run just to repeat the final error.

  15. added
    status:needs-info
    and removed
    status:needs-triage
    on Oct 25, 2026
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

    area:artifactsbugpriority:p2status:needs-info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions