A security baseline is a committed snapshot of the vulnerabilities present in your project at the moment your team reviewed and accepted the current risk posture. Once a baseline exists, Warden’s CI check compares every subsequent scan against it and exits with an error only when genuinely new or worsened findings appear above your configured severity threshold. Findings that were already in the baseline are treated as accepted risk and do not block the pipeline. This eliminates the false-positive noise of failing on pre-existing issues you have no immediate plans to remediate, while still catching real regressions the moment they are introduced.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DevDonzo/warden/llms.txt
Use this file to discover all available pages before exploring further.
How baselines work
Run a scan to produce scan-results.json
Warden writes structured scan output to
scan-results/scan-results.json after every warden scan invocation. The baseline command reads from this file, so a scan must complete successfully before you can create a baseline.Create the baseline file
Pass Warden reads
--create to snapshot the current scan results into .warden-baseline.json:scan-results/scan-results.json, converts each vulnerability into a stable fingerprint, and writes the full baseline snapshot to .warden-baseline.json in your project root.Commit the baseline file
Enable the baseline check in CI
Add a dedicated step after the scan step in your workflow:Warden compares
scan-results/scan-results.json (written moments earlier by the scan step) against the committed .warden-baseline.json. If the comparison finds new or worsened findings at high severity or above, the step exits 2 and the job fails.Command flags
Thewarden baseline command accepts the following options:
| Flag | Default | Description |
|---|---|---|
--create | — | Create or overwrite .warden-baseline.json from the current scan results. |
--check | — | Compare the current scan results against the existing baseline and exit 2 if a regression is detected. |
--baseline <path> | .warden-baseline.json | Path to the baseline file. Override when managing multiple baselines for a monorepo. |
--scan-results <path> | scan-results/scan-results.json | Path to the scan results JSON produced by warden scan. |
--severity <level> | high | Minimum severity that triggers a check failure. Accepted values: low, medium, high, critical. |
--json | — | Emit the full comparison result as JSON to stdout instead of formatted log output. Useful for downstream parsing or upload steps. |
--create and --check are mutually exclusive. Passing both in the same invocation exits 1 with an error.
The WardenBaseline type
The.warden-baseline.json file is a serialized WardenBaseline object. Its structure is defined in src/types/index.ts:
findings is a BaselineFinding:
BaselineComparison output
When you runwarden baseline --check --json, Warden prints a BaselineComparison object to stdout:
--json output from a check that detects one new finding:
BaselineFindingDelta
Each entry innewFindings, resolvedFindings, and worsenedFindings is a BaselineFindingDelta:
- New finding:
currentis present,baselineis absent. The vulnerability was not in the committed baseline. - Resolved finding:
baselineis present,currentis absent. The vulnerability no longer appears in the current scan. - Worsened finding: both
baselineandcurrentare present, andseverityChangedis populated. The same vulnerability fingerprint exists in both scans but its severity increased (e.g.medium→high).
Complete CI workflow snippet
The following workflow runs a scan and then performs a baseline regression check. Both steps must pass for the job to succeed.if: always() condition on the upload step ensures scan artifacts and the baseline file are preserved even when a previous step exits non-zero, giving you full context when diagnosing a gate failure.