agentaudit 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -10
- package/cli.mjs +16 -13
- package/index.mjs +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,22 +46,26 @@ It checks packages against the [AgentAudit Trust Registry](https://agentaudit.de
|
|
|
46
46
|
|
|
47
47
|
## 🚀 Quick Start
|
|
48
48
|
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img src="docs/cli-screenshot.png" alt="AgentAudit CLI — discover and scan" width="700">
|
|
51
|
+
</p>
|
|
52
|
+
|
|
49
53
|
### Option A: CLI (recommended)
|
|
50
54
|
|
|
51
55
|
```bash
|
|
52
|
-
# Install globally
|
|
56
|
+
# Install globally (or use npx agentaudit)
|
|
53
57
|
npm install -g agentaudit
|
|
54
58
|
|
|
55
|
-
# Discover MCP servers in your AI editors
|
|
59
|
+
# Discover MCP servers configured in your AI editors
|
|
56
60
|
agentaudit
|
|
57
61
|
|
|
58
|
-
# Quick scan
|
|
62
|
+
# Quick scan — clones repo, checks code with regex patterns (~2s)
|
|
59
63
|
agentaudit scan https://github.com/owner/repo
|
|
60
64
|
|
|
61
|
-
# Deep LLM-
|
|
65
|
+
# Deep audit — clones repo, sends code to LLM for 3-pass analysis (~30s)
|
|
62
66
|
agentaudit audit https://github.com/owner/repo
|
|
63
67
|
|
|
64
|
-
#
|
|
68
|
+
# Registry lookup — check if a package has been audited before (no cloning)
|
|
65
69
|
agentaudit lookup fastmcp
|
|
66
70
|
```
|
|
67
71
|
|
|
@@ -84,11 +88,42 @@ agentaudit lookup fastmcp
|
|
|
84
88
|
Looking for general package scanning? Try `pip audit` or `npm audit`.
|
|
85
89
|
```
|
|
86
90
|
|
|
87
|
-
### Option B: MCP Server in your editor
|
|
91
|
+
### Option B: MCP Server in your AI editor
|
|
92
|
+
|
|
93
|
+
Add AgentAudit as an MCP server — your AI agent can then discover, scan, and audit packages using its own LLM. **No extra API key needed.**
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary><strong>Claude Desktop</strong> — <code>~/.claude/mcp.json</code></summary>
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"agentaudit": {
|
|
102
|
+
"command": "npx",
|
|
103
|
+
"args": ["-y", "agentaudit"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
</details>
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
<summary><strong>Cursor</strong> — <code>.cursor/mcp.json</code> (project) or <code>~/.cursor/mcp.json</code> (global)</summary>
|
|
88
112
|
|
|
89
|
-
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"mcpServers": {
|
|
116
|
+
"agentaudit": {
|
|
117
|
+
"command": "npx",
|
|
118
|
+
"args": ["-y", "agentaudit"]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
</details>
|
|
90
124
|
|
|
91
|
-
|
|
125
|
+
<details>
|
|
126
|
+
<summary><strong>Windsurf</strong> — <code>~/.codeium/windsurf/mcp_config.json</code></summary>
|
|
92
127
|
|
|
93
128
|
```json
|
|
94
129
|
{
|
|
@@ -100,8 +135,10 @@ Add to your MCP config:
|
|
|
100
135
|
}
|
|
101
136
|
}
|
|
102
137
|
```
|
|
138
|
+
</details>
|
|
103
139
|
|
|
104
|
-
|
|
140
|
+
<details>
|
|
141
|
+
<summary><strong>VS Code</strong> — <code>.vscode/mcp.json</code></summary>
|
|
105
142
|
|
|
106
143
|
```json
|
|
107
144
|
{
|
|
@@ -113,8 +150,43 @@ Add to your MCP config:
|
|
|
113
150
|
}
|
|
114
151
|
}
|
|
115
152
|
```
|
|
153
|
+
</details>
|
|
154
|
+
|
|
155
|
+
<details>
|
|
156
|
+
<summary><strong>Continue.dev</strong> — <code>~/.continue/config.json</code></summary>
|
|
157
|
+
|
|
158
|
+
Add to the `mcpServers` section of your existing config:
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"mcpServers": [
|
|
162
|
+
{
|
|
163
|
+
"name": "agentaudit",
|
|
164
|
+
"command": "npx",
|
|
165
|
+
"args": ["-y", "agentaudit"]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
</details>
|
|
171
|
+
|
|
172
|
+
<details>
|
|
173
|
+
<summary><strong>Zed</strong> — <code>~/.config/zed/settings.json</code></summary>
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"context_servers": {
|
|
178
|
+
"agentaudit": {
|
|
179
|
+
"command": {
|
|
180
|
+
"path": "npx",
|
|
181
|
+
"args": ["-y", "agentaudit"]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
</details>
|
|
116
188
|
|
|
117
|
-
|
|
189
|
+
Then ask your agent: *"Check which MCP servers I have installed and audit any unaudited ones."*
|
|
118
190
|
|
|
119
191
|
---
|
|
120
192
|
|
package/cli.mjs
CHANGED
|
@@ -155,7 +155,7 @@ function multiSelect(items, { title = 'Select items', hint = 'Space=toggle ↑
|
|
|
155
155
|
process.stdin.pause();
|
|
156
156
|
process.stdin.removeListener('data', onData);
|
|
157
157
|
console.log();
|
|
158
|
-
process.
|
|
158
|
+
process.exitCode = 0; return;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// Enter
|
|
@@ -1502,7 +1502,7 @@ async function main() {
|
|
|
1502
1502
|
|
|
1503
1503
|
if (args[0] === '-v' || args[0] === '--version') {
|
|
1504
1504
|
console.log(`agentaudit ${getVersion()}`);
|
|
1505
|
-
process.
|
|
1505
|
+
process.exitCode = 0; return;
|
|
1506
1506
|
}
|
|
1507
1507
|
|
|
1508
1508
|
if (args[0] === '--help' || args[0] === '-h') {
|
|
@@ -1551,7 +1551,7 @@ async function main() {
|
|
|
1551
1551
|
console.log(` ${c.dim}Add to your MCP config:${c.reset}`);
|
|
1552
1552
|
console.log(` ${c.dim}{ "agentaudit": { "command": "npx", "args": ["-y", "agentaudit"] } }${c.reset}`);
|
|
1553
1553
|
console.log();
|
|
1554
|
-
process.
|
|
1554
|
+
process.exitCode = 0; return;
|
|
1555
1555
|
}
|
|
1556
1556
|
|
|
1557
1557
|
// Default no-arg → discover
|
|
@@ -1576,7 +1576,8 @@ async function main() {
|
|
|
1576
1576
|
const names = targets.filter(t => !t.startsWith('--'));
|
|
1577
1577
|
if (names.length === 0) {
|
|
1578
1578
|
console.log(` ${c.red}Error: package name required${c.reset}`);
|
|
1579
|
-
process.
|
|
1579
|
+
process.exitCode = 2;
|
|
1580
|
+
return;
|
|
1580
1581
|
}
|
|
1581
1582
|
const results = [];
|
|
1582
1583
|
for (const t of names) {
|
|
@@ -1586,7 +1587,7 @@ async function main() {
|
|
|
1586
1587
|
if (jsonMode) {
|
|
1587
1588
|
console.log(JSON.stringify(results.length === 1 ? (results[0] || { error: 'not_found' }) : results, null, 2));
|
|
1588
1589
|
}
|
|
1589
|
-
process.
|
|
1590
|
+
process.exitCode = 0; return;
|
|
1590
1591
|
return;
|
|
1591
1592
|
}
|
|
1592
1593
|
|
|
@@ -1597,7 +1598,8 @@ async function main() {
|
|
|
1597
1598
|
console.log(` ${c.red}Error: at least one repository URL required${c.reset}`);
|
|
1598
1599
|
console.log(` ${c.dim}Tip: use ${c.cyan}agentaudit discover${c.dim} to find & check locally installed MCP servers${c.reset}`);
|
|
1599
1600
|
console.log(` ${c.dim}Tip: use ${c.cyan}agentaudit audit <url>${c.dim} for a deep LLM-powered audit${c.reset}`);
|
|
1600
|
-
process.
|
|
1601
|
+
process.exitCode = 2;
|
|
1602
|
+
return;
|
|
1601
1603
|
}
|
|
1602
1604
|
|
|
1603
1605
|
// --deep redirects to audit flow
|
|
@@ -1607,7 +1609,7 @@ async function main() {
|
|
|
1607
1609
|
const report = await auditRepo(url);
|
|
1608
1610
|
if (report?.findings?.length > 0) hasFindings = true;
|
|
1609
1611
|
}
|
|
1610
|
-
process.
|
|
1612
|
+
process.exitCode = hasFindings ? 1 : 0;
|
|
1611
1613
|
return;
|
|
1612
1614
|
}
|
|
1613
1615
|
|
|
@@ -1638,9 +1640,9 @@ async function main() {
|
|
|
1638
1640
|
printSummary(results);
|
|
1639
1641
|
}
|
|
1640
1642
|
|
|
1641
|
-
if (hadErrors && results.length === 0) process.
|
|
1643
|
+
if (hadErrors && results.length === 0) { process.exitCode = 2; return; }
|
|
1642
1644
|
const totalFindings = results.reduce((sum, r) => sum + r.findings.length, 0);
|
|
1643
|
-
process.
|
|
1645
|
+
process.exitCode = totalFindings > 0 ? 1 : 0;
|
|
1644
1646
|
return;
|
|
1645
1647
|
}
|
|
1646
1648
|
|
|
@@ -1648,7 +1650,8 @@ async function main() {
|
|
|
1648
1650
|
const urls = targets.filter(t => !t.startsWith('--'));
|
|
1649
1651
|
if (urls.length === 0) {
|
|
1650
1652
|
console.log(` ${c.red}Error: at least one repository URL required${c.reset}`);
|
|
1651
|
-
process.
|
|
1653
|
+
process.exitCode = 2;
|
|
1654
|
+
return;
|
|
1652
1655
|
}
|
|
1653
1656
|
|
|
1654
1657
|
let hasFindings = false;
|
|
@@ -1656,16 +1659,16 @@ async function main() {
|
|
|
1656
1659
|
const report = await auditRepo(url);
|
|
1657
1660
|
if (report?.findings?.length > 0) hasFindings = true;
|
|
1658
1661
|
}
|
|
1659
|
-
process.
|
|
1662
|
+
process.exitCode = hasFindings ? 1 : 0;
|
|
1660
1663
|
return;
|
|
1661
1664
|
}
|
|
1662
1665
|
|
|
1663
1666
|
console.log(` ${c.red}Unknown command: ${command}${c.reset}`);
|
|
1664
1667
|
console.log(` ${c.dim}Run agentaudit --help for usage${c.reset}`);
|
|
1665
|
-
process.
|
|
1668
|
+
process.exitCode = 2;
|
|
1666
1669
|
}
|
|
1667
1670
|
|
|
1668
1671
|
main().catch(err => {
|
|
1669
1672
|
console.error(`${c.red}Error: ${err.message}${c.reset}`);
|
|
1670
|
-
process.
|
|
1673
|
+
process.exitCode = 2;
|
|
1671
1674
|
});
|
package/index.mjs
CHANGED
|
@@ -268,9 +268,14 @@ async function checkRegistry(slug) {
|
|
|
268
268
|
|
|
269
269
|
// ── MCP Server ───────────────────────────────────────────
|
|
270
270
|
|
|
271
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
|
|
272
|
+
|
|
271
273
|
const server = new Server(
|
|
272
|
-
{ name: 'agentaudit', version:
|
|
273
|
-
{
|
|
274
|
+
{ name: 'agentaudit', version: pkg.version },
|
|
275
|
+
{
|
|
276
|
+
capabilities: { tools: {} },
|
|
277
|
+
instructions: 'AgentAudit — Security scanner for AI packages. Use discover_servers to find MCP servers in editor configs, check_package for registry lookups, audit_package for deep LLM-powered code analysis, and submit_report to upload findings.',
|
|
278
|
+
}
|
|
274
279
|
);
|
|
275
280
|
|
|
276
281
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|