break-anything 0.1.0 → 0.3.0

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 CHANGED
@@ -4,249 +4,221 @@
4
4
 
5
5
  # Break Anything
6
6
 
7
- ### One MCP for finding vulnerabilities across code, dependencies, apps, and infrastructure.
7
+ ### You think your service is secure. You've never seen it the way an attacker would.
8
8
 
9
- **Break it before they do. Point your agent at software you own, find the weakness, prove it, fix it.**
9
+ Break Anything points your coding agent at your own code, apps, and infrastructure and hunts them
10
+ **like an attacker** — surfacing what's genuinely exploitable, proving it on your own build, and
11
+ fixing it. Before someone else finds it first.
12
+
13
+ *See your own service through an attacker's eyes.*
10
14
 
11
15
  [![npm version](https://img.shields.io/badge/npm-break--anything-cb3837?style=flat-square)](https://www.npmjs.com/package/break-anything)
12
16
  [![MCP tool catalog](https://img.shields.io/badge/MCP-tool_catalog-5c4ee5?style=flat-square)](docs/mcp-tools.md)
13
17
  [![Authorized use only](https://img.shields.io/badge/scope-authorized_targets_only-d13438?style=flat-square)](DISCLAIMER.md)
14
18
  [![MIT license](https://img.shields.io/badge/license-MIT-f4c430?style=flat-square)](LICENSE)
15
19
 
16
- **[Quick start](#quick-start) · [How it works](#how-break-anything-works) · [What you can test](#what-you-can-test) · [Showcases](#showcases) · [FAQ](#faq) · [Companion: Patch Anything](#companion-patch-anything)**
20
+ **[Quick start](#quick-start) · [Why it's different](#why-its-different) · [See it in 30s](#see-it-in-30-seconds) · [The arsenal](#the-arsenal) · [FAQ](#faq)**
17
21
 
18
22
  <code>npx break-anything setup</code>
19
23
 
20
24
  </div>
21
25
 
22
26
  > [!IMPORTANT]
23
- > Break Anything finds weaknesses in software **you own or are explicitly authorized to test**.
24
- > It is a defensive, white-box security tool: every finding comes with evidence and a
25
- > remediation path, and every proof-of-concept runs against your own target.
26
- > It is not an attack framework and must not be pointed at third-party systems.
27
-
28
- > [!WARNING]
29
- > Get Break Anything only from the official sources listed in this README and in the
30
- > `break-anything` npm package. A similar repository name or a copied README does not
31
- > make a download official.
27
+ > Break Anything tests software **you own or are explicitly authorized to test**. Every
28
+ > proof-of-concept runs against your own target. It's a defensive tool, not an attack framework,
29
+ > and must never be pointed at third-party systems.
32
30
 
33
31
  <div align="center">
34
32
 
35
- <!-- Record with: asciinema rec hero.cast -c "bash demos/hero-demo.sh" && agg hero.cast docs/assets/hero.gif -->
36
- <img src="docs/assets/hero.gif" alt="Break Anything finding reachable CVEs and a secret buried in git history" width="900" />
33
+ <!-- Record with: vhs demos/hero.tape -->
34
+ <img src="docs/assets/hero.gif" alt="Break Anything: which vulnerabilities actually reach your code, plus a secret hiding in git history" width="900" />
37
35
 
38
36
  </div>
39
37
 
40
38
  ---
41
39
 
42
- See a vulnerability land in the news and wonder whether *your* project is exposed? Ask your agent
43
- to check it with Break Anything. It inspects your code, dependencies, running app, and
44
- infrastructure without you learning ten different scanners, explains **where** you are
45
- vulnerable, proves it with a reproducible finding, and hands a fix plan to your agent — or to
46
- [Patch Anything](#companion-patch-anything).
40
+ "It's probably fine." It shipped, it works, nobody has complained — so you assume it's secure. But
41
+ "no breach yet" was never a security test. The only honest one is to look at your own service the
42
+ way an attacker will: which dependency is an open door, what key is still in your git history,
43
+ which endpoint hands over another user's data.
47
44
 
48
- Break Anything connects your coding agent to mature security tooling (Semgrep, CodeQL, OSV,
49
- Trivy, Grype, Nuclei, ZAP, gitleaks, and more) through one consistent interface. You can also
50
- run the same capabilities from your terminal. Analysis runs locally, and every result carries
51
- the evidence, the exploitability signal, and the limitations behind it.
45
+ And you're never done. A critical unauthenticated RCE turned up in PHP itself in October 2026 after
46
+ years in plain sight (php2shell) — if the language behind much of the web still has critical holes,
47
+ so does your app. Every dependency you add widens the surface, and you can't close them all. So fix
48
+ the few an attacker can reach *today*.
52
49
 
53
- Most scanners stop at "here is a CVE list, bump the version." Break Anything goes further: it
54
- reasons about whether a finding is **actually reachable in your usage**, builds a
55
- proof-of-concept against **your own** target, and — when upstream has no fix — proposes a patch,
56
- a shim, or a mitigation so an abandoned dependency does not become your breach.
57
-
58
- ## Quick start
50
+ And the economics just flipped: the same AI agents that write code now hunt vulnerabilities at
51
+ scale — and attackers have them too. Find your holes first, with the same leverage.
59
52
 
60
- ### Set up your agent
53
+ **Break Anything gives your coding agent that attacker's-eye view** — in one sentence, on software
54
+ you own: what's genuinely exploitable, proven on *your* build, with the fix. Everything runs
55
+ locally. Nothing is pointed anywhere you don't own.
61
56
 
62
- With Node.js and npm installed, run:
57
+ ## Quick start
63
58
 
64
59
  ```bash
65
60
  npx break-anything setup
66
61
  ```
67
62
 
68
- Choose your agents, review the proposed changes, and approve them. Setup registers Break
69
- Anything's MCP server and installs matching workflow instructions, with backups of existing
70
- configuration. Restart your agent afterward.
63
+ One command. It auto-detects Claude Desktop, Claude Code, Cursor, Codex, Gemini CLI and Windsurf
64
+ on your machine and registers Break Anything into each — backing up every file it touches,
65
+ preserving your other servers, safe to re-run. Restart your agent, then just ask:
71
66
 
72
- Setup supports Claude Code, Codex, Cursor, Gemini CLI, Windsurf, and any client that can run a
73
- local MCP server. See [installation](docs/installation.md) for manual registration.
67
+ ```text
68
+ Use Break Anything on this project. Show me only the vulnerabilities that are
69
+ actually reachable in my code, prove the worst one, and give me the fix.
70
+ ```
74
71
 
75
- ### Ask your agent
72
+ Prefer the terminal? One command, shipped today:
76
73
 
77
- ```text
78
- Use Break Anything to check my project for vulnerabilities. Prioritise anything
79
- that is actually reachable in my code, prove it against my local build, and give
80
- me a fix plan.
74
+ ```bash
75
+ npx -y break-anything deps ./ # dependency CVEs, ranked by reachability + EPSS
76
+ npx -y break-anything secrets ./ --history # leaked keys in the tree and full git history
77
+ npx -y break-anything image my-svc:latest # OS + app CVEs in a container image
78
+ npx -y break-anything sast ./src # static code analysis (injection, authz, SSRF…)
81
79
  ```
82
80
 
83
- Replace the request with your target — a repository, a lockfile, a running localhost app, a
84
- container image, or a Terraform directory.
81
+ ## Why it's different
85
82
 
86
- ### Use the terminal
83
+ Every scanner can hand you a list. The list is the problem. Break Anything is built around the
84
+ three things a list can't do:
87
85
 
88
- ```bash
89
- # Dependencies: known CVEs ranked by reachability + EPSS, with fix versions
90
- npx -y break-anything deps ./
86
+ - **Reachability — it thinks like an attacker.** An attacker doesn't work through 400 theoretical
87
+ CVEs; they go straight for the few they can actually reach. Break Anything does the same:
88
+ `confirmed` → `reachable` → `present` → `not-reachable`. The vulnerable `lodash` you never call
89
+ is noise; the one on a live code path is the finding. You triage 3, not 400.
90
+ - **Proof, not prose.** Instead of a CVSS paragraph, it builds a proof-of-concept against *your*
91
+ build — the exact input or request that breaks it — so "theoretically vulnerable" becomes
92
+ "here's the repro."
93
+ - **A fix, even when upstream is gone.** No patched version because the maintainer vanished? It
94
+ proposes a patch, a pin, a compatibility shim, or a maintained fork — so an abandoned dependency
95
+ doesn't become your breach. Hand it to [Patch Anything](#companion-patch-anything) for a
96
+ merge-ready PR.
91
97
 
92
- # Secrets: leaked keys in the working tree and (with --history) git history
93
- npx -y break-anything secrets ./ --history
98
+ It doesn't replace OSV, Trivy, Semgrep or ZAP — it **orchestrates** them behind one agent
99
+ interface and does the reasoning they can't.
94
100
 
95
- # Container image: OS + app CVEs via Trivy
96
- npx -y break-anything image my-service:latest
97
- ```
101
+ ## See it in 30 seconds
98
102
 
99
- > Shipped today: `deps`, `secrets`, `image`, and the matching MCP tools. The rest of the
100
- > [tool catalog](docs/mcp-tools.md) is the roadmap, landing incrementally.
103
+ Three things you'll reach for it, each one sentence to your agent:
101
104
 
102
- To install the `brk` command for regular use:
105
+ | The moment | Ask | What you get back |
106
+ | --- | --- | --- |
107
+ | **"A CVE is trending — are we hit?"** | *"Scan my deps, only flag what's reachable."* | 3 reachable CVEs with fix versions — not a 400-line wall |
108
+ | **"Did someone commit a key?"** | *"Scan the repo and git history for secrets."* | The leaked key, the commit that introduced it, "rotate don't delete" |
109
+ | **"Can user A read user B's data?"** | *"Check /orders/:id for broken access control."* | The IDOR, proven against localhost with two accounts |
103
110
 
104
- ```bash
105
- npm install --global break-anything
106
- brk --help
107
- ```
111
+ ## What you point it at
112
+
113
+ You don't pick a mode. Hand it whatever you have — it detects the form and routes to the right
114
+ engine.
108
115
 
109
- > The CLI command is `brk` (not `break`, which is a shell keyword).
116
+ | You give it | Form | Categories |
117
+ | --- | --- | --- |
118
+ | A repo or source tree | source / tech stack | SCA, SAST, Secrets |
119
+ | A lockfile (`package-lock.json`, `composer.lock`, `go.mod`…) | manifest | SCA |
120
+ | A container image | build artifact | Containers |
121
+ | An APK / IPA or compiled binary | build artifact | Mobile, Fuzzing |
122
+ | A Terraform / Kubernetes / Dockerfile | config | IaC |
123
+ | A running URL or API (yours) | live system | DAST, API |
124
+ | Cloud credentials (yours) | live account | Cloud posture |
125
+ | Git history | repo metadata | Secrets |
110
126
 
111
- ### Update
127
+ ## The arsenal
112
128
 
113
- ```bash
114
- brk update
115
- ```
129
+ Organized by scan category — the language security teams speak — each orchestrating tools that
130
+ already run in real pipelines. ✅ shipped in 0.1.0 · 🧭 on the roadmap.
116
131
 
117
- ## How Break Anything works
132
+ ### ✅ Shipped today
118
133
 
119
- Your agent calls Break Anything through MCP to inspect a target you control. Break Anything
120
- returns each finding with its evidence, an exploitability signal, and a suggested remediation.
121
- The agent uses that to prioritise, reproduce, and fix. CLI commands use the same workflows.
134
+ - **Dependencies (SCA)** — known CVEs across your whole tree, ranked by reachability + EPSS, with fix versions. Engines: [OSV](https://osv.dev), [Trivy](https://github.com/aquasecurity/trivy), [Grype](https://github.com/anchore/grype), `pip-audit`, `govulncheck`, `composer audit`. Ecosystems: npm, PyPI, Composer, Go, Maven, Cargo, RubyGems, NuGet.
135
+ - **Secrets** — leaked keys/tokens/private keys in the working tree and full git history, redacted. Engines: [Gitleaks](https://github.com/gitleaks/gitleaks), [TruffleHog](https://github.com/trufflesecurity/trufflehog).
136
+ - **Container images** — OS + app CVEs, Dockerfile smells, secrets in layers. Engines: [Trivy](https://github.com/aquasecurity/trivy), [Grype](https://github.com/anchore/grype), [Hadolint](https://github.com/hadolint/hadolint).
137
+ - **Static code (SAST)** — injection, broken access control, insecure deserialization, SSRF, hardcoded secrets — each with file/line, CWE/OWASP tags, and the offending snippet. Engine: [Semgrep](https://semgrep.dev).
122
138
 
123
- ![Break Anything flow: your agent points at an authorized target; Break Anything routes to the right analysis engine, confirms reachability, and returns findings with evidence and a fix plan.](docs/assets/break-flow.svg)
139
+ ### 🧭 On the roadmap
124
140
 
125
- The investigation model:
141
+ - **More SAST engines** — [CodeQL](https://codeql.github.com), SonarQube CE, Bandit (Python), gosec (Go), Brakeman (Rails), Find-Sec-Bugs (Java), security-code-scan (.NET), retire.js (frontend JS).
142
+ - **Infrastructure & Kubernetes (IaC)** — public buckets, open ports, over-broad IAM, misconfigured clusters — before `apply`. [Checkov](https://www.checkov.io), tfsec, Terrascan, [KICS](https://kics.io), [Kubescape](https://github.com/kubescape/kubescape), kube-bench, [Falco](https://falco.org) (runtime).
143
+ - **Running apps & attack surface (DAST)** — OWASP Top 10, content/parameter discovery, XSS, injection against your authorized app. [OWASP ZAP](https://www.zaproxy.org), [Nuclei](https://github.com/projectdiscovery/nuclei), [Nikto](https://github.com/sullo/nikto), [ffuf](https://github.com/ffuf/ffuf), [Katana](https://github.com/projectdiscovery/katana), [Dalfox](https://github.com/hahwul/dalfox), [sqlmap](https://sqlmap.org); surface mapping via [Nmap](https://nmap.org) + [Amass](https://github.com/owasp-amass/amass) + ProjectDiscovery.
144
+ - **API** — BOLA/IDOR, broken auth, mass assignment (OWASP API Top 10). [Schemathesis](https://github.com/schemathesis/schemathesis), ZAP.
145
+ - **Offensive / exploitation** — *authorized pentest only; gated, off by default, written permission required.* Prove exploitability on targets you own. [Metasploit](https://www.metasploit.com), sqlmap, [Hydra](https://github.com/vanhauser-thc/thc-hydra), [Hashcat](https://hashcat.net), [BloodHound](https://github.com/SpecterOps/BloodHound) + Impacket (Active Directory), [OpenVAS](https://www.openvas.org).
146
+ - **AI / LLM security** — prompt injection, jailbreaks, data leakage in your own models and agents. [Garak](https://github.com/NVIDIA/garak).
147
+ - **Binary & artifact analysis** — known-vulnerable deps and unsafe patterns in compiled binaries. [Ghidra](https://ghidra-sre.org), [radare2](https://github.com/radareorg/radare2), [angr](https://github.com/angr/angr) (pairs with REA).
148
+ - **Cloud posture · Smart contracts · Mobile · Fuzzing** — [Prowler](https://github.com/prowler-cloud/prowler) · [Slither](https://github.com/crytic/slither), Mythril, Echidna · [MobSF](https://github.com/MobSF/Mobile-Security-Framework-MobSF) · [AFL++](https://github.com/AFLplusplus/AFLplusplus), libFuzzer, Jazzer.
126
149
 
127
- | Stage | What happens |
128
- | --- | --- |
129
- | **Find** | Enumerate weaknesses across dependencies, source, running app, and infrastructure. |
130
- | **Prove** | Confirm the finding is reachable in your usage and build a proof-of-concept against *your* target. |
131
- | **Fix** | Produce a patch, pin, shim, or mitigation — directly, or by handing off to Patch Anything. |
150
+ Full per-tool catalog and MCP contracts: [docs/mcp-tools.md](docs/mcp-tools.md). Every dynamic
151
+ (traffic-sending) category is **off by default** and refuses any target not on your allowlist.
132
152
 
133
- Break Anything shows how it reached each conclusion. It separates "confirmed exploitable",
134
- "reachable but unproven", and "present but not reachable" instead of drowning you in noise.
153
+ ## How it works
135
154
 
136
- ## What you can test
155
+ Your agent calls Break Anything over MCP to inspect a target you control. It routes to the right
156
+ engine, confirms reachability, and returns each finding with its evidence and a fix. The CLI uses
157
+ the same workflows.
137
158
 
138
- | Target | What Break Anything returns | Requirements |
139
- | --- | --- | --- |
140
- | Dependency manifests | Known CVEs across `package-lock`, `requirements.txt`, `go.mod`, `composer.lock`, `pom.xml`, `Cargo.toml`; EPSS exploit probability; CISA KEV status; fix versions; call-path reachability | OSV / GHSA (built-in); reachability uses local source |
141
- | Source code | Injection, broken access control, insecure deserialization, path traversal, SSRF, hardcoded secrets — with data-flow evidence | Semgrep / CodeQL rulepacks |
142
- | Secrets in repo + git history | Exposed API keys, tokens, private keys, and where they leaked | gitleaks / trufflehog style scan |
143
- | Running web app (your host) | OWASP Top 10 dynamic findings against an authorized localhost or staging target | A Chrome-family browser; OWASP ZAP |
144
- | HTTP APIs (your host) | Broken access control, IDOR, auth bypass, mass assignment — with a reproducible request | Authorized base URL + credentials |
145
- | Container images | OS and application-layer CVEs, misconfigurations, exposed secrets in layers | Trivy / Grype |
146
- | Dockerfile / IaC | Misconfigurations in Dockerfile, Terraform, Kubernetes, CloudFormation | Trivy / checkov rulepacks |
147
- | Web frontend bundles | Vulnerable JS libraries and secrets shipped to the browser | Node.js + npm |
148
- | Compiled artifacts | Known-vulnerable bundled dependencies and memory-safety smells | Static inspection |
149
- | Smart contracts (optional) | Reentrancy, integer overflow, access-control gaps in Solidity | Slither |
150
-
151
- Every dynamic capability is **disabled by default** and requires both an operator policy and an
152
- explicit per-run authorization flag. Static inspection reads your files without running them.
153
-
154
- ## Showcases
155
-
156
- Ten worked demos — **all on targets you own, open-source projects, or deliberately vulnerable
157
- labs**. See [`demos/`](demos/) for the full scripts.
158
-
159
- 1. **OWASP Juice Shop** — point at the authorized lab, find an IDOR, prove it with a request, explain the fix.
160
- 2. **The dependency you forgot** — an old `lodash`/`minimist` in your lockfile: find it, confirm the vulnerable function is actually called, get the fix version.
161
- 3. **PHP supply chain after php2shell** — a PHP project pinned to a vulnerable `composer` dependency: Break Anything maps your whole dependency chain so the *next* php2shell does not catch you blind.
162
- 4. **Log4Shell lab** — a Java service with a vulnerable `log4j`: confirm reachability through your logging path, not just presence.
163
- 5. **Leaked key** — a test repo with an AWS key committed three months ago: find it in history, show the blast radius.
164
- 6. **Vulnerable base image** — a `Dockerfile` on an outdated base: list OS + app CVEs and the minimal bump.
165
- 7. **Public bucket** — a Terraform file that makes an S3 bucket world-readable: catch it before `apply`.
166
- 8. **Your own Express API** — an IDOR on `/orders/:id`: prove it against localhost with two accounts.
167
- 9. **Reentrancy** — a Solidity contract in a lab: trace the external call before the state update.
168
- 10. **Find → Fix handoff** — hand any finding above to [Patch Anything](#companion-patch-anything) and watch the fix PR get drafted.
169
-
170
- If you break something interesting (that you are allowed to break), open an issue or PR with the
171
- target, your question, and what you found.
159
+ ![Find, prove, fix flow](docs/assets/break-flow.svg)
172
160
 
173
- ## Companion: Patch Anything
161
+ **Find** weaknesses across deps, code, secrets, images, IaC, and running apps → **Prove** the
162
+ finding is reachable with a PoC against your target → **Fix** it inline or via Patch Anything.
163
+ Absence of a finding is never reported as proof of safety.
174
164
 
175
- Break Anything and [Patch Anything](https://github.com/PatchAnything/patch-anything) are built to
176
- work as a pair:
165
+ ## Companion: Patch Anything
177
166
 
178
- > **Break Anything** finds it and proves it → **Patch Anything** fixes it.
167
+ > **Break Anything** finds it and proves it → **[Patch Anything](https://github.com/EnkiHQ/patch-anything)** fixes it.
179
168
 
180
- When Break Anything surfaces a finding, your agent can hand it straight to Patch Anything, which
181
- generates a patch, a dependency bump, a compatibility shim, or — when upstream is dead — a
182
- maintained fork or local mitigation. One is offense-flavoured discovery; the other is defensive
183
- repair. Use either alone, or run the loop end to end.
169
+ Hand any finding over and it drafts the patch, bump, shim, or fork. Discovery and repair, one
170
+ loop. Use either alone, or run it end to end.
184
171
 
185
172
  ## FAQ
186
173
 
187
174
  <details>
188
- <summary><strong>Is this an attack tool? Will it get my repo taken down?</strong></summary>
175
+ <summary><strong>How is this different from `npm audit` / Trivy / Snyk?</strong></summary>
189
176
 
190
- No. Break Anything is a defensive, white-box tool for software you own or are authorized to
191
- test. Every proof-of-concept runs against your own target; it ships no weaponized exploits for
192
- third-party systems. See [DISCLAIMER.md](DISCLAIMER.md). GitHub's policy explicitly supports
193
- dual-use security research.
177
+ They report presence — every vulnerability that exists anywhere in your tree. Break Anything adds
178
+ **reachability** (is it actually called), **proof** (a PoC against your own build), and
179
+ **self-remediation** when upstream has no fix, and unifies deps, code, secrets, images, IaC, and
180
+ runtime behind one agent interface.
194
181
 
195
182
  </details>
196
183
 
197
184
  <details>
198
- <summary><strong>How is this different from `npm audit` / Trivy / Snyk?</strong></summary>
185
+ <summary><strong>Does it replace those tools?</strong></summary>
199
186
 
200
- Those report presence. Break Anything adds **reachability** (is the vulnerable code actually
201
- called in your project), **proof** (a PoC against your own build), and **self-remediation** when
202
- upstream has no fix. It also unifies dependency, source, runtime, and infrastructure findings
203
- behind one agent interface.
187
+ No — it orchestrates them. Break Anything is the brain and the interface; OSV, Trivy, Semgrep, ZAP
188
+ are the engines. You get their depth without learning each one.
204
189
 
205
190
  </details>
206
191
 
207
192
  <details>
208
- <summary><strong>Which agents can use it?</strong></summary>
193
+ <summary><strong>Is this an attack tool? Will my repo get taken down?</strong></summary>
209
194
 
210
- Any agent that supports local MCP servers. Setup configures the common ones automatically;
211
- others can use manual MCP registration.
195
+ No. It's defensive and authorized-targets-only; every PoC runs against your own target and it
196
+ ships no weaponized exploits. See [DISCLAIMER.md](DISCLAIMER.md). GitHub policy explicitly supports
197
+ dual-use security research.
212
198
 
213
199
  </details>
214
200
 
215
201
  <details>
216
202
  <summary><strong>Does it upload my code?</strong></summary>
217
203
 
218
- Analysis runs locally. Your agent receives the tool results, and its model provider has its own
219
- data policy — review that separately.
204
+ Analysis runs locally. Your agent receives the results; its model provider has its own data
205
+ policy — review that separately.
220
206
 
221
207
  </details>
222
208
 
223
209
  <details>
224
- <summary><strong>Can it test a site I do not own?</strong></summary>
210
+ <summary><strong>Which agents can use it?</strong></summary>
225
211
 
226
- No. Dynamic capabilities require an explicit authorization flag and are intended for your own or
227
- contractually authorized targets. Testing systems without authorization is illegal and
228
- unsupported.
212
+ Any agent that supports local MCP servers. Setup configures the common ones automatically.
229
213
 
230
214
  </details>
231
215
 
232
216
  ## Documentation
233
217
 
234
- - [Installation and setup](docs/installation.md)
235
- - [MCP tool catalog](docs/mcp-tools.md)
236
- - [Security model](SECURITY.md)
237
- - [Responsible use](DISCLAIMER.md)
238
-
239
- ## Disclaimer
240
-
241
- Break Anything is for lawful security research, education, and testing of software you own or are
242
- authorized to examine. See [DISCLAIMER.md](DISCLAIMER.md) for responsible-use guidance. You are
243
- responsible for using this software in compliance with all applicable laws and the terms of any
244
- third-party tool it orchestrates.
218
+ [Installation](docs/installation.md) · [Tool catalog & MCP contracts](docs/mcp-tools.md) ·
219
+ [Roadmap](docs/roadmap.md) · [Security model](SECURITY.md) · [Responsible use](DISCLAIMER.md)
245
220
 
246
221
  ## License
247
222
 
248
- [MIT](LICENSE)
249
-
250
- Break-authored code is licensed under MIT. Third-party tools it orchestrates (Semgrep, CodeQL,
251
- Trivy, Grype, Nuclei, ZAP, and others) retain their own licenses; you must obtain and use them
252
- under their applicable terms.
223
+ [MIT](LICENSE). Break-authored code is MIT; the engines it orchestrates keep their own licenses —
224
+ see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
package/bin/brk.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { scanDependencies } from "../src/scan.js";
3
3
  import { renderHuman } from "../src/report.js";
4
4
 
5
- const VERSION = "0.1.0";
5
+ const VERSION = "0.3.0";
6
6
 
7
7
  const HELP = `Break Anything (brk) v${VERSION}
8
8
  点你的 Agent 指向你拥有或已授权的软件,找到漏洞、证明它、修好它。
@@ -11,9 +11,10 @@ const HELP = `Break Anything (brk) v${VERSION}
11
11
  brk deps [path] 扫描依赖 lockfile 的已知漏洞(默认当前目录)
12
12
  brk secrets [path] 扫描泄露的密钥(工作区,--history 加扫 git 历史)
13
13
  brk image <ref> 扫描容器镜像的已知漏洞(需 trivy)
14
+ brk sast [path] 静态代码分析找漏洞(需 semgrep)
14
15
  brk mcp 以 MCP server 模式启动(供 Agent 调用)
15
16
  brk doctor 检查运行环境与网络连通性
16
- brk setup 打印把 Break Anything 接入 Agent 的 MCP 配置
17
+ brk setup 自动把 Break Anything 注册进本机各家 Agent(--dry-run 预演,--print 仅打印配置)
17
18
  brk --help 显示本帮助
18
19
  brk --version 显示版本
19
20
 
@@ -35,6 +36,7 @@ function parseFlags(argv) {
35
36
  if (a === "--json") flags.json = true;
36
37
  else if (a === "--no-reachability") flags.reachability = false;
37
38
  else if (a === "--no-color") flags.color = false;
39
+ else if (a.startsWith("--") && a.includes("=")) { const [k, v] = a.slice(2).split("="); flags[k] = v; }
38
40
  else if (a.startsWith("--")) flags[a.slice(2)] = true;
39
41
  else positional.push(a);
40
42
  }
@@ -69,7 +71,7 @@ async function main() {
69
71
  process.stdout.write(JSON.stringify(result, null, 2) + "\n");
70
72
  } else {
71
73
  const color = flags.color !== false && process.stdout.isTTY;
72
- process.stdout.write(renderHuman(result, { color }) + "\n");
74
+ process.stdout.write(renderHuman(result, { color, top: flags.top ? Number(flags.top) : undefined }) + "\n");
73
75
  }
74
76
  // 有高危且可达的发现时用非零退出码,方便接 CI
75
77
  const hasReachableHigh = result.findings?.some(
@@ -117,13 +119,61 @@ async function main() {
117
119
  return;
118
120
  }
119
121
 
122
+ if (cmd === "sast") {
123
+ const { flags, positional } = parseFlags(rest);
124
+ const target = positional[0] || process.cwd();
125
+ const { scanSast } = await import("../src/sast.js");
126
+ const { renderSast } = await import("../src/report.js");
127
+ const result = await scanSast(target, flags.config ? { config: flags.config } : {});
128
+ if (flags.json) {
129
+ process.stdout.write(JSON.stringify(result, null, 2) + "\n");
130
+ } else {
131
+ const color = flags.color !== false && process.stdout.isTTY;
132
+ process.stdout.write(renderSast(result, { color, top: flags.top ? Number(flags.top) : undefined }) + "\n");
133
+ }
134
+ const hasHigh = result.findings?.some((f) => f.severity === "CRITICAL" || f.severity === "HIGH");
135
+ process.exitCode = hasHigh ? 1 : 0;
136
+ return;
137
+ }
138
+
120
139
  if (cmd === "doctor") {
121
140
  await doctor();
122
141
  return;
123
142
  }
124
143
 
125
144
  if (cmd === "setup") {
126
- printSetup();
145
+ const { flags } = parseFlags(rest);
146
+ const { runSetup, manualConfig } = await import("../src/setup.js");
147
+ if (flags.print) {
148
+ process.stdout.write(
149
+ "把下面的配置加入你的 MCP 客户端,然后重启 Agent:\n\n" +
150
+ JSON.stringify(manualConfig, null, 2) + "\n",
151
+ );
152
+ return;
153
+ }
154
+ const dry = !!flags["dry-run"];
155
+ const { results, absent, anyPresent } = await runSetup({ dryRun: dry });
156
+ process.stdout.write(`Break Anything · setup${dry ? " (dry run)" : ""}\n\n`);
157
+ if (!anyPresent) {
158
+ process.stdout.write(
159
+ "未检测到受支持的 Agent。把下面的配置手动加入你的 MCP 客户端:\n\n" +
160
+ JSON.stringify(manualConfig, null, 2) + "\n",
161
+ );
162
+ return;
163
+ }
164
+ const label = {
165
+ created: "✓ 已注册(新建配置)", updated: "✓ 已注册", already: "• 已存在,无需改动",
166
+ "would-create": "将新建并注册", "would-update": "将注册",
167
+ skipped: "⚠ 跳过", error: "✗ 出错",
168
+ };
169
+ for (const r of results) {
170
+ process.stdout.write(` ${label[r.status] || r.status} ${r.agent.name}\n`);
171
+ process.stdout.write(` ${r.agent.file}\n`);
172
+ if (r.backup) process.stdout.write(` 已备份原配置 → ${r.backup}\n`);
173
+ if (r.reason) process.stdout.write(` ${r.reason}\n`);
174
+ }
175
+ if (absent.length) process.stdout.write(`\n未检测到(已跳过):${absent.map((a) => a.name).join("、")}\n`);
176
+ if (!dry) process.stdout.write(`\n重启你的 Agent,然后对它说:"用 Break Anything 扫描我的项目"。\n`);
127
177
  return;
128
178
  }
129
179
 
@@ -149,19 +199,6 @@ async function doctor() {
149
199
  process.stdout.write(out.join("\n") + "\n");
150
200
  }
151
201
 
152
- function printSetup() {
153
- const config = {
154
- mcpServers: {
155
- "break-anything": { command: "npx", args: ["-y", "break-anything", "mcp"] },
156
- },
157
- };
158
- process.stdout.write(
159
- "把下面的配置加入你的 MCP 客户端(Claude Code / Cursor / Codex 等):\n\n" +
160
- JSON.stringify(config, null, 2) +
161
- "\n\n然后重启 Agent,对它说:用 Break Anything 扫描我的项目依赖。\n",
162
- );
163
- }
164
-
165
202
  main().catch((err) => {
166
203
  process.stderr.write(`错误:${err instanceof Error ? err.stack || err.message : String(err)}\n`);
167
204
  process.exitCode = 1;
Binary file
package/docs/hero-gif.md CHANGED
@@ -1,53 +1,51 @@
1
- # Hero GIF — recording recipe
1
+ # Hero GIF — how it's made
2
2
 
3
- The single most important launch asset. 25–35 seconds, no narration, the README's first image.
3
+ The README's first image. Short (~12s), tight, cool, real tool output. Generated with
4
+ [VHS](https://github.com/charmbracelet/vhs) from a repeatable script.
4
5
 
5
6
  ## What it shows
6
7
 
7
- The runnable script [`demos/hero-demo.sh`](../demos/hero-demo.sh) produces three beats, all on
8
- targets you own:
8
+ Two beats:
9
9
 
10
- 1. **The forgotten dependency** — `cat` a `package.json` pinned to an old `lodash`.
11
- 2. **The scan** — `brk deps` returns real CVEs ranked so the *reachable* criticals rise to the
12
- top. Not a 400-line wall; the few that matter.
13
- 3. **The buried secret** — `brk secrets --history` finds an AWS key that was deleted from the
14
- code but is still sitting in git history, pinned to the commit.
10
+ 1. **Dependencies** — `brk deps` plays a quick scanning animation, then snaps the real top
11
+ findings for an old `lodash`/`minimist`: two CRITICALs + a HIGH at 21.3% EPSS, each tagged
12
+ `reachable`, with fix versions, over a bold `12 findings · 10 reachable` summary.
13
+ 2. **Secrets** — `brk secrets --history` finds an AWS key removed from the code but still in git
14
+ history, pinned to the commit, with the "rotate, don't just delete" warning.
15
15
 
16
- Ending card: `Find → Prove → Fix. npx break-anything`.
16
+ Outro: `# find -> prove -> fix npx break-anything`.
17
17
 
18
- ## Record it
18
+ ## Why the deps output is pre-captured
19
19
 
20
- Install the tools once:
20
+ The `deps` scan hits the OSV network, which adds several seconds of dead air to a recording. So
21
+ the real colored output is captured once, off-camera, and replayed instantly behind a scanning
22
+ animation — the data is genuine, the GIF stays tight.
21
23
 
22
- ```bash
23
- brew install asciinema agg # macOS; agg turns the cast into a GIF
24
- ```
25
-
26
- Record and convert:
24
+ Re-capture it (real, colored, top 3) any time:
27
25
 
28
26
  ```bash
29
- cd /path/to/break-anything
30
- asciinema rec hero.cast -c "bash demos/hero-demo.sh"
31
- agg --font-size 22 --theme monokai hero.cast docs/assets/hero.gif
27
+ script -q demos/.hero/deps.ansi node bin/brk.js deps demos/sample-npm --top=3
32
28
  ```
33
29
 
34
- Then reference it at the top of the README:
30
+ `demos/hero-brk.sh` is the tape's `brk` wrapper: it animates + replays that file for `deps`, and
31
+ runs the real CLI for everything else (`secrets` is local and instant, so it runs live).
35
32
 
36
- ```markdown
37
- <img src="docs/assets/hero.gif" alt="Break Anything finding reachable CVEs and a secret buried in git history" width="900" />
33
+ ## Re-render
34
+
35
+ ```bash
36
+ brew install vhs # once
37
+ vhs demos/hero.tape # writes docs/assets/hero.gif
38
38
  ```
39
39
 
40
- ## Tips for a GIF that spreads
40
+ ## Tuning
41
41
 
42
- - Keep the terminal ~90 columns, large font. People watch these on phones.
43
- - Trim to under 35s. The `deps` result and the "deleted but still in history" reveal are the two
44
- moments that make people stop scrolling — land them fast.
45
- - Do not show a cursor hunting around. The script paces itself; just let it run.
46
- - Record on a clean prompt, dark theme, no personal paths visible (the script uses a temp dir).
47
- - Post the GIF in the README, the Show HN, and the X thread. Same asset everywhere.
42
+ - **Look:** `Set Theme / FontSize / Width / Height / WindowBar / MarginFill / BorderRadius` at the
43
+ top of [`demos/hero.tape`](../demos/hero.tape).
44
+ - **Findings shown:** `--top=N` in the capture command (and the real CLI).
45
+ - **Avoid `→` in `Type` lines** — VHS can drop the multibyte arrow; use `->`. Arrows inside the
46
+ captured `deps.ansi` render fine.
48
47
 
49
- ## Honesty guardrails (keep the credibility that makes it spread)
48
+ ## Guardrails
50
49
 
51
- - Every target in the GIF is a sample project or a throwaway repo you own. Never a third party.
52
- - The CVEs and EPSS numbers are real (live OSV / FIRST.org lookups), so the demo holds up when
53
- someone reruns it. Do not fake the output.
50
+ - Every target is a sample project or a throwaway repo you own — never a third party.
51
+ - The CVEs and EPSS numbers are real (captured from a live OSV / FIRST.org scan). Don't fake them.