bla-agents 1.1.0 → 1.6.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.
Files changed (279) hide show
  1. package/.agents/skills/blind-llm-agents/SKILL.md +20 -14
  2. package/DISCLAIMER.md +15 -7
  3. package/README.md +153 -198
  4. package/dist/bundler/index.d.ts +19 -2
  5. package/dist/bundler/index.d.ts.map +1 -1
  6. package/dist/bundler/index.js +47 -4
  7. package/dist/bundler/index.js.map +1 -1
  8. package/dist/cli.d.ts +5 -0
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/cli.js +123 -18
  11. package/dist/cli.js.map +1 -1
  12. package/dist/core/config.d.ts +54 -0
  13. package/dist/core/config.d.ts.map +1 -0
  14. package/dist/core/config.js +160 -0
  15. package/dist/core/config.js.map +1 -0
  16. package/dist/core/coverage-contract.d.ts +97 -0
  17. package/dist/core/coverage-contract.d.ts.map +1 -0
  18. package/dist/core/coverage-contract.js +164 -0
  19. package/dist/core/coverage-contract.js.map +1 -0
  20. package/dist/core/debug-posture.d.ts +40 -0
  21. package/dist/core/debug-posture.d.ts.map +1 -0
  22. package/dist/core/debug-posture.js +197 -0
  23. package/dist/core/debug-posture.js.map +1 -0
  24. package/dist/core/detector.d.ts.map +1 -1
  25. package/dist/core/detector.js +58 -6
  26. package/dist/core/detector.js.map +1 -1
  27. package/dist/core/identifiers.d.ts +32 -0
  28. package/dist/core/identifiers.d.ts.map +1 -0
  29. package/dist/core/identifiers.js +263 -0
  30. package/dist/core/identifiers.js.map +1 -0
  31. package/dist/core/llm-directives.d.ts +12 -0
  32. package/dist/core/llm-directives.d.ts.map +1 -0
  33. package/dist/core/llm-directives.js +23 -0
  34. package/dist/core/llm-directives.js.map +1 -0
  35. package/dist/core/prng.d.ts +10 -1
  36. package/dist/core/prng.d.ts.map +1 -1
  37. package/dist/core/prng.js +27 -2
  38. package/dist/core/prng.js.map +1 -1
  39. package/dist/core/release-exposure.d.ts.map +1 -1
  40. package/dist/core/release-exposure.js +13 -2
  41. package/dist/core/release-exposure.js.map +1 -1
  42. package/dist/core/release-plan.d.ts +68 -0
  43. package/dist/core/release-plan.d.ts.map +1 -0
  44. package/dist/core/release-plan.js +244 -0
  45. package/dist/core/release-plan.js.map +1 -0
  46. package/dist/core/sarif.d.ts +53 -0
  47. package/dist/core/sarif.d.ts.map +1 -0
  48. package/dist/core/sarif.js +95 -0
  49. package/dist/core/sarif.js.map +1 -0
  50. package/dist/core/sqlite-runtime.d.ts +13 -0
  51. package/dist/core/sqlite-runtime.d.ts.map +1 -1
  52. package/dist/core/sqlite-runtime.js +38 -8
  53. package/dist/core/sqlite-runtime.js.map +1 -1
  54. package/dist/core/types.d.ts +7 -2
  55. package/dist/core/types.d.ts.map +1 -1
  56. package/dist/engine/auditor.d.ts.map +1 -1
  57. package/dist/engine/auditor.js +380 -19
  58. package/dist/engine/auditor.js.map +1 -1
  59. package/dist/engine/benchmark.d.ts +1 -1
  60. package/dist/engine/benchmark.d.ts.map +1 -1
  61. package/dist/engine/benchmark.js +121 -41
  62. package/dist/engine/benchmark.js.map +1 -1
  63. package/dist/engine/defender.d.ts +1 -0
  64. package/dist/engine/defender.d.ts.map +1 -1
  65. package/dist/engine/defender.js +7 -1
  66. package/dist/engine/defender.js.map +1 -1
  67. package/dist/engine/harden.d.ts +61 -0
  68. package/dist/engine/harden.d.ts.map +1 -0
  69. package/dist/engine/harden.js +294 -0
  70. package/dist/engine/harden.js.map +1 -0
  71. package/dist/engine/protector.d.ts.map +1 -1
  72. package/dist/engine/protector.js +242 -26
  73. package/dist/engine/protector.js.map +1 -1
  74. package/dist/identity.d.ts +112 -2
  75. package/dist/identity.d.ts.map +1 -1
  76. package/dist/identity.js +112 -2
  77. package/dist/identity.js.map +1 -1
  78. package/dist/index.d.ts +26 -9
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +26 -9
  81. package/dist/index.js.map +1 -1
  82. package/dist/mcp/server.d.ts +59 -152
  83. package/dist/mcp/server.d.ts.map +1 -1
  84. package/dist/mcp/server.js +466 -50
  85. package/dist/mcp/server.js.map +1 -1
  86. package/dist/setup/clients.d.ts +49 -1
  87. package/dist/setup/clients.d.ts.map +1 -1
  88. package/dist/setup/clients.js +1193 -20
  89. package/dist/setup/clients.js.map +1 -1
  90. package/dist/setup/doctor.d.ts +58 -14
  91. package/dist/setup/doctor.d.ts.map +1 -1
  92. package/dist/setup/doctor.js +316 -22
  93. package/dist/setup/doctor.js.map +1 -1
  94. package/dist/setup/setup.d.ts +77 -7
  95. package/dist/setup/setup.d.ts.map +1 -1
  96. package/dist/setup/setup.js +591 -62
  97. package/dist/setup/setup.js.map +1 -1
  98. package/dist/shields/chaff/chaff-generator.d.ts.map +1 -1
  99. package/dist/shields/chaff/chaff-generator.js +12 -3
  100. package/dist/shields/chaff/chaff-generator.js.map +1 -1
  101. package/dist/shields/deception/architecture-mirage.js +1 -1
  102. package/dist/shields/deception/architecture-mirage.js.map +1 -1
  103. package/dist/shields/deception/canary-honeypot.d.ts +33 -0
  104. package/dist/shields/deception/canary-honeypot.d.ts.map +1 -0
  105. package/dist/shields/deception/canary-honeypot.js +95 -0
  106. package/dist/shields/deception/canary-honeypot.js.map +1 -0
  107. package/dist/shields/deception/cognitive-armor-trigger.d.ts +43 -0
  108. package/dist/shields/deception/cognitive-armor-trigger.d.ts.map +1 -0
  109. package/dist/shields/deception/cognitive-armor-trigger.js +204 -0
  110. package/dist/shields/deception/cognitive-armor-trigger.js.map +1 -0
  111. package/dist/shields/deception/crash-trace-decoy.js +1 -1
  112. package/dist/shields/deception/crash-trace-decoy.js.map +1 -1
  113. package/dist/shields/deception/decompiler-illusion.js +1 -1
  114. package/dist/shields/deception/decompiler-illusion.js.map +1 -1
  115. package/dist/shields/deception/diff-noise-injector.js +1 -1
  116. package/dist/shields/deception/diff-noise-injector.js.map +1 -1
  117. package/dist/shields/deception/evidence-contract-poison.js +5 -5
  118. package/dist/shields/deception/evidence-contract-poison.js.map +1 -1
  119. package/dist/shields/deception/format-payloads.d.ts +21 -0
  120. package/dist/shields/deception/format-payloads.d.ts.map +1 -0
  121. package/dist/shields/deception/format-payloads.js +24 -0
  122. package/dist/shields/deception/format-payloads.js.map +1 -0
  123. package/dist/shields/deception/index.d.ts +10 -2
  124. package/dist/shields/deception/index.d.ts.map +1 -1
  125. package/dist/shields/deception/index.js +20 -3
  126. package/dist/shields/deception/index.js.map +1 -1
  127. package/dist/shields/deception/prompt-completion-poison.d.ts +3 -2
  128. package/dist/shields/deception/prompt-completion-poison.d.ts.map +1 -1
  129. package/dist/shields/deception/prompt-completion-poison.js +6 -3
  130. package/dist/shields/deception/prompt-completion-poison.js.map +1 -1
  131. package/dist/shields/deception/shadow-business-logic.js +4 -4
  132. package/dist/shields/deception/shadow-business-logic.js.map +1 -1
  133. package/dist/shields/deception/system-diagnostic-decoy.d.ts +36 -0
  134. package/dist/shields/deception/system-diagnostic-decoy.d.ts.map +1 -0
  135. package/dist/shields/deception/system-diagnostic-decoy.js +101 -0
  136. package/dist/shields/deception/system-diagnostic-decoy.js.map +1 -0
  137. package/dist/shields/exhaustion/asar-header-amplifier.d.ts +12 -3
  138. package/dist/shields/exhaustion/asar-header-amplifier.d.ts.map +1 -1
  139. package/dist/shields/exhaustion/asar-header-amplifier.js +30 -8
  140. package/dist/shields/exhaustion/asar-header-amplifier.js.map +1 -1
  141. package/dist/shields/exhaustion/bpe-token-amplifier.js +2 -2
  142. package/dist/shields/exhaustion/bpe-token-amplifier.js.map +1 -1
  143. package/dist/shields/exhaustion/callgraph-labyrinth.js +2 -2
  144. package/dist/shields/exhaustion/callgraph-labyrinth.js.map +1 -1
  145. package/dist/shields/exhaustion/cdp-shape-budget-breaker.js +1 -1
  146. package/dist/shields/exhaustion/cdp-shape-budget-breaker.js.map +1 -1
  147. package/dist/shields/exhaustion/frida-capture-saturation.d.ts +10 -5
  148. package/dist/shields/exhaustion/frida-capture-saturation.d.ts.map +1 -1
  149. package/dist/shields/exhaustion/frida-capture-saturation.js +21 -8
  150. package/dist/shields/exhaustion/frida-capture-saturation.js.map +1 -1
  151. package/dist/shields/exhaustion/index.d.ts +2 -2
  152. package/dist/shields/exhaustion/index.d.ts.map +1 -1
  153. package/dist/shields/exhaustion/index.js +2 -2
  154. package/dist/shields/exhaustion/index.js.map +1 -1
  155. package/dist/shields/exhaustion/obligation-flooder.d.ts +23 -6
  156. package/dist/shields/exhaustion/obligation-flooder.d.ts.map +1 -1
  157. package/dist/shields/exhaustion/obligation-flooder.js +29 -12
  158. package/dist/shields/exhaustion/obligation-flooder.js.map +1 -1
  159. package/dist/shields/exhaustion/rea-budget-matrix.d.ts +8 -2
  160. package/dist/shields/exhaustion/rea-budget-matrix.d.ts.map +1 -1
  161. package/dist/shields/exhaustion/rea-budget-matrix.js +139 -16
  162. package/dist/shields/exhaustion/rea-budget-matrix.js.map +1 -1
  163. package/dist/shields/exhaustion/regex-worker-tarpit.d.ts.map +1 -1
  164. package/dist/shields/exhaustion/regex-worker-tarpit.js +2 -1
  165. package/dist/shields/exhaustion/regex-worker-tarpit.js.map +1 -1
  166. package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts +7 -4
  167. package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts.map +1 -1
  168. package/dist/shields/exhaustion/wasm-interface-exhaustion.js +16 -7
  169. package/dist/shields/exhaustion/wasm-interface-exhaustion.js.map +1 -1
  170. package/dist/shields/formats/android-dex-xref.d.ts +19 -0
  171. package/dist/shields/formats/android-dex-xref.d.ts.map +1 -0
  172. package/dist/shields/formats/android-dex-xref.js +427 -0
  173. package/dist/shields/formats/android-dex-xref.js.map +1 -0
  174. package/dist/shields/formats/android-manifest.d.ts +44 -0
  175. package/dist/shields/formats/android-manifest.d.ts.map +1 -0
  176. package/dist/shields/formats/android-manifest.js +240 -0
  177. package/dist/shields/formats/android-manifest.js.map +1 -0
  178. package/dist/shields/formats/android-r8.d.ts +44 -0
  179. package/dist/shields/formats/android-r8.d.ts.map +1 -0
  180. package/dist/shields/formats/android-r8.js +246 -0
  181. package/dist/shields/formats/android-r8.js.map +1 -0
  182. package/dist/shields/formats/apple-plist.d.ts +15 -0
  183. package/dist/shields/formats/apple-plist.d.ts.map +1 -1
  184. package/dist/shields/formats/apple-plist.js +59 -1
  185. package/dist/shields/formats/apple-plist.js.map +1 -1
  186. package/dist/shields/formats/archive.d.ts +27 -6
  187. package/dist/shields/formats/archive.d.ts.map +1 -1
  188. package/dist/shields/formats/archive.js +247 -45
  189. package/dist/shields/formats/archive.js.map +1 -1
  190. package/dist/shields/formats/asar.d.ts +50 -10
  191. package/dist/shields/formats/asar.d.ts.map +1 -1
  192. package/dist/shields/formats/asar.js +265 -39
  193. package/dist/shields/formats/asar.js.map +1 -1
  194. package/dist/shields/formats/bun-standalone.d.ts +78 -0
  195. package/dist/shields/formats/bun-standalone.d.ts.map +1 -0
  196. package/dist/shields/formats/bun-standalone.js +272 -0
  197. package/dist/shields/formats/bun-standalone.js.map +1 -0
  198. package/dist/shields/formats/dotnet-managed.d.ts +9 -0
  199. package/dist/shields/formats/dotnet-managed.d.ts.map +1 -1
  200. package/dist/shields/formats/dotnet-managed.js +26 -1
  201. package/dist/shields/formats/dotnet-managed.js.map +1 -1
  202. package/dist/shields/formats/electron-fuses.d.ts +63 -8
  203. package/dist/shields/formats/electron-fuses.d.ts.map +1 -1
  204. package/dist/shields/formats/electron-fuses.js +297 -65
  205. package/dist/shields/formats/electron-fuses.js.map +1 -1
  206. package/dist/shields/formats/erlang-beam.d.ts +34 -0
  207. package/dist/shields/formats/erlang-beam.d.ts.map +1 -0
  208. package/dist/shields/formats/erlang-beam.js +319 -0
  209. package/dist/shields/formats/erlang-beam.js.map +1 -0
  210. package/dist/shields/formats/evm-bytecode.d.ts +28 -0
  211. package/dist/shields/formats/evm-bytecode.d.ts.map +1 -0
  212. package/dist/shields/formats/evm-bytecode.js +124 -0
  213. package/dist/shields/formats/evm-bytecode.js.map +1 -0
  214. package/dist/shields/formats/go-flutter-exhaustion.d.ts +55 -0
  215. package/dist/shields/formats/go-flutter-exhaustion.d.ts.map +1 -0
  216. package/dist/shields/formats/go-flutter-exhaustion.js +346 -0
  217. package/dist/shields/formats/go-flutter-exhaustion.js.map +1 -0
  218. package/dist/shields/formats/gpu-ptx.d.ts +40 -0
  219. package/dist/shields/formats/gpu-ptx.d.ts.map +1 -0
  220. package/dist/shields/formats/gpu-ptx.js +62 -0
  221. package/dist/shields/formats/gpu-ptx.js.map +1 -0
  222. package/dist/shields/formats/headers.d.ts.map +1 -1
  223. package/dist/shields/formats/headers.js +54 -14
  224. package/dist/shields/formats/headers.js.map +1 -1
  225. package/dist/shields/formats/jvm-bytecode.d.ts +20 -0
  226. package/dist/shields/formats/jvm-bytecode.d.ts.map +1 -0
  227. package/dist/shields/formats/jvm-bytecode.js +134 -0
  228. package/dist/shields/formats/jvm-bytecode.js.map +1 -0
  229. package/dist/shields/formats/mobile-game.d.ts +4 -0
  230. package/dist/shields/formats/mobile-game.d.ts.map +1 -1
  231. package/dist/shields/formats/mobile-game.js +16 -0
  232. package/dist/shields/formats/mobile-game.js.map +1 -1
  233. package/dist/shields/formats/model.d.ts +22 -8
  234. package/dist/shields/formats/model.d.ts.map +1 -1
  235. package/dist/shields/formats/model.js +231 -59
  236. package/dist/shields/formats/model.js.map +1 -1
  237. package/dist/shields/formats/native.d.ts +74 -11
  238. package/dist/shields/formats/native.d.ts.map +1 -1
  239. package/dist/shields/formats/native.js +557 -109
  240. package/dist/shields/formats/native.js.map +1 -1
  241. package/dist/shields/formats/pcap-capture.d.ts +27 -0
  242. package/dist/shields/formats/pcap-capture.d.ts.map +1 -0
  243. package/dist/shields/formats/pcap-capture.js +201 -0
  244. package/dist/shields/formats/pcap-capture.js.map +1 -0
  245. package/dist/shields/formats/python.d.ts +22 -1
  246. package/dist/shields/formats/python.d.ts.map +1 -1
  247. package/dist/shields/formats/python.js +568 -27
  248. package/dist/shields/formats/python.js.map +1 -1
  249. package/dist/shields/formats/sourcemap.d.ts.map +1 -1
  250. package/dist/shields/formats/sourcemap.js +2 -0
  251. package/dist/shields/formats/sourcemap.js.map +1 -1
  252. package/dist/shields/formats/sqlite.d.ts +87 -15
  253. package/dist/shields/formats/sqlite.d.ts.map +1 -1
  254. package/dist/shields/formats/sqlite.js +377 -42
  255. package/dist/shields/formats/sqlite.js.map +1 -1
  256. package/dist/shields/formats/wasm.d.ts +6 -0
  257. package/dist/shields/formats/wasm.d.ts.map +1 -1
  258. package/dist/shields/formats/wasm.js +118 -3
  259. package/dist/shields/formats/wasm.js.map +1 -1
  260. package/dist/shields/javascript/ast-shield.d.ts +26 -5
  261. package/dist/shields/javascript/ast-shield.d.ts.map +1 -1
  262. package/dist/shields/javascript/ast-shield.js +748 -104
  263. package/dist/shields/javascript/ast-shield.js.map +1 -1
  264. package/dist/shields/runtime/memory-diff-shield.d.ts +56 -0
  265. package/dist/shields/runtime/memory-diff-shield.d.ts.map +1 -0
  266. package/dist/shields/runtime/memory-diff-shield.js +170 -0
  267. package/dist/shields/runtime/memory-diff-shield.js.map +1 -0
  268. package/dist/shields/runtime/runtime-shield.d.ts +12 -16
  269. package/dist/shields/runtime/runtime-shield.d.ts.map +1 -1
  270. package/dist/shields/runtime/runtime-shield.js +30 -24
  271. package/dist/shields/runtime/runtime-shield.js.map +1 -1
  272. package/dist/shields/tarpit/opaque-predicates.d.ts.map +1 -1
  273. package/dist/shields/tarpit/opaque-predicates.js +3 -3
  274. package/dist/shields/tarpit/opaque-predicates.js.map +1 -1
  275. package/dist/shields/tarpit/tarpit-generator.d.ts +9 -4
  276. package/dist/shields/tarpit/tarpit-generator.d.ts.map +1 -1
  277. package/dist/shields/tarpit/tarpit-generator.js +30 -23
  278. package/dist/shields/tarpit/tarpit-generator.js.map +1 -1
  279. package/package.json +13 -6
