Warden integrates with GitHub Actions through a generated workflow file that runs a full security scan on every push and pull request. The workflow enforces configurable severity gates—if the scan finds vulnerabilities at or above the threshold you set, the pipeline exits with a non-zero code and the job fails. This keeps security policy machine-enforced rather than advisory, without requiring any manual review step before a gate decision is made.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.
Generating the workflow
Thewarden bootstrap-ci command writes a ready-to-use GitHub Actions workflow file into your repository’s .github/workflows/ directory. You do not need to author the YAML by hand.
The generated workflow file is written to
.github/workflows/warden.yml by default. Commit this file to your repository to activate the pipeline.Flag reference
| Flag | Type | Default | Description |
|---|---|---|---|
--workflow-name <name> | string | warden.yml | Filename for the generated workflow inside .github/workflows/. |
--scanner <type> | snyk | npm-audit | all | npm-audit | Scanner to invoke in CI. Use snyk for deeper vulnerability intelligence or npm-audit for zero-credential audits. |
--severity <level> | low | medium | high | critical | high | Minimum severity that triggers a gate failure. Findings below this level are reported but do not fail the job. |
--create-config | flag | — | Create a default .wardenrc.json alongside the workflow if one does not already exist. |
--force | flag | — | Overwrite the workflow file (and config, if --create-config is set) even if they already exist on disk. |
The generated workflow
Runningwarden bootstrap-ci --scanner npm-audit --severity high produces the following workflow. Review it and commit it as-is or adapt it to your needs.
--ci flag activates policy gate enforcement, meaning Warden will exit with a non-zero code when a severity threshold or posture limit is crossed. Without --ci, the scan runs and produces output but the job always exits 0. The --json flag suppresses the interactive banner and emits structured JSON, which is suitable for downstream steps that parse scan output.
Exit codes
Warden uses distinct exit codes in CI mode so that your pipeline can distinguish between a genuine tool failure and a deliberate policy gate:| Exit code | Meaning |
|---|---|
0 | Scan completed and all policy gates passed. |
1 | Fatal error—the environment was misconfigured, a required tool was missing, or an unexpected exception occurred. |
2 | Policy gate triggered—one or more findings met or exceeded the configured severity threshold or posture limit. |
2 means security policy said “stop”; a job step that exits 1 means something broke. Both cause the GitHub Actions job to fail, but they point you in different directions when diagnosing.
Setting up the pipeline
Install Warden and generate the workflow
Run the bootstrap command from the root of your repository:Warden creates
.github/workflows/warden.yml. If you also want a starter config file, append --create-config.Add repository secrets
Open your repository’s Settings → Secrets and variables → Actions page and add the following secrets:
SNYK_TOKEN— Required when using--scanner snykor--scanner all. Obtain a token from app.snyk.io.GITHUB_TOKEN— Automatically provided by GitHub Actions. You do not need to create it, but the workflow’spermissionsblock must grantpull-requests: writeif Warden opens PRs.
Commit and push the workflow
main.Verify the first run
Navigate to the Actions tab in your repository. The
Warden Security Patrol workflow should appear and run. Scan artifacts—including scan-results/scan-results.json and SECURITY-ADVISORY.md—are uploaded as a build artifact named warden-artifacts after every run, whether the job passes or fails.Adding baseline checks
Baseline checks extend the basic scan step by comparing current findings against a committed snapshot of previously accepted risk. This catches regressions—new or worsened findings—without failing on issues you have already triaged. Add the following step after theRun Warden step in your workflow:
scan-results/scan-results.json (written by the preceding scan step) and compares it against .warden-baseline.json in your repository root. If new or worsened findings above high severity are found, the step exits 2 and the job fails.
See Baseline Management for full details on creating and maintaining baseline files.
Dry-run mode in CI
To run Warden on pull requests without enforcing gates—for example, to post informational comments without blocking a merge—add the--dry-run flag:
2 on a gate violation. This is useful for draft PRs or repositories where you want visibility before enabling hard enforcement.