fix(scan): use the registered scan ID in agent prompts - #296
Conversation
|
Thanks for tracking this down and contributing the fix, @dipeshbabu, and thanks to @charle-z for the earlier investigation. I carried your original commits into #354, merged current |
|
Thank you again for tracking this down and contributing the fix, @dipeshbabu! Your original commits and authorship were preserved in #354, which has now merged and resolved both linked issues. I am closing this PR because your fix has already landed through that contributor-preserving follow-up. We really appreciate your help improving Codex Security! |
Fixes #290
Fixes #292
Summary
Root cause
The prompt was created before scan registration and referred to
$CODEX_SECURITY_SCAN_ID. That placeholder is not expanded inside structured MCP arguments or agent-authored artifacts, so deep scans could send an invalid literal ID and standard scans could write a different UUID that finalization rejected.Impact
Deep scans now call
start_codex_security_deep_scanwith the registered UUID, and all scan modes instruct the agent to use that same UUID in canonical artifacts.Validation
pnpm dlx bun test --timeout 30000 ./tests-ts/api.test.ts --test-name-pattern "uses the registered scan ID in standard and deep prompts|encodes valid Unicode Git refs as data before sending the scan prompt|provides only reviewed false positives"— 3 passedpnpm exec tsc --noEmitpnpm exec prettier --check src/api.ts tests-ts/api.test.tsgit diff --checkThe complete API test file reached 80 passing tests; its remaining nine tests are blocked in this local Windows environment by the existing credential-home ancestor ACL check.