When Warden finds a vulnerability that has a known safe upgrade, the Engineer agent applies the fix in an isolated Git branch and the Diplomat agent opens a pull request with full context. Every step is governed by the limits and policies you define inDocumentation 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.
.wardenrc.json, so fixes never happen silently or beyond your configured blast radius.
The result is a human-reviewable PR that records exactly what changed, why, what the policy decided, and what the risk score was at the time — a durable audit trail for every automated security change.
Prerequisites
- A GitHub repository with a Git remote pointing to
github.com GITHUB_TOKENset in the environment with repo scope (required to push branches and open PRs)- A
package.json(npm) orrequirements.txt(Python) project in the scan target directory
The Fix PR Workflow
Configure GITHUB_TOKEN and the fixes section
Export your token in the shell (or add it to your CI secrets):Add a
fixes section to .wardenrc.json:| Field | Default | Description |
|---|---|---|
fixes.maxPerRun | 1 | Maximum number of fix branches and PRs to create in a single run |
fixes.minSeverity | "high" | Only fix vulnerabilities at or above this severity level |
fixes.autoMerge | false | Whether Warden should auto-merge fix PRs after they pass CI |
fixes.autoMerge is false by default and should remain that way in most teams. Auto-merge removes the human review step that makes Warden’s fixes auditable. Enable it only on repositories where every security fix PR is already gated by required status checks and CODEOWNERS approval.Run a scan with fix parameters
--max-fixes flag overrides fixes.maxPerRun for this run without changing the config file. The --severity flag overrides fixes.minSeverity.To preview what would happen without creating any branches or PRs, add --dry-run:--dry-run is the safest way to test fix configuration changes. Warden writes all artifacts — including the remediation plan and policy decision — but skips git checkout -b, git push, and PR creation. Inspect scan-results/agent-run-record.json to see what would have been fixed.Engineer agent creates a fix branch
For each fixable vulnerability, the Engineer agent:
- Validates that no uncommitted changes are present (refuses to proceed if there are any)
- Creates or checks out a branch named
warden/fix-<package-name> - Locates the package in
package.json(dependencies or devDependencies) orrequirements.txt - Writes the target version to the manifest, preserving the existing range prefix (
^,~, or none) - Runs
npm install --package-lock-onlyto regenerate the lockfile - Runs
npm test(if a test script exists) to verify the fix; reverts on failure - Stages all changes and commits with message:
fix(<package>): resolve <vulnerability-id>
requirements.txt and runs python3 -m pytest if a pytest suite is detected.Branch naming convention:Diplomat agent opens the pull request
Once the branch is committed, the Diplomat agent:
- Pushes the branch to
originviagit push -u origin <branch> - Detects the repository owner and name from
git config --get remote.origin.url - Resolves the default base branch via
git symbolic-ref refs/remotes/origin/HEAD - Calls the GitHub Pulls API (
octokit.pulls.create) to open the PR - Adds labels:
security,automated, andseverity:<level>(e.g.severity:high) - Assigns the PR to
GITHUB_ASSIGNEE(env var) or the repository owner
- Vulnerability Details — ID, severity, description
- Changes Made — what manifest and lockfile lines changed
- Review Checklist — a human-readable checklist to verify the fix
scan-results/agent-run-record.json and linked from the PR description.Review and merge the PR
Navigate to the PR URL printed in the terminal output (also stored in
scan-results/agent-run-record.json under pullRequestUrls).Review the diff: it will show exactly one change to package.json (and package-lock.json) or requirements.txt. The PR body tells you the vulnerability ID, the before/after version, and whether tests passed during the fix.Merge the PR through your normal review process. Warden does not auto-merge unless fixes.autoMerge: true is explicitly set.Fix Limits and How to Change Them
Warden is deliberately conservative about how many fixes it applies per run. The default limit is one fix per run to keep PRs focused and reviewable.maxPerRun value creates one branch and one PR per fix, not a single giant PR. Each fix is isolated so reviewers can merge or revert individual changes without affecting others.
Approval Gates
Whenpolicy.requireApprovalAboveSeverity is set, Warden will plan a fix but block execution until a human provides an approval token:
high or critical severity triggers a block. Warden writes scan-results/warden-approval-request.json and prints:
--approval-token approved:
agent-run-record.json artifact so there is a permanent record of who authorized the fix and when (via the Git commit that triggered the run).