openai / openai/codex-security

Run warnings never reach the SARIF projection, so drift is invisible to SARIF consumers

Open
#251 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:python area:reports bug priority:p1
Dominant language
TypeScript
Stars
10.8k
Forks
801
Avg merge
1d 8h
Merged PRs (30d)
257

Description

Summary

A scan whose target drifted mid-run records a warning, but that warning never reaches the SARIF projection, so a SARIF consumer cannot tell the results describe a stale tree.

Environment

  • @openai/codex-security 0.1.5, current main at ea19f24
  • macOS 15 (Darwin 25.5.0), Python 3.14.5

Where it is

sdk/typescript/_bundled_plugin/scripts/finalize_scan_contract.py populates runs[].invocations[].toolExecutionNotifications from coverage["deferred"], and only when coverage["completeness"] is not complete.

A drifted target leaves completeness at complete — the scan really did review everything it set out to review; the tree simply moved underneath it. So the condition is false, no invocations block is emitted at all, and there is no field carrying the warning.

Why it matters

SARIF is the machine-readable surface most CI systems consume, and toolExecutionNotifications with level: "warning" is precisely the SARIF idiom for "the run completed but something about it needs attention". A drift warning is the clearest example of that, and it is the one place it cannot currently appear.

Note this is not a projection bug alone — the notification structure is only ever built from deferred coverage rows, so run-level warnings have no route into SARIF regardless of completeness.

Suggested direction

Emit an invocations[] entry whenever the scan recorded warnings, independently of completeness, mapping each warning to a toolExecutionNotifications entry at level: "warning" with executionSuccessful: true. That leaves the existing deferred-coverage notifications untouched and adds the run-level ones alongside.

This needs a bundled-plugin change plus SARIF schema validation, which is why it was kept out of PR #220 (that PR states it makes no export change). Related: #195.

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 in sdk/typescript/_bundled_plugin/scripts/finalize_scan_contract.py and trace how coverage["deferred"], completeness, and recorded warnings become SARIF runs[].invocations[].toolExecutionNotifications. Check the existing deferred-coverage behavior, then use the SARIF schema validation to verify that run-level warnings appear with warning severity and executionSuccessful true while deferred notifications remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
cli, security, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.