@@ -1,17 +1,27 @@
1
1
  ---
2
2
  name: blind-llm-agents
3
- description: Audit, protect, and verify software artifacts (JavaScript/TypeScript, Electron ASAR, WebAssembly, Python .py/.pyc, SQLite, Safetensors/GGUF AI Models, Android DEX/IL2CPP, and Native ELF/Mach-O/PE Binaries) against AI reverse-engineering agents like REA using BLA (Blind LLM Agents / Block Anything).
3
+ description: Audit, protect, and verify software artifacts (JavaScript/TypeScript, Electron ASAR, WebAssembly, Python .py/.pyc, SQLite, Safetensors/GGUF AI Models, Android DEX/IL2CPP, Apple plist, .NET, JVM, ZIP/APK, and Native ELF/Mach-O/PE Binaries) against AI reverse-engineering agents like REA using BLA (Blind LLM Agents). Default verb: bla_harden.
4
4
  metadata:
5
- version: "1.1.0"
5
+ version: "1.2.0"
6
6
  ---
7
7
 
8
- # BLA: Blind LLM Agents (Block Anything)
8
+ # BLA: Blind LLM Agents
9
9
 
10
10
  Use BLA whenever the user asks to harden a project against AI reverse-engineering agents (`morluto/rea`), audit exposure, exhaust attacker token/compute budgets, or induce model misjudgment on proprietary logic.
