Safeguard
Security Guides•

How do you write a SAST suppression comment that survives review?

A good SAST suppression names the rule, says why the code is safe, points to evidence, and carries an owner and a review date. Here is a template.

Safeguard Security Team
4 min read

A suppression comment that survives review states four things: which rule it silences, why the flagged code is safe, what evidence supports that claim, and who will recheck it and when. A bare "ignore" or "false positive" tells the next reader nothing and tends to hide real bugs.

Why the comment matters more than the suppression

Silencing a finding is a decision. The code that carries it will outlive the person who made it. Six months later a reviewer, an auditor or a new teammate sees a suppression and has to guess whether anyone thought about it.

The SARIF standard, which many scanners use for output, treats this as a first class idea. A suppression object can carry a justification property, described in the spec as a user supplied string that explains why the result was suppressed. The spec notes that this information is commonly available in existing suppression mechanisms, so the habit of explaining is already built into the tooling. Use it.

A template that works

Keep it to one or two lines next to the code, in whatever syntax your scanner supports. Include:

FieldExample content
RuleThe rule name or ID being silenced
ReasonWhy this instance is not exploitable, in one sentence
EvidenceA test, design note or ticket number that shows it
OwnerA team or person, not "security"
Review byA date, usually 90 to 180 days out

A filled in example might read: rule sql-injection, reason "table name comes from a hard coded enum, never from a request", evidence "unit test TableNameTest and ticket APP-412", owner payments team, review by 2027-01-31.

What a reviewer should reject

  • A suppression with no reason.
  • A reason that says only "false positive" without saying what makes it false.
  • A suppression covering a whole file or directory when one line was flagged.
  • A reason that depends on a control elsewhere, with no link to that control.
  • Suppressions added in the same pull request as the vulnerable code, with no second person looking.

Steps to adopt this in a team

  1. Write the template into your contributing guide.
  2. Add a pull request check that fails when a suppression marker has no reason text. A simple search over the diff is enough to begin with.
  3. Make code owners for security sensitive paths approve any new suppression there.
  4. Once a quarter, list all suppressions past their review date and either renew them with fresh evidence or delete them.

Step 4 is the one teams skip, and it is the one that stops suppressions from turning into a permanent blind spot. See also how to tune or suppress a noisy alert for the earlier decision of whether to suppress at all.

One factual note on Safeguard

Safeguard supports policies and gates that can enforce rules like these on pull requests. If you want a quick look at your own code, the free scan at gold.safeguard.sh/scan is a no-account place to start.

Quick check

Is it enough to write "false positive" as the reason?

No. Say what makes it false: for example, that the input is a constant, or that a validation step upstream removes the dangerous characters. The reason should let a stranger verify the claim.

How long should a suppression last?

There is no standard number. Many teams choose 90 to 180 days and renew only with fresh evidence. The point is that every suppression gets looked at again.

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.