Quality gates

Every code scan gets a pass or fail

Decide once what good enough means: no open critical findings, no secrets in the repo, a security rating of C or better. FlawPilot checks every finished code scan against those rules and gives one verdict that your team, your pipeline and your AI assistant all read the same way.

Works with Code Scan on any connected repository. Every repository starts on the built-in gate, so the first verdict needs no setup once Quality Gate is turned on for your workspace.

What a quality gate does

Rules over open findings

A gate is a short list of rules, such as "no open critical findings" or "no duplicate code". Each rule is measured against the findings still open on the latest scan of the branch.

One of three verdicts

Passed when every rule holds, Failed when any rule is broken, and Not decided when a rule could not be measured. Not decided is never counted as a pass.

Checked after every scan

The gate runs in the background as soon as a code scan finishes. It never slows the scan down and never makes it fail.

The same answer everywhere

The dashboard, the REST API, the MCP tool, webhooks and the scan-complete email all show the same verdict for the same scan.

Three verdicts, and only one of them is a pass

Passed

Every rule holds on the findings still open.

Failed

At least one rule is broken. The result names which one and by how much.

Not decided

A rule could not be measured, for example a scan type failed. Never counted as a pass.

Ready on day one

Start with the FlawPilot way

Every workspace has a built-in gate before anyone writes a rule. It is what a repository uses until you choose another, and it cannot be edited or deleted. Copy it when you want your own version.

Security rating

C or better

Nothing open is high or critical severity.

Critical security findings

None open

A single critical issue fails the gate.

Secrets in the repo

None at high

A leaked key or token fails the gate.

Hardcoded credentials

None at high

Passwords written into code fail the gate.

Or write your own rules

A gate holds up to 25 rules. Each rule picks a measure and a limit, and fails when the measured value goes above or below that limit.

MeasureWhat it measuresExample rule
Open findingsFindings still open, narrowed by scan type, severity or rule groupNo open high-severity vulnerable dependencies
Security ratingA to E, from the worst open security findingSecurity rating B or better
Maintainability ratingA to E, from the worst open code health findingMaintainability rating C or better
ScoreThe scan score from 0 to 100%, counting only what is still open. Higher is betterScore not below 80%
Reviewed findingsThe share of findings resolved, marked false positive or acceptedAt least 90% reviewed

How the A to E ratings work

A rating comes from the worst finding still open, so one fix can move it a whole letter.

  • ANone open
  • BWorst open finding is low
  • CWorst open finding is medium
  • DWorst open finding is high
  • EA critical finding is open

Target a kind of problem, not only a severity

An open-findings rule can target a rule group, so duplicate code or a leaked key can fail a scan on its own.

  • Injection
  • Hardcoded credentials
  • Crypto and transport
  • Web hardening
  • Path traversal
  • SSRF and redirect
  • Unsafe deserialization
  • Code smells
  • Other security rules
  • Secrets in repo
  • Vulnerable dependencies
  • Duplicate code
  • Complexity and size
  • Unused code
  • Other lint rules

Where a gate applies

Set a gate on one repository, a whole project or the workspace. FlawPilot uses the most specific one it finds.

  1. 1

    Repository

    A gate set on one repository wins over everything else.

  2. 2

    Project

    Otherwise, the gate set on the project the repository belongs to.

  3. 3

    Workspace default

    Otherwise, the gate your workspace marks as its default.

  4. 4

    FlawPilot way

    If nothing is set, the built-in gate.

Owners and admins create gates and choose where they apply. Everyone in the workspace can read the gates and every verdict.

One verdict, wherever you look

Whoever asks gets the same answer for the same scan: a person in the dashboard, a CI job, an AI assistant or your own service.

Dashboard

A result card on the scan's findings page lists every rule with its measured value. The Code Scan list shows the verdict for each run.

REST API

Read the status with the run id of the scan you just started. Add wait=true and the request holds until the verdict is in.

MCP

Ask your AI assistant whether the scan passed. The get_quality_gate_status tool returns the same verdict and rule values.

Webhooks

code_scan.gate_evaluated fires on every verdict. quality_gate.status_changed fires when a repository flips between passed and failed.

Email

The scan-complete email carries one line with the verdict.

Fail the build in one call

Pass the run id from the scan your pipeline just started, and the request waits up to 55 seconds for the verdict. The build fails unless the gate passed.

Fail the build unless the gate passed
API=https://api.flawpilot.com/v1
for i in $(seq 1 14); do
  OUT=$(curl -sSf --max-time 65 -G -w '\n%{http_code}' \
    "$API/projects/$PROJECT_ID/quality-gate/status" \
    -H "Authorization: Bearer $FLAWPILOT_API_KEY" \
    -d runId="$RUN_ID" -d wait=true) || exit 1
  CODE=${OUT##*$'\n'}; BODY=${OUT%$'\n'*}
  [ "$CODE" = 202 ] && continue        # still PENDING: ask again
  [ -n "$BODY" ] || exit 1
  printf '%s' "$BODY" | jq -e '.passed == true' > /dev/null
  exit $?
done
echo "Quality gate verdict still pending after 14 attempts" >&2
exit 1

A 202 response means the verdict is not in yet: call again. Not decided returns passed: false, so it fails the build too.

See the full CI/CD guide

A verdict you can trust

Reviews count

Mark a finding as a false positive or an accepted risk and the gate re-checks the latest scan of that branch. It can turn green without a new commit.

History stays put

Each result keeps a copy of the rules it was judged by. Editing or deleting a gate never rewrites a past verdict.

Branches stay separate

Every repository and branch has its own verdict, so a broken feature branch never turns main red.

Unmeasured is not passed

If a scan type fails to finish, the rules that depend on it cannot be measured and the verdict is Not decided, never Passed.

Questions

A short list of rules over the findings still open in a repository, such as "no open critical findings" or "security rating C or better". When a code scan finishes, FlawPilot checks those rules and records one verdict for that scan: Passed, Failed or Not decided.

Set it once

Give your next code scan a verdict

Every repository starts on the built-in gate, so your next scan gets a verdict with no setup. Write your own rules when you are ready.