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
Every rule holds on the findings still open.
At least one rule is broken. The result names which one and by how much.
A rule could not be measured, for example a scan type failed. Never counted as a pass.
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.
| Measure | What it measures | Example rule |
|---|---|---|
| Open findings | Findings still open, narrowed by scan type, severity or rule group | No open high-severity vulnerable dependencies |
| Security rating | A to E, from the worst open security finding | Security rating B or better |
| Maintainability rating | A to E, from the worst open code health finding | Maintainability rating C or better |
| Score | The scan score from 0 to 100%, counting only what is still open. Higher is better | Score not below 80% |
| Reviewed findings | The share of findings resolved, marked false positive or accepted | At 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
Repository
A gate set on one repository wins over everything else.
- 2
Project
Otherwise, the gate set on the project the repository belongs to.
- 3
Workspace default
Otherwise, the gate your workspace marks as its default.
- 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.
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.
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 1A 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 guideA 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
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.