Skip to content

armgit / bla

Public Imported from GitHub
0

πŸ›‘οΈ BLA (Blind LLM Agents) β€” Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, and WebAssembly against AI reverse-engineering agents like REA. Poison -> Exhaust -> Hallucinate.

docs: document opt-in ed25519 manifest signing

DeryFerdd3572766a369
diff --git a/README.md b/README.md
index 8c722c9..e0eba76 100644
--- a/README.md
+++ b/README.md
@@ -194,7 +194,7 @@ Protections are format-native (no commercial packer / external LLVM required). R
- **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.
- **`--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.
-- **`--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).
+- **`--manifest`** β€” `.bla-manifest.json` is an **opt-in** attestation and is **unsigned by default**. Add `--sign-manifest --manifest-key <pem>` to attach an ed25519 signature (the SPKI public key is embedded in the manifest), or use `signManifest` + `manifestSigningKeyPath` from the API. Schema: [`defense-manifest-v1.json`](website/schemas/defense-manifest-v1.json).
## FAQ
diff --git a/docs/cli-and-mcp.md b/docs/cli-and-mcp.md
index e84b684..d4db1f6 100644
--- a/docs/cli-and-mcp.md
+++ b/docs/cli-and-mcp.md
@@ -9,7 +9,7 @@ For coding agents, the **[`blind-llm-agents` skill](../.agents/skills/blind-llm-
| `npx bla-agents setup` | Auto-registers the `bla` MCP server and `blind-llm-agents` skill with Claude Code, Cursor, Codex, Windsurf, Gemini CLI, and Antigravity. |
| `npx bla-agents harden .` | **Default one-command UX**: auto-discover build outputs and run audit β†’ protect β†’ verify (bankrupt). Prefer over `defend` when you have a project directory. Agent guide: [`blind-llm-agents` skill](../.agents/skills/blind-llm-agents/SKILL.md). |
| `npx bla-agents lint .` | **Unified packaging-footgun scan** (`bla-packaging-gates/v1`): all R1–R7 refuse lints + lanes/panel. Exit 2 when bankrupt would refuse. Writes nothing. |
-| `npx bla-agents defend <target> [--manifest] [--llm-directives] [--weave-decoys]` | **5-stage pipeline** on a known path: `inspect-release` β†’ `audit` β†’ `protect` β†’ `verify` β†’ optional **unsigned** `.bla-manifest.json` (opt-in). Risky LLM directive layers stay off unless `--llm-directives`. Structural weave decoys stay off unless `--weave-decoys`. |
+| `npx bla-agents defend <target> [--manifest] [--sign-manifest --manifest-key <pem>] [--llm-directives] [--weave-decoys]` | **5-stage pipeline** on a known path: `inspect-release` β†’ `audit` β†’ `protect` β†’ `verify` β†’ optional `.bla-manifest.json` (opt-in; unsigned unless `--sign-manifest` is set). Risky LLM directive layers stay off unless `--llm-directives`. Structural weave decoys stay off unless `--weave-decoys`. |
| `npx bla-agents harden . [--weave-decoys]` | Same as `harden` with opt-in structural weave (`weave_decoys`). |
| `npx bla-agents inspect-release <target>` | Read-only local scan for embedded `.map` (`sourcesContent`) and sourceMappingURL references. |
| `npx bla-agents audit <target>` | Pre-flight 16-vector REA vulnerability & token-cost audit. |
@@ -19,6 +19,34 @@ For coding agents, the **[`blind-llm-agents` skill](../.agents/skills/blind-llm-
| `npx bla-agents emit-headers --lang <c\|rust\|go>` | Emits compile-time native defense headers (`bla_shield.h`, `bla_shield.rs`, `bla_shield.go`). |
| `npx bla-agents doctor` | Checks readiness of all BLA protection engines and agent MCP registrations. |
+### Signed manifests (ed25519)
+
+`.bla-manifest.json` is unsigned by default. To sign it:
+
+```bash
+bla defend ./dist --manifest --sign-manifest --manifest-key ./release-key.pem
+```
+
+The manifest keeps the plain JSON payload and adds a `signature` object with
+`algorithm: "ed25519"`, the SPKI public key, and a base64 signature over the
+payload JSON (the `signature` field is excluded). `attestationKind` is
+`"unsigned"` or `"ed25519"`, so consumers can tell whether a signature exists.
+
+Verify with the library:
+
+```ts
+import { readFileSync } from "node:fs";
+import { verifyManifestSignature } from "bla-agents";
+
+const manifest = JSON.parse(readFileSync(".bla-manifest.json", "utf8"));
+// Without a pinned key this only proves the payload matches the embedded key.
+verifyManifestSignature(manifest);
+```
+
+Signing fails closed: `--sign-manifest` without `--manifest-key`, a missing key
+file, or a key path without `--manifest` is an error, never a silently unsigned
+manifest.
+
## MCP Tools (`bla` Server)
- `bla_harden`: Preferred one-sentence harden of a project directory (`directory`, `intensity`, `emit_manifest` default false, `llm_directives` default false, `weave_decoys` default false, `self_seal` default false, `wasm_preserve_exports`, `allow_lane_independent`, `allow_plaintext_seal`, `allow_wasm_clear_params`, `allow_stable_panel_derive`, `seed`, `dry_run` default false, `max_artifacts` default 64, `confirm_overwrite` default false, `output_directory` optional). The report carries `dryRun`, `truncated`, `maxArtifacts`, `wouldOverwrite`, and `outputDirectory`.