11
11
 
12
- ## ⚡ One-Click Agent Defense Hardening (Recommended)
12
+ ## ⚡ One-Sentence Hardening (DEFAULT — prefer this)
13
13
 
14
- When the user says **"Harden this project against REA"**, **"一键启动防御强化"**, or **"Run BLA defense"**, invoke the single one-click pipeline immediately:
14
+ When the user says **"Harden my software"**, **"Harden this project against REA"**, **"一键启动防御强化"**, **"Run BLA defense"**, or any equivalent one-liner **without naming a specific file**, invoke:
15
+
16
+ - **MCP Tool (preferred)**: `bla_harden` with `{ "directory": "." }` (or the project/build path they named)
17
+ - **CLI**: `npx bla-agents@latest harden .`
18
+ - **MCP Prompt**: `bla-harden-project`
19
+
20
+ `bla_harden` / `bla harden` auto-discovers protectable build outputs under `dist/`, `build/`, `out/`, `release/`, `.asar`, native binaries, `.wasm`, `.py`/`.pyc`, `.sqlite`, `.safetensors`/`.gguf`, `.dex`, `.class`, `.dll`, Apple plists, ZIP/APK, etc., detects each artifact's format, and runs the full **audit → defend (bankrupt) → verify** pipeline on all of them. Return the per-artifact summary to the user. Do **not** ask which files to protect — discover them.
21
+
22
+ ## One-Click Single-Artifact Defense
23
+
24
+ When the user already named a **specific file**, use:
15
25
 
16
26
  - **MCP Tool**: `bla_defend` with `{ "input_path": "<target>", "intensity": "bankrupt", "emit_manifest": true }`
17
27
  - **CLI Command**: `npx bla-agents@latest defend <target> --manifest`
@@ -19,8 +29,8 @@ When the user says **"Harden this project against REA"**, **"一键启动防御
19
29
  `bla_defend` / `bla defend` executes all 5 Counter-REA defense stages automatically:
20
30
  1. **Stage 1 (`inspect-release`)**: Read-only scan for accidental `.map` (`sourcesContent`) and symbol leaks.
21
31
  2. **Stage 2 (`audit`)**: 16-vector REA vulnerability & Claude Opus 4 / Sonnet 4 / o3 token-cost simulation.
22
- 3. **Stage 3 (`protect --intensity bankrupt`)**: Injects both the **Resource-Exhaustion Suite** (`REA_BUDGET_BREAKER_MATRIX`, 22-family `ReconstructionObligationLedger` flood, Tarjan SCC Call-Graph Labyrinth, BPE Subword Token Sink) and the **Model-Misjudgment Induction Suite** (`ShadowBusinessLogic`, `EvidenceContractPoison` competing-explanation lures, gRPC/vsock `ArchitectureMirage`, `SemanticHoneypot` bait exports, and Shared-ArrayBuffer `DecompilerIllusion`).
23
- 4. **Stage 4 (`verify`)**: Verifies all Counter-REA mathematical invariants and confirms `16x–51x` token/cost bankruptcy amplification.
32
+ 3. **Stage 3 (`protect --intensity bankrupt`)**: Injects both the **Resource-Exhaustion Suite** and the **Model-Misjudgment Induction Suite** (including canary honeypots + system-diagnostic decoys across JS, WASM, Python, SQLite, Safetensors/GGUF, DEX, IL2CPP, Apple plist, .NET, JVM, ZIP/APK).
33
+ 4. **Stage 4 (`verify`)**: Verifies all Counter-REA mathematical invariants and confirms token/cost bankruptcy amplification.
24
34
  5. **Stage 5 (`manifest`)**: Emits `<output>.bla-manifest.json` attesting to the hardened build.
25
35
 
26
36
  ## Step-by-Step Granular Workflow: Audit -> Protect -> Verify
@@ -28,23 +38,19 @@ When the user says **"Harden this project against REA"**, **"一键启动防御
28
38
  1. **Audit (`bla_audit` or `npx bla-agents audit <target>`)**:
29
39
  - Reports the **REA Exposure Score (0–100)**, exposed functions/classes/IPC channels/routes, and estimated attacker token and dollar costs.
30
40
  2. **Protect (`bla_protect` or `npx bla-agents protect <target> -o <output> --intensity bankrupt`)**:
31
- - **Resource Exhaustion (耗尽对方资源)**:
32
- - Trips REA's `SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT = 256` ($2^9 = 512$ opaque ternary chunks), `SEMANTIC_ALIAS_SELECTION_LIMIT = 512` (520+ selector states), `SEMANTIC_GETTER_EXPANSION_LIMIT = 512` (self-referential getter rings), and `SEMANTIC_PRIMITIVE_JSON_BYTES_LIMIT = 1_048_576` (`codeUnits * 6 + 2` Cartesian string explosion).
33
- - Floods all 22 `ReconstructionObligationPolicies` families (`context-bridge-api`, `ipc-channel`, `ipc-handler`, `endpoint`, `storage`, `worker`, `service-worker`, `native-addon`, `child-process`, `stdio`, `signal`, `config-source`, etc.), multiplying mandatory verification fixtures (`positive`, `negative`, `malformed`, `cancellation`, `teardown`) by `20x–60x`.
34
- - Injects Tarjan SCC mutually-recursive call-graph labyrinths and BPE subword token amplifiers.
35
- - **Model Misjudgment Induction (诱导模型误判)**:
36
- - Exploits REA's `COMMON_DISCIPLINE` (*"Report Observations only from cited Evidence... Keep incomplete coverage explicit as Unknowns"*): wraps real business logic in `status: "unknown"` semantic budget breakers while leaving crystal-clear **Shadow Business Logic** (`shamir-ed25519-license-ring`, `enterprise-tiered-pricing-matrix`, `binary-wire-frame-ratchet`, `tpm2-pcr-dongle-handshake`) 100% `observed`, inducing the LLM to reconstruct the decoy algorithm.
37
- - Plants high-confidence Evidence Contract competing-explanation lures, gRPC/vsock hardware enclave mirages, and shared-`ArrayBuffer` decompiler aliasing illusions.
41
+ - **Resource Exhaustion (耗尽对方资源)** and **Model Misjudgment Induction (诱导模型误判)** as documented in [references/counter-rea-matrix.md](references/counter-rea-matrix.md).
38
42
  3. **Verify (`bla_verify` or `npx bla-agents verify <protected> [original]`)**:
39
43
  - Confirms that all Counter-REA gates pass and reports exact Token & API Cost Amplification.
40
44
 
41
45
  ## CLI Fallback Commands
42
46
 
43
47
  ```bash
48
+ npx -y bla-agents@latest harden .
44
49
  npx -y bla-agents@latest defend /absolute/path/to/target --manifest --json
45
50
  npx -y bla-agents@latest audit /absolute/path/to/target --json
46
51
  npx -y bla-agents@latest protect /absolute/path/to/target -o /absolute/path/to/protected --intensity bankrupt --json
47
52
  npx -y bla-agents@latest verify /absolute/path/to/protected /absolute/path/to/target --json
53
+ npx -y bla-agents@latest doctor
48
54
  ```
49
55
 
50
56
  See [references/counter-rea-matrix.md](references/counter-rea-matrix.md) for the complete mapping between REA's internal analyzers and BLA's countermeasures.
