Safeguard
Compliance•

What fields from GitHub code scanning alerts count as evidence?

The code scanning REST API returns state, rule, tool and dismissal details. Learn which fields to export for an audit and how to read dismissals.

Safeguard Security Team
3 min read

Export alert state, rule, severity, tool name, creation time and, for dismissed alerts, who dismissed it, when, the reason and the comment. GitHub's code scanning REST API returns these. Together they show that findings were detected, reviewed and closed with an explanation, which is what auditors test.

What the API returns

GitHub's REST documentation for code scanning lists an alerts endpoint at the repository path ending in code-scanning and alerts, and an analyses endpoint. An alert object in the documentation's examples includes:

FieldWhy it helps as evidence
stateWhether the alert is open or dismissed at export time
rule (id, severity, description, tags)What was found, and the weakness category tags
tool nameWhich scanner produced it
dismissed_by, dismissed_atWho closed it and when
dismissed_reason, dismissed_commentWhy it was closed, in words

An example in the documentation shows a dismissed alert with the reason "false positive" and a comment explaining that a sanitizer exists in the library. That pairing of reason and comment is what you want in every dismissal.

Why dismissals matter most

An open alert shows a finding. A dismissed alert shows a decision. Auditors read decisions. A wall of dismissals with empty comments suggests alerts are being cleared to turn a dashboard green. A few dismissals each with a clear reason and a named person suggests triage.

A simple export routine

  1. Choose a cadence, monthly works for most small teams.
  2. For each repository with code scanning enabled, call the alerts endpoint and save the JSON.
  3. Also save the analyses list, which shows that scans ran and when.
  4. File the output by month and repository.
  5. Review the dismissals once a quarter. Check each has a reason and comment.
  6. Record the review in a one line note with a date.

Keep scan runs consistent

GitHub documents that code scanning uses fingerprints to match results across runs, and that ruleId and file paths need to stay consistent. If paths change between runs, new alerts are created and old ones closed. That affects your evidence: a changed path can look like fixed alerts when nothing was fixed. Keep the scan configuration stable and note when you change it.

For uploads from other tools, see keeping SARIF results per release.

Try it yourself

Click through it at your own pace, or open it full screen. Look at the fields a finding carries, then imagine each as a column in your export.

Where Safeguard fits

Safeguard provides SBOM and dependency scanning, reachability analysis and compliance and evidence automation, so findings and their dispositions are kept in one record. You can run a free scan.

Quick check

Is an open alert bad evidence?

Not necessarily. Open alerts show detection. What matters is that you have a triage process and the open items have owners and dates.

Should dismissals always have a comment?

Yes, as a team rule. The API has a field for it, so use it.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.