Preserve Deep Scan progress and report policy refusals clearly
Summary
A Deep Scan passed capability preflight and ran repeated discovery before a cybersecurity-policy refusal terminated the coordinator. The reported scan had no successful discovery manifestPath, no canonical report, and no supported in-place resume path.
This issue covers Deep Scan refusal handling, retained work, and recovery. Passing a capability or advisory access check cannot guarantee that a later request will not be refused.
Original environment and sequence
- Codex Security plugin
0.1.15(later updated locally to0.1.16) - Workflow
deep-scan-mcp/v1, coordinator manifest schema1 - Codex desktop
26.727.51351, Codex CLI0.146.0 - macOS
26.5.2, modelgpt-5.6-sol/xhigh
- Launch a whole-repository Deep Scan from Codex desktop for an authorized local target.
- Pass capability preflight and allow discovery to proceed.
- Observe the coordinator move the scan to terminal
failedduring discovery 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
The report does not establish that missing entitlement, rather than request-level classification, caused the refusal.
Remaining expectations
- Surface available access information before work and distinguish an advisory/unknown result from a denial.
- Identify whether a worker or the coordinator was refused and stop known-refused work without repeated automatic retries.
- Preserve supported completed discovery/results and the refusal diagnostic.
- Describe what is still usable and whether an explicit, supported resume can reuse accepted work.
- Keep terminal execution status and unfinished scope accurate; retained partial results do not make a failed run successful.
Related work
Worker replacement and result-recovery improvements cover parts of the lifecycle, but do not establish resolution of this reported coordinator case. #1035 is an open proposal to stop promptly on known refusals. #56 covers the analogous Standard-scan report, and #25 covers pre-spend planning.
Thanks for the detailed report. #267 adds replacement for refused Deep Scan workers, and #434 can preserve completed partial results. Neither change guarantees an access check before work starts or recovery when the coordinator itself is refused. Keeping this open for that remaining behavior; #56 tracks the related Standard-scan case.
This stays P1. Using the full refusal text from this issue in a simulated worker run, I reproduced four attempts on the refused worker followed by a replacement. The shorter recognized refusal skips those retries but still starts a replacement.
Saved-result recovery retained committed findings and a failed report in a separate check, so that part has improved. The remaining work is to stop promptly on known refusals while preserving accepted results and the original diagnostic; #1035 targets that behavior.
For the resume part of this report, #907 would reuse accepted worker results after an interruption. It doesn’t make a terminal policy refusal resumable. #1035 is the open fix for stopping retries on that refusal while keeping the accepted results and the original error.
On current main, #1035 stops a discovery worker on the full cybersecurity refusal quoted in this issue. I also exercised two other exact worker refusal messages with a fake Codex process. With retry delays shortened, main ran four attempts on the refused worker and four on its replacement, then reported a capped success. #2410 and #2682 each stop their respective message on the first refusal. The failed scan retained a completed finding, the worker result containing deferred work, and the original diagnostic. Rejoining launched zero workers.
The remaining case is a refusal of the Desktop parent turn itself. Explicitly calling fail_codex_security_scan after one discovery preserved the partial result, but that fixture delivered the failure to MCP. A current synthetic Desktop trace identifying the refused turn, whether the failure reached MCP, and the persisted scan status after reconnect would distinguish a parent-turn delivery problem from a worker failure.
I'm picking this one up — working on a fix for the Desktop parent-turn refusal case: when the parent MCP call is cancelled mid-scan and the abort reason is one of the known cybersecurity policy refusal messages, the scan should fail with that diagnostic instead of detaching silently and later reporting success. Plain detaches will keep their current behavior. I'll open a PR with the fix and its tests once it's ready.