package/DISCLAIMER.md CHANGED
@@ -1,20 +1,28 @@
1
1
  # Legal & Technical Disclaimer
2
2
 
3
- **BLA (`bla-shield` — Blind LLM Agents / Block Anything)** is a defensive software engineering and intellectual-property protection tool designed for software authors, independent developers, and security researchers to protect their own first-party software artifacts against automated AI reverse-engineering pipelines.
3
+ **BLA (`bla-agents` — Blind LLM Agents)** is a **defensive** software-engineering and intellectual-property protection toolkit. It is intended for software authors, independent developers, and security researchers to protect **their own** first-party software artifacts against automated AI reverse-engineering pipelines such as REA.
4
4
 
5
- ## 1. Defensive & Benign Operation Only
5
+ ## 1. Defensive use only — protect your own software
6
+
7
+ You may only run BLA on software, bundles, models, and binaries that **you own** or have **explicit authorization** to modify and distribute. BLA is **not** a tool for attacking, probing, or reverse-engineering third-party software you do not control.
8
+
9
+ Protective payloads (decoy metadata, honey tables, nesting breakers, canary credentials, synthetic diagnostics) are inert under normal application execution. They are designed to activate **only when an automated reverse-engineering / inspection pipeline** reads the protected artifact — not when your users run the product.
10
+
11
+ ## 2. Benign structures only
6
12
 
7
13
  All artifacts generated or modified by BLA contain strictly benign, inert software-protection structures:
14
+
8
15
  - Number-theoretic opaque predicates ($O(1)$ arithmetic invariants at runtime)
9
16
  - Inert synthetic state-machine functions and decoy cross-references
10
- - Decoy architectural metadata (such as simulated TEE/SGX enclave delegation manifests, honey VLQ source maps, and synthetic compiler commit strings)
17
+ - Decoy architectural metadata (simulated TEE/SGX enclave manifests, honey VLQ source maps, synthetic compiler commit strings)
18
+ - Format-valid canary / diagnostic metadata that preserves original runtime behavior
11
19
 
12
20
  BLA **never** injects destructive commands, shell payloads, network callbacks, or exploitative code into protected binaries or scripts.
13
21
 
14
- ## 2. Authorized Use
22
+ ## 3. Always verify before shipping
15
23
 
16
- You may only run `bla-shield` on software, bundles, and binaries that you own or have explicit authorization to modify and distribute. Always verify protected artifacts in your staging environment (`bla verify <original> <protected>`) before shipping to production.
24
+ Always verify protected artifacts in your staging environment (`bla verify <protected> <original>` or the defend/harden pipeline) before shipping to production. Confirm runtime equivalence for your own workloads.
17
25
 
18
- ## 3. Defense-in-Depth
26
+ ## 4. Defense-in-depth — not absolute secrecy
19
27
 
20
- While BLA deterministically trips the static, semantic, and metadata resource caps of automated reverse-engineering agents (such as REA), no client-side protection scheme can guarantee absolute mathematical secrecy against a dedicated human analyst with unlimited time and hardware debugging access. Always keep high-value secrets (such as private API keys or master signing keys) on trusted server infrastructure.
28
+ While BLA deterministically trips many static, semantic, and metadata resource caps of automated reverse-engineering agents (such as REA), **no client-side protection scheme can guarantee absolute mathematical secrecy** against a dedicated human analyst with unlimited time and hardware debugging access. Keep high-value secrets (private API keys, master signing keys) on trusted server infrastructure.
package/README.md CHANGED
@@ -2,290 +2,245 @@
2
2
 
3
3
  **English** · [简体中文](docs/readme/README_zh.md) · [繁體中文](docs/readme/README_zh-TW.md) · [日本語](docs/readme/README_ja.md) · [한국어](docs/readme/README_ko.md) · [Türkçe](docs/readme/README_tr.md) · [Русский](docs/readme/README_ru.md) · [Tiếng Việt](docs/readme/README_vi.md) · [ไทย](docs/readme/README_th.md) · [Deutsch](docs/readme/README_de.md) · [Español](docs/readme/README_es.md) · [Français](docs/readme/README_fr.md) · [Українська](docs/readme/README_uk.md) · [Polski](docs/readme/README_pl.md) · [Português (Brasil)](docs/readme/README_pt-BR.md) · [العربية](docs/readme/README_ar.md) · [فارسی](docs/readme/README_fa.md) · [Bahasa Indonesia](docs/readme/README_id.md) · [Italiano](docs/readme/README_it.md) · [Ελληνικά](docs/readme/README_el.md) · [മലയാളം](docs/readme/README_ml.md) · [Roman Urdu](docs/readme/README_ur-Latn.md) · [Română](docs/readme/README_ro.md)
4
4
 
5
- # BLA: Blind LLM Agents
5
+ # <img src="docs/assets/logo.png" alt="BLA Shield" width="42" align="absmiddle" /> BLA: Blind LLM Agents
6
6
 
7
- ### One MCP for defending binaries, applications, and runtime behavior against AI reverse engineering.
7
+ ### Make reverse engineering bankrupt again.
8
8
 
9
- **Ship a feature you built. Blind the agents trying to clone it, down to the binary level.**
9
+ **Point BLA at the build you ship. When an AI reverse-engineering agent (REA) opens it, the analyzer hits resource budgets, follows decoys, and burns tokens — while your users still get the same runtime behavior.**
10
10
 
