bla-agents 0.0.0-stage → 1.5.3
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 +56 -0
- package/.agents/skills/blind-llm-agents/references/counter-rea-matrix.md +28 -0
- package/DISCLAIMER.md +28 -0
- package/LICENSE +21 -0
- package/README.md +246 -2
- package/dist/bundler/index.d.ts +117 -0
- package/dist/bundler/index.d.ts.map +1 -0
- package/dist/bundler/index.js +167 -0
- package/dist/bundler/index.js.map +1 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +447 -0
- package/dist/cli.js.map +1 -0
- 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 +7 -0
- package/dist/core/detector.d.ts.map +1 -0
- package/dist/core/detector.js +190 -0
- package/dist/core/detector.js.map +1 -0
- 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/output-path.d.ts +3 -0
- package/dist/core/output-path.d.ts.map +1 -0
- package/dist/core/output-path.js +51 -0
- package/dist/core/output-path.js.map +1 -0
- package/dist/core/prng.d.ts +27 -0
- package/dist/core/prng.d.ts.map +1 -0
- package/dist/core/prng.js +85 -0
- package/dist/core/prng.js.map +1 -0
- package/dist/core/release-exposure.d.ts +26 -0
- package/dist/core/release-exposure.d.ts.map +1 -0
- package/dist/core/release-exposure.js +213 -0
- package/dist/core/release-exposure.js.map +1 -0
- 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 +235 -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 +91 -0
- package/dist/core/sarif.js.map +1 -0
- package/dist/core/sqlite-runtime.d.ts +17 -0
- package/dist/core/sqlite-runtime.d.ts.map +1 -0
- package/dist/core/sqlite-runtime.js +49 -0
- package/dist/core/sqlite-runtime.js.map +1 -0
- package/dist/core/token-estimator.d.ts +11 -0
- package/dist/core/token-estimator.d.ts.map +1 -0
- package/dist/core/token-estimator.js +87 -0
- package/dist/core/token-estimator.js.map +1 -0
- package/dist/core/types.d.ts +159 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/engine/auditor.d.ts +6 -0
- package/dist/engine/auditor.d.ts.map +1 -0
- package/dist/engine/auditor.js +977 -0
- package/dist/engine/auditor.js.map +1 -0
- package/dist/engine/benchmark.d.ts +6 -0
- package/dist/engine/benchmark.d.ts.map +1 -0
- package/dist/engine/benchmark.js +425 -0
- package/dist/engine/benchmark.js.map +1 -0
- package/dist/engine/defender.d.ts +57 -0
- package/dist/engine/defender.d.ts.map +1 -0
- package/dist/engine/defender.js +130 -0
- package/dist/engine/defender.js.map +1 -0
- package/dist/engine/harden.d.ts +61 -0
- package/dist/engine/harden.d.ts.map +1 -0
- package/dist/engine/harden.js +292 -0
- package/dist/engine/harden.js.map +1 -0
- package/dist/engine/protector.d.ts +8 -0
- package/dist/engine/protector.d.ts.map +1 -0
- package/dist/engine/protector.js +500 -0
- package/dist/engine/protector.js.map +1 -0
- package/dist/engine/verifier.d.ts +6 -0
- package/dist/engine/verifier.d.ts.map +1 -0
- package/dist/engine/verifier.js +91 -0
- package/dist/engine/verifier.js.map +1 -0
- package/dist/identity.d.ts +180 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +180 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +81 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +730 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/setup/clients.d.ts +58 -0
- package/dist/setup/clients.d.ts.map +1 -0
- package/dist/setup/clients.js +1268 -0
- package/dist/setup/clients.js.map +1 -0
- package/dist/setup/doctor.d.ts +69 -0
- package/dist/setup/doctor.d.ts.map +1 -0
- package/dist/setup/doctor.js +339 -0
- package/dist/setup/doctor.js.map +1 -0
- package/dist/setup/setup.d.ts +99 -0
- package/dist/setup/setup.d.ts.map +1 -0
- package/dist/setup/setup.js +652 -0
- package/dist/setup/setup.js.map +1 -0
- package/dist/shields/chaff/chaff-generator.d.ts +17 -0
- package/dist/shields/chaff/chaff-generator.d.ts.map +1 -0
- package/dist/shields/chaff/chaff-generator.js +80 -0
- package/dist/shields/chaff/chaff-generator.js.map +1 -0
- package/dist/shields/deception/architecture-mirage.d.ts +16 -0
- package/dist/shields/deception/architecture-mirage.d.ts.map +1 -0
- package/dist/shields/deception/architecture-mirage.js +46 -0
- package/dist/shields/deception/architecture-mirage.js.map +1 -0
- 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.d.ts +16 -0
- package/dist/shields/deception/crash-trace-decoy.d.ts.map +1 -0
- package/dist/shields/deception/crash-trace-decoy.js +36 -0
- package/dist/shields/deception/crash-trace-decoy.js.map +1 -0
- package/dist/shields/deception/decompiler-illusion.d.ts +15 -0
- package/dist/shields/deception/decompiler-illusion.d.ts.map +1 -0
- package/dist/shields/deception/decompiler-illusion.js +29 -0
- package/dist/shields/deception/decompiler-illusion.js.map +1 -0
- package/dist/shields/deception/diff-noise-injector.d.ts +17 -0
- package/dist/shields/deception/diff-noise-injector.d.ts.map +1 -0
- package/dist/shields/deception/diff-noise-injector.js +29 -0
- package/dist/shields/deception/diff-noise-injector.js.map +1 -0
- package/dist/shields/deception/evidence-contract-poison.d.ts +25 -0
- package/dist/shields/deception/evidence-contract-poison.d.ts.map +1 -0
- package/dist/shields/deception/evidence-contract-poison.js +66 -0
- package/dist/shields/deception/evidence-contract-poison.js.map +1 -0
- 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 +35 -0
- package/dist/shields/deception/index.d.ts.map +1 -0
- package/dist/shields/deception/index.js +69 -0
- package/dist/shields/deception/index.js.map +1 -0
- package/dist/shields/deception/prompt-completion-poison.d.ts +19 -0
- package/dist/shields/deception/prompt-completion-poison.d.ts.map +1 -0
- package/dist/shields/deception/prompt-completion-poison.js +45 -0
- package/dist/shields/deception/prompt-completion-poison.js.map +1 -0
- package/dist/shields/deception/semantic-honeypot.d.ts +17 -0
- package/dist/shields/deception/semantic-honeypot.d.ts.map +1 -0
- package/dist/shields/deception/semantic-honeypot.js +45 -0
- package/dist/shields/deception/semantic-honeypot.js.map +1 -0
- package/dist/shields/deception/shadow-business-logic.d.ts +24 -0
- package/dist/shields/deception/shadow-business-logic.d.ts.map +1 -0
- package/dist/shields/deception/shadow-business-logic.js +66 -0
- package/dist/shields/deception/shadow-business-logic.js.map +1 -0
- 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 +25 -0
- package/dist/shields/exhaustion/asar-header-amplifier.d.ts.map +1 -0
- package/dist/shields/exhaustion/asar-header-amplifier.js +59 -0
- package/dist/shields/exhaustion/asar-header-amplifier.js.map +1 -0
- package/dist/shields/exhaustion/bpe-token-amplifier.d.ts +21 -0
- package/dist/shields/exhaustion/bpe-token-amplifier.d.ts.map +1 -0
- package/dist/shields/exhaustion/bpe-token-amplifier.js +68 -0
- package/dist/shields/exhaustion/bpe-token-amplifier.js.map +1 -0
- package/dist/shields/exhaustion/callgraph-labyrinth.d.ts +20 -0
- package/dist/shields/exhaustion/callgraph-labyrinth.d.ts.map +1 -0
- package/dist/shields/exhaustion/callgraph-labyrinth.js +62 -0
- package/dist/shields/exhaustion/callgraph-labyrinth.js.map +1 -0
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.d.ts +20 -0
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.d.ts.map +1 -0
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.js +40 -0
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.js.map +1 -0
- package/dist/shields/exhaustion/frida-capture-saturation.d.ts +33 -0
- package/dist/shields/exhaustion/frida-capture-saturation.d.ts.map +1 -0
- package/dist/shields/exhaustion/frida-capture-saturation.js +58 -0
- package/dist/shields/exhaustion/frida-capture-saturation.js.map +1 -0
- package/dist/shields/exhaustion/index.d.ts +30 -0
- package/dist/shields/exhaustion/index.d.ts.map +1 -0
- package/dist/shields/exhaustion/index.js +43 -0
- package/dist/shields/exhaustion/index.js.map +1 -0
- package/dist/shields/exhaustion/obligation-flooder.d.ts +128 -0
- package/dist/shields/exhaustion/obligation-flooder.d.ts.map +1 -0
- package/dist/shields/exhaustion/obligation-flooder.js +145 -0
- package/dist/shields/exhaustion/obligation-flooder.js.map +1 -0
- package/dist/shields/exhaustion/rea-budget-matrix.d.ts +54 -0
- package/dist/shields/exhaustion/rea-budget-matrix.d.ts.map +1 -0
- package/dist/shields/exhaustion/rea-budget-matrix.js +300 -0
- package/dist/shields/exhaustion/rea-budget-matrix.js.map +1 -0
- package/dist/shields/exhaustion/regex-worker-tarpit.d.ts +23 -0
- package/dist/shields/exhaustion/regex-worker-tarpit.d.ts.map +1 -0
- package/dist/shields/exhaustion/regex-worker-tarpit.js +43 -0
- package/dist/shields/exhaustion/regex-worker-tarpit.js.map +1 -0
- package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts +26 -0
- package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts.map +1 -0
- package/dist/shields/exhaustion/wasm-interface-exhaustion.js +59 -0
- package/dist/shields/exhaustion/wasm-interface-exhaustion.js.map +1 -0
- 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 +46 -0
- package/dist/shields/formats/apple-plist.d.ts.map +1 -0
- package/dist/shields/formats/apple-plist.js +119 -0
- package/dist/shields/formats/apple-plist.js.map +1 -0
- package/dist/shields/formats/archive.d.ts +55 -0
- package/dist/shields/formats/archive.d.ts.map +1 -0
- package/dist/shields/formats/archive.js +369 -0
- package/dist/shields/formats/archive.js.map +1 -0
- package/dist/shields/formats/asar.d.ts +72 -0
- package/dist/shields/formats/asar.d.ts.map +1 -0
- package/dist/shields/formats/asar.js +343 -0
- package/dist/shields/formats/asar.js.map +1 -0
- 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 +30 -0
- package/dist/shields/formats/dotnet-managed.d.ts.map +1 -0
- package/dist/shields/formats/dotnet-managed.js +66 -0
- package/dist/shields/formats/dotnet-managed.js.map +1 -0
- package/dist/shields/formats/electron-fuses.d.ts +93 -0
- package/dist/shields/formats/electron-fuses.d.ts.map +1 -0
- package/dist/shields/formats/electron-fuses.js +349 -0
- package/dist/shields/formats/electron-fuses.js.map +1 -0
- 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 +22 -0
- package/dist/shields/formats/headers.d.ts.map +1 -0
- package/dist/shields/formats/headers.js +193 -0
- package/dist/shields/formats/headers.js.map +1 -0
- 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 +42 -0
- package/dist/shields/formats/mobile-game.d.ts.map +1 -0
- package/dist/shields/formats/mobile-game.js +131 -0
- package/dist/shields/formats/mobile-game.js.map +1 -0
- package/dist/shields/formats/model.d.ts +66 -0
- package/dist/shields/formats/model.d.ts.map +1 -0
- package/dist/shields/formats/model.js +461 -0
- package/dist/shields/formats/model.js.map +1 -0
- package/dist/shields/formats/native.d.ts +101 -0
- package/dist/shields/formats/native.d.ts.map +1 -0
- package/dist/shields/formats/native.js +585 -0
- package/dist/shields/formats/native.js.map +1 -0
- 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 +62 -0
- package/dist/shields/formats/python.d.ts.map +1 -0
- package/dist/shields/formats/python.js +637 -0
- package/dist/shields/formats/python.js.map +1 -0
- package/dist/shields/formats/sourcemap.d.ts +22 -0
- package/dist/shields/formats/sourcemap.d.ts.map +1 -0
- package/dist/shields/formats/sourcemap.js +66 -0
- package/dist/shields/formats/sourcemap.js.map +1 -0
- package/dist/shields/formats/sqlite.d.ts +115 -0
- package/dist/shields/formats/sqlite.d.ts.map +1 -0
- package/dist/shields/formats/sqlite.js +528 -0
- package/dist/shields/formats/sqlite.js.map +1 -0
- package/dist/shields/formats/wasm.d.ts +38 -0
- package/dist/shields/formats/wasm.d.ts.map +1 -0
- package/dist/shields/formats/wasm.js +314 -0
- package/dist/shields/formats/wasm.js.map +1 -0
- package/dist/shields/javascript/ast-shield.d.ts +37 -0
- package/dist/shields/javascript/ast-shield.d.ts.map +1 -0
- package/dist/shields/javascript/ast-shield.js +645 -0
- package/dist/shields/javascript/ast-shield.js.map +1 -0
- 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 +24 -0
- package/dist/shields/runtime/runtime-shield.d.ts.map +1 -0
- package/dist/shields/runtime/runtime-shield.js +84 -0
- package/dist/shields/runtime/runtime-shield.js.map +1 -0
- package/dist/shields/tarpit/opaque-predicates.d.ts +10 -0
- package/dist/shields/tarpit/opaque-predicates.d.ts.map +1 -0
- package/dist/shields/tarpit/opaque-predicates.js +40 -0
- package/dist/shields/tarpit/opaque-predicates.js.map +1 -0
- package/dist/shields/tarpit/tarpit-generator.d.ts +31 -0
- package/dist/shields/tarpit/tarpit-generator.d.ts.map +1 -0
- package/dist/shields/tarpit/tarpit-generator.js +194 -0
- package/dist/shields/tarpit/tarpit-generator.js.map +1 -0
- package/dist/ui/reporter.d.ts +13 -0
- package/dist/ui/reporter.d.ts.map +1 -0
- package/dist/ui/reporter.js +197 -0
- package/dist/ui/reporter.js.map +1 -0
- package/package.json +89 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
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, 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
|
+
metadata:
|
|
5
|
+
version: "1.2.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# BLA: Blind LLM Agents
|
|
9
|
+
|
|
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
|
+
|
|
12
|
+
## ⚡ One-Sentence Hardening (DEFAULT — prefer this)
|
|
13
|
+
|
|
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:
|
|
25
|
+
|
|
26
|
+
- **MCP Tool**: `bla_defend` with `{ "input_path": "<target>", "intensity": "bankrupt", "emit_manifest": true }`
|
|
27
|
+
- **CLI Command**: `npx bla-agents@latest defend <target> --manifest`
|
|
28
|
+
|
|
29
|
+
`bla_defend` / `bla defend` executes all 5 Counter-REA defense stages automatically:
|
|
30
|
+
1. **Stage 1 (`inspect-release`)**: Read-only scan for accidental `.map` (`sourcesContent`) and symbol leaks.
|
|
31
|
+
2. **Stage 2 (`audit`)**: 16-vector REA vulnerability & Claude Opus 4 / Sonnet 4 / o3 token-cost simulation.
|
|
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.
|
|
34
|
+
5. **Stage 5 (`manifest`)**: Emits `<output>.bla-manifest.json` attesting to the hardened build.
|
|
35
|
+
|
|
36
|
+
## Step-by-Step Granular Workflow: Audit -> Protect -> Verify
|
|
37
|
+
|
|
38
|
+
1. **Audit (`bla_audit` or `npx bla-agents audit <target>`)**:
|
|
39
|
+
- Reports the **REA Exposure Score (0–100)**, exposed functions/classes/IPC channels/routes, and estimated attacker token and dollar costs.
|
|
40
|
+
2. **Protect (`bla_protect` or `npx bla-agents protect <target> -o <output> --intensity bankrupt`)**:
|
|
41
|
+
- **Resource Exhaustion (耗尽对方资源)** and **Model Misjudgment Induction (诱导模型误判)** as documented in [references/counter-rea-matrix.md](references/counter-rea-matrix.md).
|
|
42
|
+
3. **Verify (`bla_verify` or `npx bla-agents verify <protected> [original]`)**:
|
|
43
|
+
- Confirms that all Counter-REA gates pass and reports exact Token & API Cost Amplification.
|
|
44
|
+
|
|
45
|
+
## CLI Fallback Commands
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx -y bla-agents@latest harden .
|
|
49
|
+
npx -y bla-agents@latest defend /absolute/path/to/target --manifest --json
|
|
50
|
+
npx -y bla-agents@latest audit /absolute/path/to/target --json
|
|
51
|
+
npx -y bla-agents@latest protect /absolute/path/to/target -o /absolute/path/to/protected --intensity bankrupt --json
|
|
52
|
+
npx -y bla-agents@latest verify /absolute/path/to/protected /absolute/path/to/target --json
|
|
53
|
+
npx -y bla-agents@latest doctor
|
|
54
|
+
```
|
|
55
|
+
|
|
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.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Complete 24-Vector Counter-REA Matrix (`morluto/rea` vs `bla-agents`)
|
|
2
|
+
|
|
3
|
+
| # | REA Source File (`morluto/rea`) | REA Mechanism / Limit | BLA Countermeasure Module |
|
|
4
|
+
| :- | :--- | :--- | :--- |
|
|
5
|
+
| 1 | `javascriptSemanticResourceLimits.ts:7` | `SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT = 256` | `ast-shield.ts` ($\ge 9$-chunk opaque ternaries $\to 512$ candidates) |
|
|
6
|
+
| 2 | `javascriptSemanticResourceLimits.ts:9` | `SEMANTIC_EXPRESSION_DEPTH_LIMIT = 256` | `rea-budget-matrix.ts` (nested arithmetic identity chains) |
|
|
7
|
+
| 3 | `javascriptSemanticResourceLimits.ts:11` | `SEMANTIC_GETTER_EXPANSION_LIMIT = 512` | `tarpit-generator.ts` (self-referential getter rings) |
|
|
8
|
+
| 4 | `javascriptSemanticResourceLimits.ts:13` | `SEMANTIC_ALIAS_SELECTION_LIMIT = 512` | `tarpit-generator.ts` (528+ dynamic selector states) |
|
|
9
|
+
| 5 | `javascriptSemanticResourceLimits.ts:15` | `SEMANTIC_PRIMITIVE_JSON_BYTES_LIMIT = 1 MiB` | `tarpit-generator.ts` (`codeUnits * 6 + 2` Cartesian string explosion) |
|
|
10
|
+
| 6 | `ReconstructionObligationPolicies.ts:15` | 22 Application & Semantic Obligation Families | `obligation-flooder.ts` (floods all 22 families $\to 68+$ mandatory cases) |
|
|
11
|
+
| 7 | `promptContracts.ts:52` | `COMMON_DISCIPLINE` (`Observations` vs `Unknowns`) | `shadow-business-logic.ts` + `evidence-contract-poison.ts` |
|
|
12
|
+
| 8 | `promptContracts.ts:139` | `procedure_callers` / `procedure_callees` / `xrefs` | `callgraph-labyrinth.ts` (Tarjan SCC mutually-recursive clusters) |
|
|
13
|
+
| 9 | `ReconstructionObligationLedgerProjection.ts:24` | `compareUnicodeCodePoints` lexicographical sort | `prompt-completion-poison.ts` (`$00_AAA_enclave_` priority prefix) |
|
|
14
|
+
| 10 | `promptContracts.ts:157` | `compare_application_versions` / `compare_functions` | `diff-noise-injector.ts` (seed-keyed isomorphic switch permutations) |
|
|
15
|
+
| 11 | `promptContracts.ts:262` | `trace_crash` (`search_strings` $\to$ `build_call_path`) | `crash-trace-decoy.ts` (`SIGSEGV_ENCLAVE_EPC_PAGE_FAULT` lures) |
|
|
16
|
+
| 12 | `electronStaticAnalysisIpc.ts` | Unique literal IPC channel pairing rule | `ast-shield.ts` (de-literalizes real IPC + registers duplicate decoy channels) |
|
|
17
|
+
| 13 | `ElectronFuseReader.ts:36` | `maximumSentinelsPerSlice = 32` | `electron-fuses.ts` (hardens V1 fuses + appends 33 decoy sentinels) |
|
|
18
|
+
| 14 | `CdpCaptureEvents.ts` | JSON body & WebSocket shape budget (`depth >= 760`) | `cdp-shape-budget-breaker.ts` (780+ nested JSON envelopes) |
|
|
19
|
+
| 15 | `fridaCaptureLimits.ts:8` | `MAX_JSON_DEPTH = 64`, `MAX_MESSAGE_TEXT_BYTES = 32 KiB` | `frida-capture-saturation.ts` (68+ level JSON + 34 KiB message text) |
|
|
20
|
+
| 16 | `SqliteDatabaseInspection.ts:792` | Bare `readOnly: true, allowExtension: false` snapshot | `sqlite.ts` (`GENERATED ALWAYS AS (bla_enclave_unseal(...)) VIRTUAL`) |
|
|
21
|
+
| 17 | `SafetensorsHeader.ts:74` | `MODEL_JSON_NESTING = 32` | `model.ts` (35-level nested JSON array under `_bla_nesting_breaker`) |
|
|
22
|
+
| 18 | `GgufHeader.ts:121` | `MODEL_METADATA_NESTING = 32` | `model.ts` (35-frame nested GGUF `ARRAY` preserving existing KV/tensors) |
|
|
23
|
+
| 19 | `wasmInterface.ts:90` | `WASM_INTERFACE_REPRESENTATION_BYTES = 32 MiB` | `wasm-interface-exhaustion.ts` + `wasm.ts` (`6x` string + `16x` signature charge) |
|
|
24
|
+
| 20 | `RustBinaryProvider.ts` | `MAX_RUSTC_HASHES = 64` & `.dep-v0` crate recovery | `native.ts` (72 decoy rustc hashes + decoy `.dep-v0` / Go buildinfo) |
|
|
25
|
+
| 21 | `DartAotSnapshot.ts` | `SUPPORTED_SNAPSHOT_PROFILES` & `_kDartVmSnapshot*` | `native.ts` (spoofed Dart AOT snapshot symbols & version strings) |
|
|
26
|
+
| 22 | `PropertyListDecodeBudget.ts:80` | XML plist `token.doctype && token.internalSubset` | `apple-plist.ts` (`<!DOCTYPE plist ... []>` empty internal subset abort) |
|
|
27
|
+
| 23 | `ManagedDecodeBudget.ts:9` | `.NET` `reserveRow = 256` & `reserveString = 6x + 2` | `dotnet-managed.ts` (managed heap string & P/Invoke obligation flood) |
|
|
28
|
+
| 24 | `AndroidDex.ts` & `Il2CppMetadata.ts` | DEX string/type table & Unity `0xFAB11BAF` metadata | `mobile-game.ts` (recomputed SHA-1/Adler32 DEX + IL2CPP enclave types) |
|
package/DISCLAIMER.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Legal & Technical Disclaimer
|
|
2
|
+
|
|
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
|
+
|
|
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
|
|
12
|
+
|
|
13
|
+
All artifacts generated or modified by BLA contain strictly benign, inert software-protection structures:
|
|
14
|
+
|
|
15
|
+
- Number-theoretic opaque predicates ($O(1)$ arithmetic invariants at runtime)
|
|
16
|
+
- Inert synthetic state-machine functions and decoy cross-references
|
|
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
|
|
19
|
+
|
|
20
|
+
BLA **never** injects destructive commands, shell payloads, network callbacks, or exploitative code into protected binaries or scripts.
|
|
21
|
+
|
|
22
|
+
## 3. Always verify before shipping
|
|
23
|
+
|
|
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.
|
|
25
|
+
|
|
26
|
+
## 4. Defense-in-depth — not absolute secrecy
|
|
27
|
+
|
|
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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BLA Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,247 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
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
|
+
|
|
5
|
+
# <img src="docs/assets/logo.png" alt="BLA Shield" width="42" align="absmiddle" /> BLA: Blind LLM Agents
|
|
6
|
+
|
|
7
|
+
### Make reverse engineering bankrupt again.
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/bla-agents)
|
|
12
|
+
[](docs/cli-and-mcp.md)
|
|
13
|
+
[](#format-coverage)
|
|
14
|
+
[](#empirical-results-vs-real-rea)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
|
|
17
|
+
**[Website](https://bla.tools/) · [Guides](https://bla.tools/guides/) · [Showcases](https://bla.tools/showcase/) · [Disclaimer](DISCLAIMER.md)**
|
|
18
|
+
|
|
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
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bla harden .
|
|
23
|
+
# or tell your agent: "Harden my software against REA"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
> [!IMPORTANT]
|
|
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).
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
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" />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## What BLA does
|
|
39
|
+
|
|
40
|
+
REA reverse-engineers release artifacts in one command. BLA is the Counter-REA half of that story:
|
|
41
|
+
|
|
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**. |
|
|
47
|
+
|
|
48
|
+
One sentence covers the common case (auto-discovers `dist/` / `build/` / `.asar` / `.wasm` / `.sqlite` / models / … and runs audit → protect → verify):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx bla-agents harden .
|
|
52
|
+
# MCP / agent: bla_harden · "Harden my software against REA"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Same pipeline as `bla defend` / `bla_defend` when you already know the path; `harden` is the default one-command UX.
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
```bash
|
|
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)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Ask your agent after setup:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
Harden my software against REA
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or run stages explicitly: `audit` · `protect` · `verify` · `defend` — see [CLI and MCP](docs/cli-and-mcp.md).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Empirical results vs real REA
|
|
77
|
+
|
|
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).
|
|
79
|
+
|
|
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.
|
|
81
|
+
|
|
82
|
+
### Empirically verified on commodity hardware
|
|
83
|
+
|
|
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.
|
|
85
|
+
|
|
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”) |
|
|
100
|
+
|
|
101
|
+
Reproduce:
|
|
102
|
+
|
|
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
|
+
```
|
|
108
|
+
|
|
109
|
+
### Designed-for but **not** empirically verified here
|
|
110
|
+
|
|
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:
|
|
112
|
+
|
|
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 |
|
|
121
|
+
|
|
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.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
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 |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
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% |
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## How BLA works
|
|
175
|
+
|
|
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.
|
|
179
|
+
|
|
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.**
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## Project config defaults (P0)
|
|
186
|
+
|
|
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).
|
|
190
|
+
|
|
191
|
+
## FAQ
|
|
192
|
+
|
|
193
|
+
<details>
|
|
194
|
+
<summary><strong>Which agents can use BLA?</strong></summary>
|
|
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.
|
|
197
|
+
</details>
|
|
198
|
+
|
|
199
|
+
<details>
|
|
200
|
+
<summary><strong>Does BLA change runtime output?</strong></summary>
|
|
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.
|
|
203
|
+
</details>
|
|
204
|
+
|
|
205
|
+
<details>
|
|
206
|
+
<summary><strong>Do I need Ghidra, Hopper, IDA, or Wabt to protect files?</strong></summary>
|
|
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.
|
|
209
|
+
</details>
|
|
210
|
+
|
|
211
|
+
<details>
|
|
212
|
+
<summary><strong>Is BLA for attacking other people's software?</strong></summary>
|
|
213
|
+
|
|
214
|
+
No. See [DISCLAIMER.md](DISCLAIMER.md). Protective payloads activate under reverse-engineering inspection of artifacts **you** hardened.
|
|
215
|
+
</details>
|
|
216
|
+
|
|
217
|
+
## Documentation
|
|
218
|
+
|
|
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)
|
|
226
|
+
|
|
227
|
+
Report security issues through [SECURITY.md](SECURITY.md).
|
|
228
|
+
|
|
229
|
+
## Contributing
|
|
230
|
+
|
|
231
|
+
Issues and PRs welcome at [qybaihe/bla](https://github.com/qybaihe/bla). Before submitting:
|
|
232
|
+
|
|
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
|
+
```
|
|
239
|
+
|
|
240
|
+
## Community / 友情社区
|
|
241
|
+
|
|
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/) — 新的理想型社区
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { ProtectionIntensity } from "../core/types.js";
|
|
2
|
+
import { type JsCarrierType, type JsLoaderType } from "../shields/javascript/ast-shield.js";
|
|
3
|
+
export interface BlaBundlerPluginOptions {
|
|
4
|
+
/** Protection intensity preset (default: `"balanced"`). */
|
|
5
|
+
readonly intensity?: ProtectionIntensity;
|
|
6
|
+
/** Deterministic PRNG seed for reproducible builds. */
|
|
7
|
+
readonly seed?: string | number;
|
|
8
|
+
/** File regex filter for chunks/modules to shield (default: `/\.(?:m?js|cjs)$/i`). */
|
|
9
|
+
readonly include?: RegExp;
|
|
10
|
+
/** Emit a companion `.map` honey source map for each protected chunk (default: `true`). */
|
|
11
|
+
readonly honeySourceMap?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Infers the exact esbuild loader (`"js" | "jsx" | "ts" | "tsx"`) from a module path.
|
|
15
|
+
*/
|
|
16
|
+
export declare function inferEsbuildLoader(filePath: string): JsLoaderType;
|
|
17
|
+
/**
|
|
18
|
+
* Maps a Rollup/Vite output format (`"es"`, `"cjs"`, `"iife"`, `"umd"`, `"amd"`, `"system"`)
|
|
19
|
+
* or chunk filename to a BLA JavaScript carrier contract.
|
|
20
|
+
*/
|
|
21
|
+
export declare function inferCarrierFromRollupFormat(format?: string, fileName?: string): JsCarrierType;
|
|
22
|
+
/**
|
|
23
|
+
* Vite & Rollup plugin (`blaVitePlugin` / `blaRollupPlugin`) that automatically
|
|
24
|
+
* injects BLA's three-stage adversarial shield into generated JS chunks during `renderChunk`.
|
|
25
|
+
*
|
|
26
|
+
* Usage in `vite.config.ts`:
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { defineConfig } from "vite";
|
|
29
|
+
* import { blaVitePlugin } from "bla-shield";
|
|
30
|
+
*
|
|
31
|
+
* export default defineConfig({
|
|
32
|
+
* plugins: [blaVitePlugin({ intensity: "bankrupt" })],
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function blaRollupPlugin(options?: BlaBundlerPluginOptions): {
|
|
37
|
+
name: string;
|
|
38
|
+
renderChunk(code: string, chunk: {
|
|
39
|
+
fileName: string;
|
|
40
|
+
isEntry?: boolean;
|
|
41
|
+
}, outputOptions?: {
|
|
42
|
+
format?: string;
|
|
43
|
+
}): {
|
|
44
|
+
code: string;
|
|
45
|
+
map: null;
|
|
46
|
+
} | {
|
|
47
|
+
code: string;
|
|
48
|
+
map: import("../shields/formats/sourcemap.js").HoneySourceMap;
|
|
49
|
+
} | null;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Alias of `blaRollupPlugin` with `enforce: "post"` for Vite 4/5/6.
|
|
53
|
+
*/
|
|
54
|
+
export declare function blaVitePlugin(options?: BlaBundlerPluginOptions): {
|
|
55
|
+
name: string;
|
|
56
|
+
enforce: "post";
|
|
57
|
+
renderChunk(code: string, chunk: {
|
|
58
|
+
fileName: string;
|
|
59
|
+
isEntry?: boolean;
|
|
60
|
+
}, outputOptions?: {
|
|
61
|
+
format?: string;
|
|
62
|
+
}): {
|
|
63
|
+
code: string;
|
|
64
|
+
map: null;
|
|
65
|
+
} | {
|
|
66
|
+
code: string;
|
|
67
|
+
map: import("../shields/formats/sourcemap.js").HoneySourceMap;
|
|
68
|
+
} | null;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Webpack 5 / Rspack plugin class (`BlaWebpackPlugin`) that shields emitted JS assets.
|
|
72
|
+
*/
|
|
73
|
+
export declare class BlaWebpackPlugin {
|
|
74
|
+
readonly options: BlaBundlerPluginOptions;
|
|
75
|
+
constructor(options?: BlaBundlerPluginOptions);
|
|
76
|
+
apply(compiler: {
|
|
77
|
+
hooks: {
|
|
78
|
+
compilation: {
|
|
79
|
+
tap: (name: string, cb: (compilation: {
|
|
80
|
+
hooks: {
|
|
81
|
+
processAssets: {
|
|
82
|
+
tap: (opts: {
|
|
83
|
+
name: string;
|
|
84
|
+
stage: number;
|
|
85
|
+
}, fn: (assets: Record<string, {
|
|
86
|
+
source: () => string | Buffer;
|
|
87
|
+
size: () => number;
|
|
88
|
+
}>) => void) => void;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
updateAsset: (name: string, newSource: {
|
|
92
|
+
source: () => string;
|
|
93
|
+
size: () => number;
|
|
94
|
+
}) => void;
|
|
95
|
+
}) => void) => void;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
}): void;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* esbuild plugin (`blaEsbuildPlugin`) that shields JS/TS/JSX/TSX entrypoints or modules
|
|
102
|
+
* while preserving the exact esbuild loader (`js`, `jsx`, `ts`, `tsx`) and module carrier.
|
|
103
|
+
*/
|
|
104
|
+
export declare function blaEsbuildPlugin(options?: BlaBundlerPluginOptions): {
|
|
105
|
+
name: string;
|
|
106
|
+
setup(build: {
|
|
107
|
+
onLoad: (opts: {
|
|
108
|
+
filter: RegExp;
|
|
109
|
+
}, cb: (args: {
|
|
110
|
+
path: string;
|
|
111
|
+
}) => Promise<{
|
|
112
|
+
contents: string;
|
|
113
|
+
loader: JsLoaderType;
|
|
114
|
+
} | null>) => void;
|
|
115
|
+
}): void;
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,WAAW,uBAAuB;IACtC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IACzC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,sFAAsF;IACtF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,2FAA2F;IAC3F,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAEjE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,aAAa,CAuBf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,uBAA4B;;sBAQzD,MAAM,SACL;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,kBAC9B;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;EAuCxC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,uBAA4B;;;sBA9CvD,MAAM,SACL;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,kBAC9B;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;EAkDxC;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAC;gBAE9B,OAAO,GAAE,uBAA4B;IAIjD,KAAK,CAAC,QAAQ,EAAE;QACd,KAAK,EAAE;YACL,WAAW,EAAE;gBACX,GAAG,EAAE,CACH,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,WAAW,EAAE;oBAChB,KAAK,EAAE;wBACL,aAAa,EAAE;4BACb,GAAG,EAAE,CACH,IAAI,EAAE;gCAAE,IAAI,EAAE,MAAM,CAAC;gCAAC,KAAK,EAAE,MAAM,CAAA;6BAAE,EACrC,EAAE,EAAE,CACF,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;gCAAE,MAAM,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC;gCAAC,IAAI,EAAE,MAAM,MAAM,CAAA;6BAAE,CACtD,KACE,IAAI,KACN,IAAI,CAAC;yBACX,CAAC;qBACH,CAAC;oBACF,WAAW,EAAE,CACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE;wBAAE,MAAM,EAAE,MAAM,MAAM,CAAC;wBAAC,IAAI,EAAE,MAAM,MAAM,CAAA;qBAAE,KACpD,IAAI,CAAC;iBACX,KAAK,IAAI,KACP,IAAI,CAAC;aACX,CAAC;SACH,CAAC;KACH,GAAG,IAAI;CAmCT;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B;;iBAMrD;QACX,MAAM,EAAE,CACN,IAAI,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,EACxB,EAAE,EAAE,CAAC,IAAI,EAAE;YACT,IAAI,EAAE,MAAM,CAAC;SACd,KAAK,OAAO,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,YAAY,CAAA;SAAE,GAAG,IAAI,CAAC,KAC7D,IAAI,CAAC;KACX;EAqBJ"}
|