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.

fix(setup): pin MCP registration to running BLA version instead of @latest

DeryFerdba588e6b917c
diff --git a/src/setup/setup.ts b/src/setup/setup.ts
index 40e4d0f..fe56d02 100644
--- a/src/setup/setup.ts
+++ b/src/setup/setup.ts
@@ -296,7 +296,9 @@ export function runSetup(options: SetupRunOptions = {}): SetupRunResult {
}
const mcpCommand = options.mcpCommand ?? "npx";
- const mcpArgs = options.mcpArgs ? [...options.mcpArgs] : ["-y", `${BLA_IDENTITY.packageName}@latest`, "mcp"];
+ // Pin the registered version to the BLA that is running setup so agent startup
+ // never fetches a mutable `latest` tag from the registry (supply-chain hardening).
+ const mcpArgs = options.mcpArgs ? [...options.mcpArgs] : ["-y", `${BLA_IDENTITY.packageName}@${BLA_IDENTITY.version}`, "mcp"];
const isDryRunOrPlanOnly = options.dryRun === true || options.yes === false;
if (isDryRunOrPlanOnly) {
diff --git a/tests/setup-mcp-doctor-release.test.ts b/tests/setup-mcp-doctor-release.test.ts
index 7e86f94..325e19d 100644
--- a/tests/setup-mcp-doctor-release.test.ts
+++ b/tests/setup-mcp-doctor-release.test.ts
@@ -177,7 +177,7 @@ describe("Issue #8: Native Client Config Formats, Accurate Detection & Cross-Pla
expect(writtenToml).toContain("[mcp_servers.git]");
expect(writtenToml).toContain("[mcp_servers.bla]");
expect(writtenToml).toContain('command = "npx"');
- expect(writtenToml).toContain('args = ["-y", "bla-agents@latest", "mcp"]');
+ expect(writtenToml).toContain(`args = ["-y", "bla-agents@${BLA_IDENTITY.version}", "mcp"]`);
// Verify VS Code native mcp.json uses root key `servers` (NOT `mcpServers`)
const writtenVscode = JSON.parse(readFileSync(vscodeClient.configPath, "utf8")) as Record<
@@ -193,7 +193,7 @@ describe("Issue #8: Native Client Config Formats, Accurate Detection & Cross-Pla
expect(vscodeServers.bla).toEqual({
type: "stdio",
command: "npx",
- args: ["-y", "bla-agents@latest", "mcp"],
+ args: ["-y", `bla-agents@${BLA_IDENTITY.version}`, "mcp"],
});
// Verify OpenCode native opencode.json uses root key `mcp` with `type: "local"` and `command` array
@@ -208,7 +208,7 @@ describe("Issue #8: Native Client Config Formats, Accurate Detection & Cross-Pla
expect(opencodeMcp.memory).toBeDefined();
expect(opencodeMcp.bla).toEqual({
type: "local",
- command: ["npx", "-y", "bla-agents@latest", "mcp"],
+ command: ["npx", "-y", `bla-agents@${BLA_IDENTITY.version}`, "mcp"],
enabled: true,
});
});