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.
- package/.agents/skills/blind-llm-agents/SKILL.md +20 -14
- package/DISCLAIMER.md +15 -7
- package/README.md +153 -198
- package/dist/bundler/index.d.ts +19 -2
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +47 -4
- package/dist/bundler/index.js.map +1 -1
- package/dist/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +123 -18
- package/dist/cli.js.map +1 -1
- package/dist/core/config.d.ts +54 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +160 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/coverage-contract.d.ts +97 -0
- package/dist/core/coverage-contract.d.ts.map +1 -0
- package/dist/core/coverage-contract.js +164 -0
- package/dist/core/coverage-contract.js.map +1 -0
- package/dist/core/debug-posture.d.ts +40 -0
- package/dist/core/debug-posture.d.ts.map +1 -0
- package/dist/core/debug-posture.js +197 -0
- package/dist/core/debug-posture.js.map +1 -0
- package/dist/core/detector.d.ts.map +1 -1
- package/dist/core/detector.js +58 -6
- package/dist/core/detector.js.map +1 -1
- package/dist/core/identifiers.d.ts +32 -0
- package/dist/core/identifiers.d.ts.map +1 -0
- package/dist/core/identifiers.js +263 -0
- package/dist/core/identifiers.js.map +1 -0
- package/dist/core/llm-directives.d.ts +12 -0
- package/dist/core/llm-directives.d.ts.map +1 -0
- package/dist/core/llm-directives.js +23 -0
- package/dist/core/llm-directives.js.map +1 -0
- package/dist/core/prng.d.ts +10 -1
- package/dist/core/prng.d.ts.map +1 -1
- package/dist/core/prng.js +27 -2
- package/dist/core/prng.js.map +1 -1
- package/dist/core/release-exposure.d.ts.map +1 -1
- package/dist/core/release-exposure.js +13 -2
- package/dist/core/release-exposure.js.map +1 -1
- package/dist/core/release-plan.d.ts +68 -0
- package/dist/core/release-plan.d.ts.map +1 -0
- package/dist/core/release-plan.js +244 -0
- package/dist/core/release-plan.js.map +1 -0
- package/dist/core/sarif.d.ts +53 -0
- package/dist/core/sarif.d.ts.map +1 -0
- package/dist/core/sarif.js +95 -0
- package/dist/core/sarif.js.map +1 -0
- package/dist/core/sqlite-runtime.d.ts +13 -0
- package/dist/core/sqlite-runtime.d.ts.map +1 -1
- package/dist/core/sqlite-runtime.js +38 -8
- package/dist/core/sqlite-runtime.js.map +1 -1
- package/dist/core/types.d.ts +7 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/engine/auditor.d.ts.map +1 -1
- package/dist/engine/auditor.js +380 -19
- package/dist/engine/auditor.js.map +1 -1
- package/dist/engine/benchmark.d.ts +1 -1
- package/dist/engine/benchmark.d.ts.map +1 -1
- package/dist/engine/benchmark.js +121 -41
- package/dist/engine/benchmark.js.map +1 -1
- package/dist/engine/defender.d.ts +1 -0
- package/dist/engine/defender.d.ts.map +1 -1
- package/dist/engine/defender.js +7 -1
- package/dist/engine/defender.js.map +1 -1
- package/dist/engine/harden.d.ts +61 -0
- package/dist/engine/harden.d.ts.map +1 -0
- package/dist/engine/harden.js +294 -0
- package/dist/engine/harden.js.map +1 -0
- package/dist/engine/protector.d.ts.map +1 -1
- package/dist/engine/protector.js +242 -26
- package/dist/engine/protector.js.map +1 -1
- package/dist/identity.d.ts +112 -2
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +112 -2
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +26 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +59 -152
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +466 -50
- package/dist/mcp/server.js.map +1 -1
- package/dist/setup/clients.d.ts +49 -1
- package/dist/setup/clients.d.ts.map +1 -1
- package/dist/setup/clients.js +1193 -20
- package/dist/setup/clients.js.map +1 -1
- package/dist/setup/doctor.d.ts +58 -14
- package/dist/setup/doctor.d.ts.map +1 -1
- package/dist/setup/doctor.js +316 -22
- package/dist/setup/doctor.js.map +1 -1
- package/dist/setup/setup.d.ts +77 -7
- package/dist/setup/setup.d.ts.map +1 -1
- package/dist/setup/setup.js +591 -62
- package/dist/setup/setup.js.map +1 -1
- package/dist/shields/chaff/chaff-generator.d.ts.map +1 -1
- package/dist/shields/chaff/chaff-generator.js +12 -3
- package/dist/shields/chaff/chaff-generator.js.map +1 -1
- package/dist/shields/deception/architecture-mirage.js +1 -1
- package/dist/shields/deception/architecture-mirage.js.map +1 -1
- package/dist/shields/deception/canary-honeypot.d.ts +33 -0
- package/dist/shields/deception/canary-honeypot.d.ts.map +1 -0
- package/dist/shields/deception/canary-honeypot.js +95 -0
- package/dist/shields/deception/canary-honeypot.js.map +1 -0
- package/dist/shields/deception/cognitive-armor-trigger.d.ts +43 -0
- package/dist/shields/deception/cognitive-armor-trigger.d.ts.map +1 -0
- package/dist/shields/deception/cognitive-armor-trigger.js +204 -0
- package/dist/shields/deception/cognitive-armor-trigger.js.map +1 -0
- package/dist/shields/deception/crash-trace-decoy.js +1 -1
- package/dist/shields/deception/crash-trace-decoy.js.map +1 -1
- package/dist/shields/deception/decompiler-illusion.js +1 -1
- package/dist/shields/deception/decompiler-illusion.js.map +1 -1
- package/dist/shields/deception/diff-noise-injector.js +1 -1
- package/dist/shields/deception/diff-noise-injector.js.map +1 -1
- package/dist/shields/deception/evidence-contract-poison.js +5 -5
- package/dist/shields/deception/evidence-contract-poison.js.map +1 -1
- package/dist/shields/deception/format-payloads.d.ts +21 -0
- package/dist/shields/deception/format-payloads.d.ts.map +1 -0
- package/dist/shields/deception/format-payloads.js +24 -0
- package/dist/shields/deception/format-payloads.js.map +1 -0
- package/dist/shields/deception/index.d.ts +10 -2
- package/dist/shields/deception/index.d.ts.map +1 -1
- package/dist/shields/deception/index.js +20 -3
- package/dist/shields/deception/index.js.map +1 -1
- package/dist/shields/deception/prompt-completion-poison.d.ts +3 -2
- package/dist/shields/deception/prompt-completion-poison.d.ts.map +1 -1
- package/dist/shields/deception/prompt-completion-poison.js +6 -3
- package/dist/shields/deception/prompt-completion-poison.js.map +1 -1
- package/dist/shields/deception/shadow-business-logic.js +4 -4
- package/dist/shields/deception/shadow-business-logic.js.map +1 -1
- package/dist/shields/deception/system-diagnostic-decoy.d.ts +36 -0
- package/dist/shields/deception/system-diagnostic-decoy.d.ts.map +1 -0
- package/dist/shields/deception/system-diagnostic-decoy.js +101 -0
- package/dist/shields/deception/system-diagnostic-decoy.js.map +1 -0
- package/dist/shields/exhaustion/asar-header-amplifier.d.ts +12 -3
- package/dist/shields/exhaustion/asar-header-amplifier.d.ts.map +1 -1
- package/dist/shields/exhaustion/asar-header-amplifier.js +30 -8
- package/dist/shields/exhaustion/asar-header-amplifier.js.map +1 -1
- package/dist/shields/exhaustion/bpe-token-amplifier.js +2 -2
- package/dist/shields/exhaustion/bpe-token-amplifier.js.map +1 -1
- package/dist/shields/exhaustion/callgraph-labyrinth.js +2 -2
- package/dist/shields/exhaustion/callgraph-labyrinth.js.map +1 -1
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.js +1 -1
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.js.map +1 -1
- package/dist/shields/exhaustion/frida-capture-saturation.d.ts +10 -5
- package/dist/shields/exhaustion/frida-capture-saturation.d.ts.map +1 -1
- package/dist/shields/exhaustion/frida-capture-saturation.js +21 -8
- package/dist/shields/exhaustion/frida-capture-saturation.js.map +1 -1
- package/dist/shields/exhaustion/index.d.ts +2 -2
- package/dist/shields/exhaustion/index.d.ts.map +1 -1
- package/dist/shields/exhaustion/index.js +2 -2
- package/dist/shields/exhaustion/index.js.map +1 -1
- package/dist/shields/exhaustion/obligation-flooder.d.ts +23 -6
- package/dist/shields/exhaustion/obligation-flooder.d.ts.map +1 -1
- package/dist/shields/exhaustion/obligation-flooder.js +29 -12
- package/dist/shields/exhaustion/obligation-flooder.js.map +1 -1
- package/dist/shields/exhaustion/rea-budget-matrix.d.ts +8 -2
- package/dist/shields/exhaustion/rea-budget-matrix.d.ts.map +1 -1
- package/dist/shields/exhaustion/rea-budget-matrix.js +139 -16
- package/dist/shields/exhaustion/rea-budget-matrix.js.map +1 -1
- package/dist/shields/exhaustion/regex-worker-tarpit.d.ts.map +1 -1
- package/dist/shields/exhaustion/regex-worker-tarpit.js +2 -1
- package/dist/shields/exhaustion/regex-worker-tarpit.js.map +1 -1
- package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts +7 -4
- package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts.map +1 -1
- package/dist/shields/exhaustion/wasm-interface-exhaustion.js +16 -7
- package/dist/shields/exhaustion/wasm-interface-exhaustion.js.map +1 -1
- package/dist/shields/formats/android-dex-xref.d.ts +19 -0
- package/dist/shields/formats/android-dex-xref.d.ts.map +1 -0
- package/dist/shields/formats/android-dex-xref.js +427 -0
- package/dist/shields/formats/android-dex-xref.js.map +1 -0
- package/dist/shields/formats/android-manifest.d.ts +44 -0
- package/dist/shields/formats/android-manifest.d.ts.map +1 -0
- package/dist/shields/formats/android-manifest.js +240 -0
- package/dist/shields/formats/android-manifest.js.map +1 -0
- package/dist/shields/formats/android-r8.d.ts +44 -0
- package/dist/shields/formats/android-r8.d.ts.map +1 -0
- package/dist/shields/formats/android-r8.js +246 -0
- package/dist/shields/formats/android-r8.js.map +1 -0
- package/dist/shields/formats/apple-plist.d.ts +15 -0
- package/dist/shields/formats/apple-plist.d.ts.map +1 -1
- package/dist/shields/formats/apple-plist.js +59 -1
- package/dist/shields/formats/apple-plist.js.map +1 -1
- package/dist/shields/formats/archive.d.ts +27 -6
- package/dist/shields/formats/archive.d.ts.map +1 -1
- package/dist/shields/formats/archive.js +247 -45
- package/dist/shields/formats/archive.js.map +1 -1
- package/dist/shields/formats/asar.d.ts +50 -10
- package/dist/shields/formats/asar.d.ts.map +1 -1
- package/dist/shields/formats/asar.js +265 -39
- package/dist/shields/formats/asar.js.map +1 -1
- package/dist/shields/formats/bun-standalone.d.ts +78 -0
- package/dist/shields/formats/bun-standalone.d.ts.map +1 -0
- package/dist/shields/formats/bun-standalone.js +272 -0
- package/dist/shields/formats/bun-standalone.js.map +1 -0
- package/dist/shields/formats/dotnet-managed.d.ts +9 -0
- package/dist/shields/formats/dotnet-managed.d.ts.map +1 -1
- package/dist/shields/formats/dotnet-managed.js +26 -1
- package/dist/shields/formats/dotnet-managed.js.map +1 -1
- package/dist/shields/formats/electron-fuses.d.ts +63 -8
- package/dist/shields/formats/electron-fuses.d.ts.map +1 -1
- package/dist/shields/formats/electron-fuses.js +297 -65
- package/dist/shields/formats/electron-fuses.js.map +1 -1
- package/dist/shields/formats/erlang-beam.d.ts +34 -0
- package/dist/shields/formats/erlang-beam.d.ts.map +1 -0
- package/dist/shields/formats/erlang-beam.js +319 -0
- package/dist/shields/formats/erlang-beam.js.map +1 -0
- package/dist/shields/formats/evm-bytecode.d.ts +28 -0
- package/dist/shields/formats/evm-bytecode.d.ts.map +1 -0
- package/dist/shields/formats/evm-bytecode.js +124 -0
- package/dist/shields/formats/evm-bytecode.js.map +1 -0
- package/dist/shields/formats/go-flutter-exhaustion.d.ts +55 -0
- package/dist/shields/formats/go-flutter-exhaustion.d.ts.map +1 -0
- package/dist/shields/formats/go-flutter-exhaustion.js +346 -0
- package/dist/shields/formats/go-flutter-exhaustion.js.map +1 -0
- package/dist/shields/formats/gpu-ptx.d.ts +40 -0
- package/dist/shields/formats/gpu-ptx.d.ts.map +1 -0
- package/dist/shields/formats/gpu-ptx.js +62 -0
- package/dist/shields/formats/gpu-ptx.js.map +1 -0
- package/dist/shields/formats/headers.d.ts.map +1 -1
- package/dist/shields/formats/headers.js +54 -14
- package/dist/shields/formats/headers.js.map +1 -1
- package/dist/shields/formats/jvm-bytecode.d.ts +20 -0
- package/dist/shields/formats/jvm-bytecode.d.ts.map +1 -0
- package/dist/shields/formats/jvm-bytecode.js +134 -0
- package/dist/shields/formats/jvm-bytecode.js.map +1 -0
- package/dist/shields/formats/mobile-game.d.ts +4 -0
- package/dist/shields/formats/mobile-game.d.ts.map +1 -1
- package/dist/shields/formats/mobile-game.js +16 -0
- package/dist/shields/formats/mobile-game.js.map +1 -1
- package/dist/shields/formats/model.d.ts +22 -8
- package/dist/shields/formats/model.d.ts.map +1 -1
- package/dist/shields/formats/model.js +231 -59
- package/dist/shields/formats/model.js.map +1 -1
- package/dist/shields/formats/native.d.ts +74 -11
- package/dist/shields/formats/native.d.ts.map +1 -1
- package/dist/shields/formats/native.js +557 -109
- package/dist/shields/formats/native.js.map +1 -1
- package/dist/shields/formats/pcap-capture.d.ts +27 -0
- package/dist/shields/formats/pcap-capture.d.ts.map +1 -0
- package/dist/shields/formats/pcap-capture.js +201 -0
- package/dist/shields/formats/pcap-capture.js.map +1 -0
- package/dist/shields/formats/python.d.ts +22 -1
- package/dist/shields/formats/python.d.ts.map +1 -1
- package/dist/shields/formats/python.js +568 -27
- package/dist/shields/formats/python.js.map +1 -1
- package/dist/shields/formats/sourcemap.d.ts.map +1 -1
- package/dist/shields/formats/sourcemap.js +2 -0
- package/dist/shields/formats/sourcemap.js.map +1 -1
- package/dist/shields/formats/sqlite.d.ts +87 -15
- package/dist/shields/formats/sqlite.d.ts.map +1 -1
- package/dist/shields/formats/sqlite.js +377 -42
- package/dist/shields/formats/sqlite.js.map +1 -1
- package/dist/shields/formats/wasm.d.ts +6 -0
- package/dist/shields/formats/wasm.d.ts.map +1 -1
- package/dist/shields/formats/wasm.js +118 -3
- package/dist/shields/formats/wasm.js.map +1 -1
- package/dist/shields/javascript/ast-shield.d.ts +26 -5
- package/dist/shields/javascript/ast-shield.d.ts.map +1 -1
- package/dist/shields/javascript/ast-shield.js +748 -104
- package/dist/shields/javascript/ast-shield.js.map +1 -1
- package/dist/shields/runtime/memory-diff-shield.d.ts +56 -0
- package/dist/shields/runtime/memory-diff-shield.d.ts.map +1 -0
- package/dist/shields/runtime/memory-diff-shield.js +170 -0
- package/dist/shields/runtime/memory-diff-shield.js.map +1 -0
- package/dist/shields/runtime/runtime-shield.d.ts +12 -16
- package/dist/shields/runtime/runtime-shield.d.ts.map +1 -1
- package/dist/shields/runtime/runtime-shield.js +30 -24
- package/dist/shields/runtime/runtime-shield.js.map +1 -1
- package/dist/shields/tarpit/opaque-predicates.d.ts.map +1 -1
- package/dist/shields/tarpit/opaque-predicates.js +3 -3
- package/dist/shields/tarpit/opaque-predicates.js.map +1 -1
- package/dist/shields/tarpit/tarpit-generator.d.ts +9 -4
- package/dist/shields/tarpit/tarpit-generator.d.ts.map +1 -1
- package/dist/shields/tarpit/tarpit-generator.js +30 -23
- package/dist/shields/tarpit/tarpit-generator.js.map +1 -1
- 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
|
|
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.
|
|
5
|
+
version: "1.2.0"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# BLA: Blind LLM Agents
|
|
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-
|
|
12
|
+
## ⚡ One-Sentence Hardening (DEFAULT — prefer this)
|
|
13
13
|
|
|
14
|
-
When the user says **"Harden this project against REA"**, **"一键启动防御强化"**,
|
|
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**
|
|
23
|
-
4. **Stage 4 (`verify`)**: Verifies all Counter-REA mathematical invariants and confirms
|
|
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-
|
|
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
|
|
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 (
|
|
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
|
-
##
|
|
22
|
+
## 3. Always verify before shipping
|
|
15
23
|
|
|
16
|
-
|
|
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
|
-
##
|
|
26
|
+
## 4. Defense-in-depth — not absolute secrecy
|
|
19
27
|
|
|
20
|
-
While BLA deterministically trips
|
|
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
|
-
###
|
|
7
|
+
### Make reverse engineering bankrupt again.
|
|
8
8
|
|
|
9
|
-
**
|
|
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
|
[](https://www.npmjs.com/package/bla-agents)
|
|
12
12
|
[](docs/cli-and-mcp.md)
|
|
13
|
-
[](#format-coverage)
|
|
14
|
+
[](#empirical-results-vs-real-rea)
|
|
15
15
|
[](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) · [
|
|
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
|
-
|
|
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
|
-
>
|
|
27
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
40
|
+
REA reverse-engineers release artifacts in one command. BLA is the Counter-REA half of that story:
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
55
|
+
Same pipeline as `bla defend` / `bla_defend` when you already know the path; `harden` is the default one-command UX.
|
|
132
56
|
|
|
133
|
-
|
|
57
|
+
## Quick start
|
|
134
58
|
|
|
135
59
|
```bash
|
|
136
|
-
|
|
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
|
-
|
|
66
|
+
Ask your agent after setup:
|
|
140
67
|
|
|
141
|
-
```
|
|
142
|
-
|
|
68
|
+
```text
|
|
69
|
+
Harden my software against REA
|
|
143
70
|
```
|
|
144
71
|
|
|
145
|
-
|
|
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
|
-
|
|
74
|
+
---
|
|
150
75
|
|
|
151
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
+
### Designed-for but **not** empirically verified here
|
|
196
110
|
|
|
197
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
124
|
+
---
|
|
204
125
|
|
|
205
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
215
|
-
<summary><strong>Does BLA slow down my app or change its runtime output?</strong></summary>
|
|
172
|
+
---
|
|
216
173
|
|
|
217
|
-
|
|
174
|
+
## How BLA works
|
|
218
175
|
|
|
219
|
-
|
|
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
|
-
|
|
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
|
-
|
|
182
|
+
---
|
|
225
183
|
|
|
226
|
-
</details>
|
|
227
184
|
|
|
228
|
-
|
|
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
|
-
|
|
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
|
-
|
|
191
|
+
## FAQ
|
|
234
192
|
|
|
235
193
|
<details>
|
|
236
|
-
<summary><strong>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
-
- [
|
|
275
|
-
- [
|
|
276
|
-
- [
|
|
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
|
-
##
|
|
229
|
+
## Contributing
|
|
281
230
|
|
|
282
|
-
|
|
231
|
+
Issues and PRs welcome at [qybaihe/bla](https://github.com/qybaihe/bla). Before submitting:
|
|
283
232
|
|
|
284
|
-
|
|
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
|
-
##
|
|
240
|
+
## Community / 友情社区
|
|
287
241
|
|
|
288
|
-
|
|
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
|
|