[!IMPORTANT]
Defensive Use Only: BLA is engineered strictly for software authors and security teams protecting their own intellectual property and release artifacts. See DISCLAIMER.md.
Always install from official sources: qybaihe/bla or npm i bla-agents.
🔴 Without BLA
AI reverse-engineering agents (REA + coding agents) unpack .asar archives, recover SourceMaps, trace IPC bridges, inspect .wasm / .sqlite / .safetensors, and clone core business logic in seconds for ~$0.20.
|
🛡️ With BLA (bla harden .)
REA's default pass stops on its own resource budgets (primitive-candidates > 256, ASAR > 16 MiB, WASM > Wabt cap, SQLite virtual trap), follows realistic shadow state machines, and projects 300×–2,800× modeled token amplification (token-estimator.ts). Most of those budgets can be raised by the caller — what that means.
|
⚡ Runtime-Equivalent by Design
Exhaustion graphs and decoy payloads sit behind $O(1)$ number-theoretic opaque predicates ($7x^2 - 1 \neq y^2 \pmod 7$) or inert format sections. 16/16 bundled benchmark targets pass input/output equivalence tests (bla verify checks Counter-REA structural gates; run your project's test suite for custom artifacts).
|
⚡ 30-Second Quick Start
1. One-Command CLI Hardening
Point BLA at any project or release directory. It auto-discovers build outputs (dist/, build/, .asar, .wasm, .sqlite, .safetensors, native binaries, Python/C/Rust/Go) and runs audit → protect → verify:
# Node.js ^22.23.4 or >=24.0.0 recommended
npx bla-agents harden . # writes a partial mirror to .bla-hardened/ — nothing ships yet
npx bla-agents harden . --apply # ship it: replace the build output with the hardened files
npx bla-agents harden . --restore # undo: put the original build output back
Build first — harden targets what your build produced and leaves the toolchain alone. --apply only overwrites build output (never source) and keeps the originals outside the project; run your own tests against the promoted build before releasing.
2. Agent-Driven Closed-Loop Defense (MCP + Skill)
Register BLA once with your coding agent (Claude Code, Cursor, Codex, Windsurf, Gemini CLI, GitHub Copilot CLI, VS Code, OpenCode, Antigravity):
Then simply prompt your coding agent:
Harden my software against REA
Your host agent automatically orchestrates BLA's MCP tools (bla_weave_plan → source-level logic weaving & string encryption → bla_verify_weave → bla_harden → bla_verify) to harden both your source architecture and compiled artifacts. Every result carries nextSteps, so the agent finishes the job: it asks before promoting the hardened files over the build output (apply), then runs your tests.
3. Build Bundler Plugin (Vite / Rollup / Webpack / esbuild)
Protect JS chunks, strip/replace SourceMaps with VLQ v3 honey maps, and shield .wasm assets automatically at bundle time:
import { defineConfig } from "vite";
import { blaVitePlugin } from "bla-agents/bundler";
export default defineConfig({
plugins: [blaVitePlugin({ intensity: "bankrupt", honeySourceMap: true })],
});
🧠 How BLA Works: Agent-Driven Closed Loop
Traditional obfuscators only rename variables (_0x1a2b), which modern LLMs effortlessly summarize, or wrap binaries in heavy VM packers that break cross-platform builds and degrade performance.
BLA 3.x combines format-native deterministic shields with host-agent surgical source weaving:
flowchart LR
subgraph S1["1 · Recon & Plan"]
A["bla_audit / bla_lint"] --> B["bla_weave_plan"]
end
subgraph S2["2 · Agent Source Surgery"]
B --> C["bla_encrypt_strings\n(AST Span XOR + Keystream)"]
C --> D["bla_bind_scope\n(Multi-Site State Entanglement)"]
D --> E["bla_verify_weave"]
end
subgraph S3["3 · Artifact Shielding"]
E --> F["bla_harden / bla_defend\n(19+ Format Shields + Self-Seal)"]
end
subgraph S4["4 · Counter-REA Gate"]
F --> G["bla_verify\n(Structural Counter-REA Checks Only)"]
end
| Defense Pillar | Mechanism | Effect on AI Reverse-Engineering Agents |
|---|
| 1. Poison (Deception) | Plants format-valid canaries, SGX/TPM2/Secure Enclave delegation manifests, VLQ v3 honey SourceMaps, and plausible shadow state machines. | Forces LLM agents to split context across conflicting hypotheses and chase synthetic rabbit holes. |
| 2. Exhaust (Budget Breakers) | Trips the analyzer's default limits (primitive-candidates, alias-selections, ASAR 16 MiB header, WASM Wabt representation, SQLite virtual column eval, Model 32-level nesting, PCAP tshark field pass (fixed 8 MiB), Electron 32 fuse sentinels). | Downgrades REA's default examination from COMPLETE to LIMITED / CapacityError. Where REA lets the caller raise a limit this costs the attacker a retry, not the analysis — see the last column of the results table. |
| 3. Entangle (Anti-Strip & Self-Seal) | Binds sibling artifacts (JS ↔ WASM ↔ Native sidecars) via runtime SHA-256 digests (--self-seal, --sidecar-entangle) and multi-site caller scope folding (bla_bind_scope). | Prevents red-team agents from stripping decoys, nop-patching single-point checks, or calling exported functions as offline oracles. |
| 4. Runtime Truman Show | Hardens Electron V1 Fuses (RunAsNode=0, Inspect=0) and detects CDP / Node Inspector / Frida / WebDriver attachment (runtime-shield.ts). | Serves believable synthetic telemetry during live debugging while keeping normal user execution untouched. |
🔬 Empirical Results vs. Real REA
These numbers come from running real morluto/rea against BLA-hardened samples on commodity hardware (npm run redteam:rea). Full machine-readable report: docs/redteam/empirical-rea-validation.md / .json.
How to read this: “Empirically verified” means the live REA analyzer path 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.