Safeguard
Developer Tools•

How long can a security scan take in CI before developers revolt?

Set a scan time budget per stage: a fast path on every pull request and a slow path on a schedule. How platform teams split checks and keep builds quick.

Safeguard Security Team
3 min read

There is no universal number, but a good working rule is to keep the checks that block a pull request short enough that developers wait for them, and move slow scans to a schedule or release stage. Set a budget per stage, measure it, and treat overruns as bugs.

Two paths, two budgets

PathWhen it runsTypical contentsBudget idea
FastEvery pull requestDependency diff, secret scan on the diff, quick code rulesMinutes, in parallel with tests
SlowNightly, weekly or at releaseFull code analysis, container image scan, dynamic testsLonger, off the critical path

Choose your own numbers from developer feedback. Ask what wait time makes people stop reading results or merge elsewhere, and set the fast path below that.

Techniques that cut scan time

  1. Scan the change, not the whole repo, for checks that support it.
  2. Run scans in parallel with tests rather than after them.
  3. Cache dependency metadata and scanner databases between runs.
  4. Skip scans when only docs changed, using path filters.
  5. Use a lockfile based dependency scan, which avoids building the project.
  6. Keep slow dynamic tests for a deployed preview or a scheduled run.

What not to cut

Do not remove the check just to hit a number. If the dependency scan is slow, fix the cache. If the code analysis is slow, move it to the slow path but keep a lighter rule set on pull requests.

Make timing visible

Add duration to your gate metrics. Report the median and the slowest ten percent per stage, per repo. A single repo with a huge monorepo may need its own settings rather than a global slowdown.

Decide the failure behaviour

A slow or flaky scan creates pressure to bypass. Decide up front whether a timed out scan blocks, warns or retries. See what happens when the scanner is down for the options.

Developer communication

Publish the budgets. When a scan breaches, open an issue in the platform backlog the same way you would for a broken build. Developers forgive a slow scan they can see being worked on.

Try it yourself

In the SAST demo, watch how scan scope and results are presented. Think about which parts belong on a pull request and which belong in a nightly run.

Click through it at your own pace, or open it full screen.

Quick check

Should full scans run on every pull request?

Only if they fit your budget. Otherwise run changed file checks on pull requests and the full analysis on a schedule.

Do nightly scans still protect us?

Yes, for issues that do not need a merge block, as long as someone owns the findings and the gate can still stop a release.

Safeguard supports scanning at pull request, build and scheduled stages, so teams can place each check where it fits the budget, and the free scan at gold.safeguard.sh/scan gives a quick sample.

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.