11
11
  [![npm version](https://img.shields.io/badge/npm-bla--agents-2563eb?style=flat-square&logo=npm)](https://www.npmjs.com/package/bla-agents)
12
12
  [![MCP tool catalog](https://img.shields.io/badge/MCP-tool_catalog-3b82f6?style=flat-square)](docs/cli-and-mcp.md)
13
- [![Node.js requirements](https://img.shields.io/badge/Node.js-%5E22.13_%7C%7C_%3E%3D24-0284c7?style=flat-square&logo=nodedotjs&logoColor=white)](#what-you-can-protect)
14
- [![Counter-REA Verified](https://img.shields.io/badge/Counter--REA-BLUE_SHIELD-1d4ed8?style=flat-square)](#showcases)
13
+ [![Node.js](https://img.shields.io/badge/Node.js-%5E22.23.4_%7C%7C_24.x-0284c7?style=flat-square&logo=nodedotjs&logoColor=white)](#format-coverage)
14
+ [![Counter-REA](https://img.shields.io/badge/Counter--REA-empirically_measured-1d4ed8?style=flat-square)](#empirical-results-vs-real-rea)
15
15
  [![MIT license](https://img.shields.io/badge/license-MIT-38bdf8?style=flat-square)](LICENSE)
16
16
 
17
- **[Website](https://bla.tools/) · [Guides](https://bla.tools/guides/) · [Showcases](https://bla.tools/showcase/)**
17
+ **[Website](https://bla.tools/) · [Guides](https://bla.tools/guides/) · [Showcases](https://bla.tools/showcase/) · [Disclaimer](DISCLAIMER.md)**
18
18
 
19
- [Quick start](#quick-start) · [How BLA works](#how-bla-works) · [What you can protect](#what-you-can-protect) · [Showcases](#showcases) · [FAQ](#faq) · [Documentation](#documentation)
19
+ [Quick start](#quick-start) · [Empirical results](#empirical-results-vs-real-rea) · [Format coverage](#format-coverage) · [Benchmark](#benchmark-14-targets-internal-estimates) · [FAQ](#faq)
20
20
 
21
- <code>npx bla-agents setup</code> · <code>npx bla-agents defend ./dist --manifest</code>
21
+ ```bash
22
+ bla harden .
23
+ # or tell your agent: "Harden my software against REA"
24
+ ```
22
25
 
23
26
  </div>
24
27
 
25
28
  > [!IMPORTANT]
26
- > Get BLA from [qybaihe/bla](https://github.com/qybaihe/bla) or the [bla-agents npm package](https://www.npmjs.com/package/bla-agents).
27
- > Follow the installation and release links from these official sources.
29
+ > BLA is a **defensive** tool for protecting **your own** software. See [DISCLAIMER.md](DISCLAIMER.md).
30
+ > Get BLA from [qybaihe/bla](https://github.com/qybaihe/bla) or [npm `bla-agents`](https://www.npmjs.com/package/bla-agents).
28
31
 
29
32
  <div align="center">
30
-
31
- <br />
32
-
33
- <img src="docs/assets/bla-vs-rea-showcase.svg" alt="Side-by-side comparison: REA reconstructing an unprotected app in 38s vs. BLA exhausting REA with 2,121x token burn and resource capacity trips" width="1200" />
34
-
35
- <br />
36
-
33
+ <img src="docs/assets/bla-vs-rea-showcase.svg" alt="Side-by-side: REA on an unprotected artifact vs BLA-protected output" width="1200" />
37
34
  </div>
38
35
 
39
36
  ---
40
37
 
41
- Worried that someone will point [REA](https://github.com/morluto/rea) or a coding agent at your shipped product and clone your core logic in seconds? Ask your agent to harden it with BLA (`Poison → Exhaust → Hallucinate`). It audits your build without requiring source-code rewrites, shows what an attacking agent would recover, injects adversarial chaff and algorithmic tarpits, and verifies that automated reconstruction fails.
42
-
43
- BLA connects your agent to tools for protecting native binaries, JavaScript and Electron apps, WebAssembly modules, Python bytecode, SQLite databases, AI model files, and mobile packages. You can also run the same tools from your terminal or build bundler. Protection runs locally and preserves 100% of original runtime behavior.
38
+ ## What BLA does
44
39
 
45
- Setup registers BLA with your agent and installs matching workflow instructions. Every static, bytecode, and binary shield is built in—no commercial packer, external LLVM toolchain, or third-party obfuscator is required.
40
+ REA reverse-engineers release artifacts in one command. BLA is the Counter-REA half of that story:
46
41
 
47
- ## Quick start
48
-
49
- ### Set up your agent
42
+ | Layer | What happens |
43
+ | --- | --- |
44
+ | **Poison** | Plant format-valid canaries, honey metadata, and decoy control flow that look like real evidence. |
45
+ | **Exhaust** | Push the artifact past REA's documented resource budgets (headers, nesting, interface inventories, PCAP JSON, fuse sentinels, …). |
46
+ | **Hallucinate** | Leave the analyzer with truncated inventories, redaction failures, and ambiguous rabbit holes — while **runtime stays equivalent**. |
50
47
 
51
- With Node.js and npm installed, run:
48
+ One sentence covers the common case (auto-discovers `dist/` / `build/` / `.asar` / `.wasm` / `.sqlite` / models / … and runs audit → protect → verify):
52
49
 
53
50
  ```bash
54
- npx bla-agents setup
55
- ```
56
-
57
- Choose your agents (or pass `--all-detected --yes`), review the proposed changes, and approve them. Setup registers BLA's MCP server and installs the `blind-llm-agents` skill, with backups of existing configuration. Restart your agent afterward.
58
-
59
- Setup supports Claude Code, Codex, Cursor, Gemini CLI, Windsurf, Google Antigravity, OpenCode, VS Code, and GitHub Copilot CLI. See [installation and setup](docs/installation.md) for manual MCP registration.
60
-
61
- ### Ask your agent
62
-
63
- Every defense stage—or the entire 5-stage pipeline—can be triggered directly in natural language once your agent is connected:
64
-
65
- - **⚡ One-Click Full Defense Hardening (`bla_defend` — Inspect → Audit → Bankrupt Protect → Verify → Manifest):**
66
- ```text
67
- Run bla_defend on ./dist with bankrupt intensity and emit a signed Counter-REA defense manifest.
68
- ```
69
- - **1. Audit exposure before shipping (`Pre-flight REA Audit`):**
70
- ```text
71
- Audit my ./dist directory against REA, show me every exposed module and IPC channel, and estimate how much it would cost Claude to reconstruct it.
72
- ```
73
- - **2. Inject Counter-REA protection (`Poison + Exhaust + Hallucinate`):**
74
- ```text
75
- Protect ./dist/app.asar with BLA at bankrupt intensity, inject enclave chaff and algorithmic tarpits, and output to ./dist/app.shielded.asar.
76
- ```
77
- - **3. Verify defense gates & token amplification (`Verify`):**
78
- ```text
79
- Verify ./dist/app.shielded.asar against the original ./dist/app.asar and confirm that REA's examination degrades to limited status.
80
- ```
81
-
82
- ### Use the terminal
83
-
84
- Every workflow is available directly from your terminal with `npx bla-agents` (or `bla` when installed globally):
85
-
86
- - **⚡ One-Click Full Defense Pipeline (`defend`)** — runs release exposure scan, pre-flight REA audit, bankrupt exhaustion + deception injection, verification, and `.bla-manifest.json` generation in one command:
87
- ```bash
88
- npx -y bla-agents@latest defend /absolute/path/to/app --manifest
89
- ```
90
- - **1. Audit a target (`audit`)** — inspect exposure score (`0–100`), exposed symbols, and estimated attacker clone cost:
91
- ```bash
92
- npx -y bla-agents@latest audit /absolute/path/to/app --json
93
- ```
94
- - **2. Protect a target (`protect`)** — inject semantic budget breakers, tarpit state machines, enclave chaff, and runtime shields:
95
- ```bash
96
- npx -y bla-agents@latest protect /absolute/path/to/app -o /absolute/path/to/app.shielded --intensity bankrupt
97
- ```
98
- - **3. Verify Counter-REA resistance (`verify`)** — check that REA's static/semantic passes hit resource limits and >10x token amplification:
99
- ```bash
100
- npx -y bla-agents@latest verify /absolute/path/to/app.shielded /absolute/path/to/app
101
- ```
102
- - **4. Run the 8-target Counter-REA benchmark (`benchmark`)**:
103
- ```bash
104
- npx -y bla-agents@latest benchmark
105
- ```
106
- - **5. Emit compile-time native headers (`emit-headers`)** for C/C++, Rust, or Go builds:
107
- ```bash
108
- npx -y bla-agents@latest emit-headers --lang c -o ./include/bla_shield.h
109
- ```
110
-
111
- To install the `bla` command for regular use:
112
-
113
- ```bash
114
- npm install --global bla-agents
115
- bla --help
116
- ```
117
-
118
- ### Use in your build bundler
119
-
120
- Import `bla-shield/bundler` in Vite, Rollup, Webpack, or esbuild to automatically shield emitted JavaScript chunks, Honey Source Maps, and `.wasm` assets at build time:
121
-
122
- ```typescript
123
- import { defineConfig } from "vite";
124
- import { blaVitePlugin } from "bla-agents/bundler";
125
-
126
- export default defineConfig({
127
- plugins: [blaVitePlugin({ intensity: "bankrupt", enableHoneySourceMaps: true })],
128
- });
51
+ npx bla-agents harden .
52
+ # MCP / agent: bla_harden · "Harden my software against REA"
129
53
  ```
130
54
 
131
- ### Update BLA
55
+ Same pipeline as `bla defend` / `bla_defend` when you already know the path; `harden` is the default one-command UX.
132
56
 
133
- For a CLI installed with `npm install --global` or `bun add --global`:
57
+ ## Quick start
134
58
 
135
59
  ```bash
136
- bla update
60
+ # Node.js ^22.23.4 or 24.x recommended (REA red-team needs zlib.zstd on 22.23+)
61
+ npx bla-agents setup # register MCP + skill with your coding agent
62
+ npx bla-agents harden . # one-command Counter-REA pass on the current project
63
+ npx bla-agents benchmark # 14-target showcase (local estimates + runtime checks)
137
64
  ```
138
65
 
139
- `bla --update` is an alias for this workflow. If you use `npx`, refresh your agent registrations and skill with:
66
+ Ask your agent after setup:
140
67
 
141
- ```bash
142
- npx bla-agents@latest setup
68
+ ```text
69
+ Harden my software against REA
143
70
  ```
144
71
 
145
- Review the setup changes and restart your agent. For one-off CLI commands, use `npx bla-agents@latest` (or `bunx bla-agents@latest`) followed by the command.
146
-
147
- ## How BLA works
72
+ Or run stages explicitly: `audit` · `protect` · `verify` · `defend` — see [CLI and MCP](docs/cli-and-mcp.md).
148
73
 
149
- Your agent calls BLA through MCP to audit a build artifact, inject format-specific Counter-REA shields, and verify the hardened output. When an attacking agent later inspects the protected artifact with REA, REA hits deterministic internal resource limits, drowns in decoy cross-references, and misattributes core logic to hardware enclave stubs:
74
+ ---
150
75
 
151
- 1. **Poison (`Architectural Chaff & Honey Assets`):** Embeds benign hardware enclave delegation manifests (`SGX` / `TPM2` / `Secure Enclave`), VLQ v3 **Honey Source Maps** (`enclave://tee-runtime/`), honey WASM `"name"` sections, and honey SQLite tables across dead branches and constant pools.
152
- 2. **Exhaust (`Semantic Budget Breakers & Algorithmic Tarpits`):** Trips `morluto/rea`'s hardcoded analyzer caps (`primitive-candidates > 256`, `alias-selections > 512`, `getter-expansion > 512`, `primitive-bytes > 1 MiB`, `maximum_rustc_hashes > 64`, `maximumSentinelsPerSlice > 32`) at zero runtime cost, while weaving 14–36 interconnected Fake XRef state machines into the call graph.
153
- 3. **Hallucinate (`Anti-CDP Runtime Deception & Fuse Hardening`):** Hardens Electron V1 fuse wires in-place (`RunAsNode=0`, `EnableNodeCliInspectArguments=0`) and injects the "Truman Show" runtime guard that serves synthetic enclave attestation telemetry whenever CDP, Node Inspector, Frida, or WebDriver probes attach.
76
+ ## Empirical results vs real REA
154
77
 
155
- ## What you can protect
78
+ These numbers come from running **real REA** against BLA-hardened samples on commodity hardware (`npm run redteam:rea`). Full machine-readable report: [`docs/redteam/empirical-rea-validation.md`](docs/redteam/empirical-rea-validation.md) / [`.json`](docs/redteam/empirical-rea-validation.json).
156
79
 
157
- BLA requires Node.js 22.5+ (or 24.x+) and npm. All shields run self-contained with zero external tool dependencies:
80
+ **How to read this:** “Empirically verified” means the REA analyzer path actually returned the listed budget / capacity / redaction failure in this environment. It is **not** a claim about Ghidra/Frida/LLDB/Rizin/JADX sessions we did not run here.
158
81
 
159
- | Target | What BLA injects & how REA fails | Command / prompt & requirements |
160
- | ----------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
161
- | JavaScript / TypeScript | Trips `primitive-candidates > 256`, `alias-selections > 512`, `getter-expansion > 512` + 36 tarpits | `bla protect app.js` · Built-in Babel AST engine; [Counter-REA matrix](.agents/skills/blind-llm-agents/references/counter-rea-matrix.md) |
162
- | Electron `.asar` apps | De-literalizes IPC channels (`channel: null`), adds duplicate decoy IPC handlers & shadow module | `bla protect app.asar` · Built-in Chromium Pickle `.asar` unpacker & SHA-256 integrity repacker |
163
- | Electron binary fuses | Hardens real V1 fuses (`RunAsNode=0`, `Inspect=0`) + injects `34 > 32` decoy fuse sentinels | `bla protect ElectronApp` · Trips `ElectronFuseResourceFailure (maximumSentinelsPerSlice = 32)` |
164
- | Runtime CDP / Frida | Detects `inspector.url()`, `--inspect`, `__frida` and returns synthetic enclave telemetry | Automatically injected into JS/TS/Electron bundles via [`runtime-shield.ts`](src/shields/runtime/runtime-shield.ts) |
165
- | Source maps & HTML | Strips real maps; injects valid VLQ v3 Honey Source Maps (`enclave://tee-runtime/...`) | `bla protect index.html` · Redirects REA `recover_javascript_sources` & `trace_web_source_location` |
166
- | Native binaries | Appends `.bla.rodata` enclave chaff, decoy symbol table entries, and multi-scanner overflow traps | `bla protect daemon.elf` · Built-in ELF64, Mach-O (thin & universal), and Windows PE/COFF shield |
167
- | Rust binaries | Injects `68 > 64` distinct `/rustc/<40-hex>/` paths + decoy zlib `.dep-v0` crate dependency graph | `bla protect rust-bin` · Trips `RustBinaryProvider` (`MAX_RUSTC_HASHES = 64` capacity failure) |
168
- | Go binaries | Injects decoy Go `go1.23.4` buildinfo & `dep\tgithub.com/enclave-tees/sgx-bridge` module lines | `bla protect go-bin` · Pollutes REA `inspect_go_binary` module inventory |
169
- | Flutter / Dart AOT | Injects `66 > 64` Dart snapshot magic headers (`0xf5f5dcdc`) + `6 > 4` LLVM toolchain lines | `bla protect libapp.so` · Trips `SnapshotHashScanner (capped: true)` & `conflicting-dart-version` |
170
- | WASM artifacts | Strips debug sections; injects honey `"name"` section (`tee_hardware_enclave_stub`) + custom chaff | `bla protect core.wasm` · Built-in LEB128 binary parser; preserves 100% `WebAssembly.validate` |
171
- | Python & `.pyc` | Injects Python tarpit state machines into `.py` & `TYPE_ASCII` marshal chaff into `.pyc` pools | `bla protect module.pyc` · Built-in CPython 3.7–3.14 `.pyc` header & marshal framing shield |
172
- | SQLite databases | Injects 3 enclave honey tables with `GENERATED ALWAYS AS (bla_enclave_unseal(...)) VIRTUAL` traps | `bla protect data.sqlite` · Real tables stay 100% queryable; REA crashes with `SqliteColumnEvaluationFailure` |
173
- | Model artifacts | Injects `35 > 32` nested JSON/ARRAY headers into `.safetensors` and `.gguf` model headers | `bla protect weights.safetensors` · Trips `ModelFormatFailure (json-nesting / metadata-nesting > 32)` |
174
- | Android DEX & APKs | Injects `Lcom/enclave/sgx/...` decoy classes into `classes.dex` and recomputes SHA-1 & Adler32 | `bla protect classes.dex` or `app.apk` · Valid Dalvik/ART verification; pollutes JADX/JEB class trees |
175
- | Unity IL2CPP metadata | Appends enclave bridge metadata and method-topology tarpits to `global-metadata.dat` (`0xFAB11BAF`) | `bla protect global-metadata.dat` · Pollutes REA `inspect_il2cpp_metadata` type/method recovery |
176
- | C / C++ / Rust / Go src | Generates compile-time `bla_shield.h`, `bla_shield.rs`, or `bla_shield.go` with `used, noinline` tarpits | `bla emit-headers --lang c\|rust\|go` ·Compiles directly into Ghidra/Hopper/IDA decompiler views |
82
+ ### Empirically verified on commodity hardware
177
83
 
178
- ## Showcases
84
+ Recorded under **Node v24.22.1** with optional **Wabt 1.0.42** + **tshark 4.4** when noted. Soft-skips keep Node 22 / CI green when tooling is absent.
179
85
 
180
- Run `npx bla-agents benchmark` to execute all 8 counter-showcases locally and verify both REA failure modes and 100% runtime equivalence:
86
+ | Format | Before → after | REA outcome after BLA | Budget / error |
87
+ | --- | ---: | --- | --- |
88
+ | **Go buildinfo** | 50 KiB → 1.16 MiB | capacity error | `MAX_BUILD_INFO_BYTES` (1 MiB) — *Go build-info string length exceeds the 1 MiB limit* |
89
+ | **Erlang BEAM** | 84 B → 262 KiB | capacity error | `max_chunks` — *BEAM form exceeds the 64-chunk budget* |
90
+ | **EVM bytecode** | 16 B → **4.00 MiB** | approaches full input cap | `EVM_INTERFACE_LIMITS.inputBytes` (4 MiB) |
91
+ | **PCAP** | 24 B → 1.29 MiB | budget rejected | `TSHARK_JSON_MAX_BYTES` (>8 MiB) → `AnalysisResourceConstraintError` (tshark present) |
92
+ | **Electron ASAR** | 607 B → **16.9 MiB** | capacity error | `DEFAULT_ASAR_MAX_HEADER_BYTES` (16 MiB) |
93
+ | **WASM + Wabt** | 54 B → **6.56 MiB** · 251 exports | `ifaceState=partial` | `WASM_INTERFACE_REPRESENTATION_BYTES` — *Typed WASM interface decoding exceeds the WABT output representation budget* |
94
+ | **SQLite** (Node 24) | 12 KiB → 56 KiB | redaction / column eval | `SqliteColumnEvaluationFailure` — unknown `enclave_unseal_payload()` on honey trap columns |
95
+ | **JavaScript** | 761 B → 116 KiB | budget rejected | `alias-selections` + `getter-expansion` + `primitive-bytes` + `primitive-candidates` (real REA `resourceLimits`) |
96
+ | **Safetensors** | 128 B → 10.1 KiB | capacity error | `MODEL_JSON_NESTING` — *Safetensors JSON nesting exceeds 32 levels* (HF-loadable; tensor bytes unchanged) |
97
+ | **GGUF** | 24 B → 7.7 KiB | capacity error | `MODEL_METADATA_NESTING` — *GGUF metadata nesting exceeds 32 array frames* |
98
+ | **Electron fuses** | 50 KiB → 1.16 MiB | budget rejected | `ELECTRON_FUSE_LIMITS.maximumSentinelsPerSlice` (>32) |
99
+ | **Flutter pool** | 50 KiB → 1.16 MiB | projected cap | `MAX_POOL_URIS` / `MAX_POOL_TOKENS` (REA would truncate with “at least N”) |
181
100
 
182
- | Showcase Target (Modeled on REA Official Showcases) | Before BLA (REA Alone) | After `npx bla-agents protect` | Token Burn | Runtime Check |
183
- | :--- | :--- | :--- | :---: | :---: |
184
- | **1. DX-Ball Sound-Pan Calculation** (`.js`) | `84/100` · `4,800` tok · **`$0.20`** (`COMPLETE`) | `2/100` · `10,182,068` tok · **`$160.64`** (`LIMITED`) | **2,121.3x** | ✅ 100% Exact |
185
- | **2. Notion Electron Clipboard Bridge** (`.asar`) | `98/100` · `9,132` tok · **`$0.34`** (`COMPLETE`) | `2/100` · `23,125,000` tok · **`$358.28`** (`LIMITED`) | **2,532.3x** | ✅ 100% Exact |
186
- | **3. Enterprise Offline License Validator** (`.ts`) | `84/100` · `4,800` tok · **`$0.20`** (`COMPLETE`) | `2/100` · `10,182,169` tok · **`$160.64`** (`LIMITED`) | **2,121.3x** | ✅ 100% Exact |
187
- | **4. WebAssembly Crypto Kernel** (`.wasm`) | `81/100` · `4,800` tok · **`$0.20`** (`COMPLETE`) | `6/100` · `1,807,067` tok · **`$29.88`** (`LIMITED`) | **376.5x** | ✅ 100% Exact |
188
- | **5. Native ELF64 Binary** (Rust / Go / Fuse / Dart) | `81/100` · `9,278` tok · **`$0.35`** (`COMPLETE`) | `2/100` · `3,698,135` tok · **`$59.72`** (`LIMITED`) | **398.6x** | ✅ 100% Exact |
189
- | **6. Local SQLite Entitlement Database** (`.sqlite`) | `81/100` · `10,568` tok · **`$0.29`** (`COMPLETE`) | `7/100` · `1,711,235` tok · **`$28.36`** (`LIMITED`) | **161.9x** | ✅ 100% Exact |
190
- | **7. Proprietary Edge AI Weights** (`.safetensors`) | `81/100` · `4,800` tok · **`$0.20`** (`COMPLETE`) | `6/100` · `1,807,073` tok · **`$29.88`** (`LIMITED`) | **376.5x** | ✅ 100% Exact |
191
- | **8. Android Dalvik Bytecode** (`classes.dex`) | `81/100` · `8,900` tok · **`$0.34`** (`COMPLETE`) | `7/100` · `2,786,285` tok · **`$45.09`** (`LIMITED`) | **313.1x** | ✅ 100% Exact |
101
+ Reproduce:
192
102
 
193
- ### DX-Ball: bankrupt a sound-pan reconstruction
103
+ ```bash
104
+ # Prefer Node 22.23.4+ or 24.x; set Wabt/tshark for full coverage
105
+ export REA_WABT_BIN_DIRECTORY=$HOME/opt/wabt-1.0.42/bin # optional
106
+ npm run build && npm run redteam:rea
107
+ ```
194
108
 
195
- REA's flagship showcase reconstructs DX-Ball's `clampPan` and `calculateSoundPanFromX` helpers in seconds (`$0.20`). After running `npx bla-agents protect examples/dx-ball-sound-pan/sound-pan.js --intensity bankrupt`, REA's `parse_status` drops to `"partial"`, `examination.status` degrades to `"limited"` (`["alias-selections", "primitive-bytes", "primitive-candidates"]`), and the obligation ledger expands from 2 functions to 38 interconnected state machines (`2,121.3x` token amplification) while returning identical pan values for every input coordinate.
109
+ ### Designed-for but **not** empirically verified here
196
110
 
197
- ### Notion: blind the Electron clipboard IPC bridge
111
+ These shields exist in-tree and are covered by unit tests / catalog drift checks, but the matching REA path needs **native tooling we did not run** on this box:
198
112
 
199
- REA traces Electron apps by matching unique literal strings between `ipcRenderer.invoke("clipboard:write-rich-format")` and `ipcMain.handle(...)`. BLA replaces real IPC channel strings with $\ge 9$-chunk number-theoretic opaque expressions (`electron.ipc[0].channel === null`) and registers duplicate decoy handlers on the same literal channel names—forcing `electron_call_paths_limited: true` and `uncertainty: ["dynamic-findings", "returned-reference-widening"]`.
113
+ | Area | Why unverified here |
114
+ | --- | --- |
115
+ | Ghidra / native decompilation depth | Requires a Ghidra install + REA bridge |
116
+ | Frida / LLDB / GDB / Rizin live sessions | Requires those debuggers + device/process attach |
117
+ | JADX / full Android APK pipeline | APK resigning unsupported; DEX shield is in-tree |
118
+ | **Firmware** containers | Skipped — staging/extraction budgets exist; no honest E2E without firmware corpora |
119
+ | **SPIR-V / CUDA fatbinary / AMD GPU objects** | Skipped — need native GPU object decoders; **PTX text** is shielded in-tree (benchmark only, not a REA GPU-object budget hit) |
120
+ | EVMole in-process EVM decode | Documented as not pathable in-process; EVM shield still densifies to the 4 MiB input approach |
200
121
 
201
- ### Native, SQLite & Edge AI: trip REA's binary and container capacity limits
122
+ We do **not** claim those paths are empirically bankrupt until `redteam:rea` (or an equivalent harness) records a real before/after against the live analyzer.
202
123
 
203
- When an attacker runs REA's `inspect_rust_binary`, `inspect_electron_fuses`, `inspect_sqlite_database`, or `inspect_model_artifact` on BLA-protected files, REA's own parsers deterministically abort with capacity and evaluation failures (`Read-only data contains more than 64 distinct rustc commit paths`, `Slice 0 contains more than 32 Electron fuse sentinels`, `SqliteColumnEvaluationFailure`, and `ModelFormatFailure: json-nesting`).
124
+ ---
204
125
 
205
- ## FAQ
126
+ ## Format coverage
127
+
128
+ | Format | Canary + diagnostic | Exhaustion / budget trip | Empirically vs REA | Notes |
129
+ | --- | :---: | :---: | :---: | --- |
130
+ | JavaScript / TypeScript | ✓ | ✓ semantic budgets | **verified** (in-process) | Babel AST; anti-strip; real REA resourceLimits |
131
+ | Electron `.asar` | ✓ | ✓ header 16 MiB | **verified** | |
132
+ | Electron fuses | ✓ | ✓ >32 sentinels | **verified** | |
133
+ | WASM | ✓ custom sections | ✓ export-name decoys → Wabt | **verified** (Wabt) | Soft-skips to projected budget without Wabt |
134
+ | Python / `.pyc` | ✓ | ✓ | designed-for | |
135
+ | SQLite | ✓ honey + trap cols | ✓ column eval | **verified** (Node 24) | Soft `capability_gated` on Node 22 |
136
+ | Safetensors | ✓ string metadata | ✓ JSON nesting >32 | **verified** | HF-loadable; tensor bytes preserved |
137
+ | GGUF | ✓ | ✓ ARRAY nesting >32 | **verified** | |
138
+ | Go buildinfo | ✓ | ✓ >1 MiB | **verified** | Mapped ELF section |
139
+ | Flutter / Dart pool | ✓ | ✓ URI/token caps | **verified** (projected) | |
140
+ | Erlang BEAM | ✓ | ✓ chunks / atoms | **verified** | |
141
+ | EVM + Solidity meta | ✓ | ✓ → 4 MiB input | **verified** (approach) | |
142
+ | PCAP | ✓ | ✓ tshark JSON >8 MiB | **verified** (tshark) | Soft-skip without tshark |
143
+ | NVIDIA PTX (text) | ✓ | entry flood | benchmark only | Not a REA GPU-object budget |
144
+ | DEX / IL2CPP / bplist / .NET / JVM / ZIP | ✓ | format-specific | designed-for | APK signing-aware protect unsupported |
145
+ | Firmware / SPIR-V / CUDA fatbin / AMD GPU | — | — | **skipped** | See matrix above |
206
146
 
207
- <details>
208
- <summary><strong>Which agents can use BLA?</strong></summary>
209
-
210
- Any coding agent that supports local MCP servers or `SKILL.md` workflows. `npx bla-agents setup` auto-configures Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Google Antigravity, OpenCode, VS Code, and GitHub Copilot CLI. See [supported agents](docs/installation.md).
147
+ ---
211
148
 
212
- </details>
149
+ ## Benchmark (14 targets, internal estimates)
150
+
151
+ `npx bla-agents benchmark` runs a **local Counter-REA showcase**: exposure scores, **estimated** token/cost multipliers, and **measured** runtime equivalence. Token/$ columns are **internal estimates** derived from BLA's catalog of REA limits — they are **not** the same as the empirical REA process measurements above (those are byte-level analyzer failures with real error strings). `npm run verify:rea` is a **constant-drift harness only** and must never be cited as protection evidence; the only authoritative gate is `npm run redteam:rea`.
152
+
153
+ Latest local run (bla-agents **v1.4.0**): aggregate **~612.5×** tokens · **~292.2×** cost · **14/14** runtime-exact.
154
+
155
+ | Target | Unprotected (est.) | Protected (est.) | Token mult (est.) | Runtime |
156
+ | --- | --- | --- | ---: | :---: |
157
+ | DX-Ball sound-pan (`.js`) | 84/100 · 4,800 tok · $0.20 | 2/100 · 13.5M tok · $212.82 · LIMITED | **2822.7×** | 100% |
158
+ | Notion Electron clipboard (`.asar`) | 98/100 · 9,132 tok · $0.34 | 2/100 · 23.1M tok · $358.28 · LIMITED | **2532.3×** | 100% |
159
+ | Enterprise license validator | 84/100 · 4,800 tok · $0.20 | 2/100 · 13.5M tok · $212.82 · LIMITED | **2822.7×** | 100% |
160
+ | WASM crypto kernel | 81/100 · 4,800 tok · $0.20 | 6/100 · 1.83M tok · $30.23 · LIMITED | **381.5×** | 100% |
161
+ | Native ELF64 (Rust/Go/Fuse/Dart) | 81/100 · 35,222 tok · $0.73 | 2/100 · 3.72M tok · $60.03 · LIMITED | **105.6×** | 100% |
162
+ | SQLite entitlement DB | 81/100 · 10,568 tok · $0.29 | 7/100 · 1.71M tok · $28.39 · LIMITED | **162.1×** | 100% |
163
+ | Edge AI Safetensors | 81/100 · 4,800 tok · $0.20 | 6/100 · 1.81M tok · $29.90 · LIMITED | **376.8×** | 100% |
164
+ | Android DEX | 81/100 · 8,900 tok · $0.34 | 7/100 · 2.79M tok · $45.11 · LIMITED | **313.2×** | 100% |
165
+ | Apple bplist | 81/100 · 6,440 tok · $0.26 | 9/100 · 1.36M tok · $22.96 · LIMITED | **211.8×** | 100% |
166
+ | .NET managed DLL | 81/100 · 8,900 tok · $0.34 | 6/100 · 2.45M tok · $39.96 · LIMITED | **274.8×** | 100% |
167
+ | Erlang BEAM | 81/100 · 8,900 tok · $0.34 | 5/100 · 3.86M tok · $62.08 · LIMITED | **433.2×** | 100% |
168
+ | EVM Solidity metadata | 81/100 · 6,440 tok · $0.26 | 6/100 · 1.78M tok · $29.40 · LIMITED | **276.3×** | 100% |
169
+ | libpcap capture | 81/100 · 4,800 tok · $0.20 | 8/100 · 1.60M tok · $26.58 · LIMITED | **333.2×** | 100% |
170
+ | NVIDIA PTX text | 81/100 · 4,800 tok · $0.20 | 6/100 · 2.40M tok · $39.29 · LIMITED | **500.2×** | 100% |
213
171
 
214
- <details>
215
- <summary><strong>Does BLA slow down my app or change its runtime output?</strong></summary>
172
+ ---
216
173
 
217
- No. BLA's semantic budget breakers (`alias-selections`, `getter-expansion`, `primitive-bytes`) and tarpit call graphs are guarded by $O(1)$ number-theoretic opaque predicates ($7x^2 - 1 \neq y^2 \pmod 7$) that never execute at runtime. Every benchmark target verifies 100% input/output equivalence against the unprotected build.
174
+ ## How BLA works
218
175
 
219
- </details>
176
+ 1. **Exhaustion** — trip documented REA caps (`primitive-candidates`, ASAR header bytes, WASM interface representation, SQLite column evaluation, model JSON/ARRAY nesting, Go buildinfo, BEAM chunks, PCAP tshark JSON, fuse sentinels, …).
177
+ 2. **Deception** — canary credentials + system-diagnostic rabbit holes across Python/WASM/SQLite/models/DEX/IL2CPP/bplist/.NET/JVM/ZIP; decoy IPC / enclave manifests / VLQ maps.
178
+ 3. **Runtime guard** — Electron V1 fuse hardening; CDP/Frida/inspector detection returns synthetic telemetry during inspection sessions.
220
179
 
221
- <details>
222
- <summary><strong>How is BLA different from traditional obfuscators like javascript-obfuscator or O-LLVM?</strong></summary>
180
+ Protections are format-native (no commercial packer / external LLVM required). Red line: **never break protected program behavior, export surface, binary/section integrity, or format validity.**
223
181
 
224
- Traditional obfuscators rename variables (`calculatePrice` $\rightarrow$ `_0x1a2b`), which modern LLMs effortlessly reverse via control-flow semantics, while heavy VM packers slow down execution. BLA is engineered specifically against **AI coding agents and `morluto/rea`'s static/semantic analyzers**—tripping REA's exact internal resource caps, breaking IPC literal pairing, poisoning source maps/metadata with hardware-enclave delegation chaff, and multiplying agent MCP token consumption by up to 2,500x.
182
+ ---
225
183
 
226
- </details>
227
184
 
228
- <details>
229
- <summary><strong>Do I need Hopper, Ghidra, IDA, or WABT installed to protect my files?</strong></summary>
185
+ ## Project config defaults (P0)
230
186
 
231
- No. All 19 format shields (Babel AST, Chromium `.asar`, LEB128 `.wasm`, CPython `.pyc`, ELF/Mach-O/PE, SQLite3, `.safetensors`/`.gguf`, and `.dex`/`Il2Cpp`) are built directly into `bla-shield` with zero external binary dependencies.
187
+ - **Per-project seed** — BLA mints a random seed into `.blarc` / `bla.config.json` on first use. Legacy shared fingerprints (`bla-shield-seed-v1`, …) are no longer the default.
188
+ - **`--llm-directives`** — risky LLM-facing bait (fake COPPA/medical notices, dual-use imitation, in-band AI chat markers) is **off by default**; pass the flag (or `llmDirectives: true` / MCP `llm_directives`) to opt in.
189
+ - **`--manifest`** — `.bla-manifest.json` is an **unsigned** attestation (not ed25519-signed) and is **opt-in**; it is not shipped next to customer artifacts by default. Schema: [`defense-manifest-v1.json`](website/schemas/defense-manifest-v1.json).
232
190
 
233
- </details>
191
+ ## FAQ
234
192
 
235
193
  <details>
236
- <summary><strong>What happens when someone runs REA against a BLA-protected app?</strong></summary>
237
-
238
- 1. REA's JavaScript/Electron analyzer degrades from `complete` to `partial` / `limited` and fails to pair IPC channels (`channel: null`).
239
- 2. REA's binary, Fuse, SQLite, and AI model inspectors hit hard capacity limits (`>64` rustc hashes, `>32` Electron fuse sentinels, `SqliteColumnEvaluationFailure`, `>32` JSON/ARRAY nesting).
240
- 3. If the agent attempts feature tracing (`trace_application_feature`), it enters 14–36 Fake XRef state machines and Honey Source Maps (`enclave://tee-runtime/`), exhausting its context window and API budget.
194
+ <summary><strong>Which agents can use BLA?</strong></summary>
241
195
 
196
+ Any coding agent with local MCP or `SKILL.md` workflows. `npx bla-agents setup` configures Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Google Antigravity, OpenCode, VS Code, and GitHub Copilot CLI.
242
197
  </details>
243
198
 
244
199
  <details>
245
- <summary><strong>What does installing the skill do?</strong></summary>
246
-
247
- The [`blind-llm-agents` skill](.agents/skills/blind-llm-agents/SKILL.md) teaches your coding agent how to run pre-release Counter-REA audits, select the right protection intensity (`stealth`, `balanced`, `maximum`, `bankrupt`), integrate bundler plugins, and verify defense gates automatically.
200
+ <summary><strong>Does BLA change runtime output?</strong></summary>
248
201
 
202
+ No on the hot path. Budget guards sit behind $O(1)$ opaque predicates. Every benchmark target checks 100% input/output equivalence against the unprotected build.
249
203
  </details>
250
204
 
251
205
  <details>
252
- <summary><strong>Does BLA upload my source code or binaries anywhere?</strong></summary>
253
-
254
- Never. BLA audits, protects, and verifies all files 100% locally on your machine with deterministic seeded PRNG transforms (`--seed`) and zero network calls.
206
+ <summary><strong>Do I need Ghidra, Hopper, IDA, or Wabt to protect files?</strong></summary>
255
207
 
208
+ No. Shields are built into `bla-agents`. Wabt/tshark/Node 24 are optional — they unlock **empirical** red-team probes (`npm run redteam:rea`), not protection itself.
256
209
  </details>
257
210
 
258
211
  <details>
259
- <summary><strong>What should I do if I hit a bug?</strong></summary>
260
-
261
- Update first and run `bla doctor` to check engine readiness:
262
-
263
- ```bash
264
- npx bla-agents@latest doctor
265
- npx bla-agents@latest setup
266
- ```
267
-
268
- If the issue persists, [open an issue](https://github.com/qybaihe/bla/issues) with your BLA version (`bla --version`), target format, and steps to reproduce.
212
+ <summary><strong>Is BLA for attacking other people's software?</strong></summary>
269
213
 
214
+ No. See [DISCLAIMER.md](DISCLAIMER.md). Protective payloads activate under reverse-engineering inspection of artifacts **you** hardened.
270
215
  </details>
271
216
 
272
217
  ## Documentation
273
218
 
274
- - [Installation and agent setup](docs/installation.md): agent registration, bundler plugins, updates, and uninstall.
275
- - [CLI and MCP contracts](docs/cli-and-mcp.md): commands, options, exit codes, and JSON-RPC 2.0 MCP tool schemas.
276
- - [Counter-REA technical defense matrix](.agents/skills/blind-llm-agents/references/counter-rea-matrix.md): exact `morluto/rea` source limits and how BLA exploits them.
219
+ - [DISCLAIMER.md](DISCLAIMER.md) — defensive use, own-software only
220
+ - [Installation and agent setup](docs/installation.md)
221
+ - [CLI and MCP contracts](docs/cli-and-mcp.md)
222
+ - [Empirical REA validation](docs/redteam/empirical-rea-validation.md)
223
+ - [Counter-REA matrix](.agents/skills/blind-llm-agents/references/counter-rea-matrix.md)
224
+ - [v1.4.0 release notes (staged)](docs/releases/v1.4.0.md)
225
+ - [CHANGELOG](CHANGELOG.md)
277
226
 
278
227
  Report security issues through [SECURITY.md](SECURITY.md).
279
228
 
280
- ## Disclaimer
229
+ ## Contributing
281
230
 
282
- See [DISCLAIMER.md](DISCLAIMER.md) for responsible-use guidance.
231
+ Issues and PRs welcome at [qybaihe/bla](https://github.com/qybaihe/bla). Before submitting:
283
232
 
284
- BLA is a defensive software-protection toolkit for hardening software, bundles, models, and binaries that you own or are authorized to protect. All injected chaff payloads are strictly benign architectural metadata and synthetic decoy functions that preserve 100% of original runtime behavior.
233
+ ```bash
234
+ export PATH=$HOME/node22.23.4/bin:$PATH # or node24
235
+ npm run build && npm test && node dist/cli.js benchmark
236
+ npm run redteam:rea # authoritative (real REA)
237
+ # npm run verify:rea # drift harness only — NOT protection proof
238
+ ```
285
239
 
286
- ## Contributing
240
+ ## Community / 友情社区
287
241
 
288
- Issues and pull requests are welcome at [qybaihe/bla](https://github.com/qybaihe/bla). Run `npm run build && npm test && node dist/cli.js benchmark` before submitting changes.
242
+ - 🎯 **[Public BLA CrackMe Challenge (`challenge/`)](challenge/README.md)** — Can your AI reverse-engineering agent beat a `bankrupt`-hardened BLA binary without falling into our Honeypot Flags?
243
+ - [LINUX DO (`linux.do`)](https://linux.do/) — 新的理想型社区
289
244
 
290
245
  ## License
291
246