Package Exports
- @devdonzo/warden
- @devdonzo/warden/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@devdonzo/warden) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Warden
Autonomous SRE & Security Orchestration Agent
"Who watches the code?"
Warden is a production-grade, self-healing security agent designed to live within your GitHub ecosystem. Functioning as the head of a Council of Agents, Warden autonomously patrols your repositories, identifies vulnerabilities using enterprise tools, generates verified patches, and submits professional Pull Requestsβall without human intervention.
π Quick Start
# Install globally
npm install -g @devdonzo/warden
# Set up your environment (interactive wizard)
warden setup
# Scan your repository for vulnerabilities
warden scan
# Or scan with dry-run to preview without making changes
warden scan --dry-runWarden vs npm audit
| Feature | npm audit | Warden |
|---|---|---|
| Vulnerability Detection | β Basic | β Snyk + npm audit fallback |
| Automatic Fix Creation | β Manual | β Automated branch & patch |
| Test Verification | β None | β Runs test suite before PR |
| Pull Request Creation | β None | β Automatic with labels/assignees |
| Severity Prioritization | β οΈ Basic | β CVSS-based intelligent sorting |
| HTML Reports | β None | β Visual security dashboard |
| Remote Repository Scan | β None | β Clone & scan any repo |
| Configurable | β Limited | β
Full .wardenrc.json support |
| CI/CD Ready | β οΈ Basic | β Exit codes for automation |
Why choose Warden?
npm audittells you what's wrong. Warden fixes it.npm audit fixcan break your app. Warden verifies fixes pass tests first.npm auditrequires manual PR creation. Warden creates professional PRs automatically.
The Council of Agents
Warden is not just a script; it is an orchestrated system of specialized agents working in unison:
ποΈ The Watchman (Scanner)
The vigilant observer. The Watchman integrates with tools like Snyk and npm audit to continuously scan your dependencies and containers. It doesn't just find bugs; it understands them.
π· The Engineer (Fixer)
The builder. When a vulnerability is detected, The Engineer spins up an isolated environment, creates a fix branch, and intelligently patches your package.json. It runs your test suite to ensure the fix is safe before it ever leaves the local environment.
π€ The Diplomat (Reporter)
The communicator. Once a fix is verified, The Diplomat crafts a professional, semantic Pull Request. It explains what went wrong, how it was fixed, and why it matters, assigning the right reviewers and applying the correct security labels.
Key Features
- Deep Scanning: Integrated with Snyk for dependency and container analysis, with a robust fallback to npm audit
- Autonomous Diagnosis: Intelligent prioritization of Critical and High-severity vulnerabilities
- Self-Healing: Automatically creates fix branches and patches package.json with secure versions
- Verification Pipeline: Every fix is verified via
npm installandnpm testbefore a PR is proposed - Safeguarded Operations: Operates under a strict "Rules of Engagement" constitution preventing unauthorized merges
- Remote Patrol: Supports patrolling any public or private GitHub repository
Prerequisites
Warden relies on a few external tools to perform its duties effectively:
- Node.js (v18+): Required runtime environment
- Git: Required for creating fix branches and managing repositories
- GitHub Token: Required for creating pull requests (set as
GITHUB_TOKENenv var) - Snyk CLI: (Optional) For enhanced scanning. Warden falls back to
npm auditif unavailable
Installation
npm install -g @devdonzo/wardenUsage
Setup (First Time)
Run the interactive setup wizard to configure your tokens and preferences:
warden setupValidate Environment
Check that all prerequisites are met:
warden validateScan for Vulnerabilities
Scan the current repository:
warden scanScan with options:
# Preview changes without creating branches or PRs
warden scan --dry-run
# Use specific scanner
warden scan --scanner npm-audit
# Set minimum severity threshold
warden scan --severity critical
# Limit number of fixes
warden scan --max-fixes 3
# Enable verbose logging
warden scan --verbose
# Scan a remote repository
warden scan https://github.com/owner/repo
# Output as JSON for CI/CD
warden scan --json --quietProject Status
# View recent scans and environment status
warden statusCleanup
# Remove generated files (scan-results, logs)
warden clean
# Preview what would be deleted
warden clean --dry-run
# Also remove configuration file
warden clean --allDiagnostics
# Check environment and diagnose issues
warden doctorConfiguration Management
# Create default config file
warden config --create
# Show current configuration
warden config --show
# Validate configuration
warden config --validateConfiguration
Warden can be configured via a .wardenrc.json file in your project root or home directory.
warden config --createExample configuration:
{
"scanner": {
"primary": "snyk",
"fallback": true,
"timeout": 300000,
"retries": 3
},
"fixes": {
"maxPerRun": 5,
"minSeverity": "high",
"autoMerge": false,
"branchPrefix": "warden/fix"
},
"github": {
"labels": ["security", "automated"],
"autoAssign": true
},
"logging": {
"level": "info",
"file": true,
"console": true
}
}Environment Variables
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
Yes | GitHub Personal Access Token for PR creation |
SNYK_TOKEN |
No | Snyk API token for enhanced scanning |
GITHUB_OWNER |
No | Repository owner (auto-detected from git remote) |
GITHUB_REPO |
No | Repository name (auto-detected from git remote) |
GITHUB_ASSIGNEE |
No | Default PR assignee |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success, no high-priority vulnerabilities |
| 1 | Success, but high-priority vulnerabilities found |
| 2 | Scan failed |
Rules of Engagement
Warden operates under a strict set of rules to ensure safety:
- Do No Harm: Warden will never force push or delete remote branches.
- Verify First: No PR is submitted without a passing test suite.
- Human in the Loop: Warden proposes fixes but requires human approval (merge) by default.
License
ISC Β© DevDonzo