Thanks for wanting to help make AI agents more secure.
git clone https://github.com/brandonwise/agentwise.git
cd agentwise
cargo test # Run all tests
cargo clippy # Lint
cargo run -- scan testdata/vulnerable-mcp.json # Try itsrc/
βββ main.rs # CLI entry point (clap + tokio)
βββ config.rs # MCP config parsing (serde)
βββ scanner.rs # Scan orchestrator
βββ score.rs # Scoring system (0-100)
βββ cvedb.rs # Embedded CVE database
βββ osv.rs # Live OSV vulnerability queries
βββ epss.rs # EPSS exploitation probability scores
βββ supply_chain.rs # npm registry supply chain analysis
βββ depsdev.rs # deps.dev dependency graph analysis
βββ rules/
β βββ mod.rs # Rule trait + registry
β βββ auth.rs # AW-001: Missing authentication
β βββ filesystem.rs # AW-002: Overpermissioned filesystem
β βββ shell.rs # AW-003: Unrestricted shell
β βββ secrets.rs # AW-004: Secrets in config
β βββ transport.rs # AW-005: Insecure transport
β βββ cve.rs # AW-006: Known CVE matching
β βββ allowlist.rs # AW-007: Missing tool allowlist
β βββ write_tools.rs # AW-008: Write-capable tools
β βββ network.rs # AW-009: Unrestricted network
β βββ injection.rs # AW-010: Prompt injection surface
β βββ supply_chain.rs # AW-011: Supply chain risk signals
β βββ deps.rs # AW-012: Dependency graph analysis (deps.dev)
βββ report/
βββ terminal.rs # Colorized terminal output
βββ json.rs # JSON output
βββ sarif.rs # SARIF for GitHub Code Scanning
The easiest way to contribute is adding new detection rules.
- Create
src/rules/your_rule.rs - Implement the
Ruletrait:
pub struct YourRule;
impl Rule for YourRule {
fn id(&self) -> &'static str { "AW-0XX" }
fn check(&self, server_name: &str, server: &McpServer, config_file: &str) -> Vec<Finding> {
let mut findings = vec![];
// Your detection logic here
findings
}
}- Register it in
src/rules/mod.rs(add toall_rules()) - Add tests
- Run
cargo test && cargo clippy -- -D warnings
For async analysis rules (like AW-011 and AW-012), see src/rules/supply_chain.rs and src/rules/deps.rs for the pattern β these are invoked from scanner.rs separately from the synchronous rule trait.
Edit cvedb/mcp-cves.json. Each entry needs:
{
"id": "CVE-YYYY-XXXXX",
"package": "@scope/package-name",
"affected_versions": "<1.2.3",
"severity": "critical|high|medium|low",
"description": "What the vulnerability does",
"fix": "How to fix it"
}Supply chain analysis lives in src/supply_chain.rs. To add new risk signals (e.g., checking for archived repos, deprecated packages), add detection logic to the analyze_package function and push a new RiskSignal to the signals vec.
Dependency graph analysis lives in src/depsdev.rs. The analyze_dependencies function queries the deps.dev API for transitive dependency counts, advisories, and license issues. Add new checks by extending the DepsAnalysis struct and the analysis logic.
- Run
cargo clippy -- -D warningsbefore submitting - Add tests for new rules (aim for edge cases)
- Keep detection rules focused β one check per rule
- False positives are worse than false negatives
Be kind. Be constructive. We're all here to make AI agents safer.