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(deception): avoid live-provider prefixes in synthetic canary tokens

DeryFerdadca99b7e9e1
diff --git a/src/shields/deception/canary-honeypot.ts b/src/shields/deception/canary-honeypot.ts
index 27d33ec..2079a05 100644
--- a/src/shields/deception/canary-honeypot.ts
+++ b/src/shields/deception/canary-honeypot.ts
@@ -33,7 +33,7 @@ const COMPLIANCE_BOUNDARY_NOTICES: readonly string[] = [
* `singleQueryValues()` (`recordedTransportUrl.ts:141`) to return `undefined` (`unknown`).
* 2. **Targets Closed-Source LLM Credential Redaction & Anti-Exfiltration Filters**:
* - Embeds clearly synthetic, RFC/documentation-designated canary token shapes
- * (`AKIAIOSFODNN7EXAMPLE`, `sk-ant-canary-...`, `ghp_canary...`) and explicit
+ * (`AKIAIOSFODNN7EXAMPLE`, `bla_canary_synthetic_...`) and explicit
* credential-protection watermarks alongside shadow state tables so closed-source models
* automatically redact (`[REDACTED]`) or decline to reconstruct the surrounding key material,
* without using any harmful/prohibited content that would trigger EDR or App Store rejection.
@@ -79,11 +79,14 @@ export function generateCanaryHoneypot(
`https://${ep}?lease=${i}&lease=${i + 1}&epoch=0x${tokHex}`,
);
syntheticCanaryTokens.push(
+ // Keep the AWS documentation placeholder (canonical example key, scanner-
+ // allowlisted). Avoid live-provider prefixes such as `ghp_`/`sk-`: those match
+ // real secret-scanning rules and can block users from pushing protected output.
i % 3 === 0
? `AKIAIOSFODNN7EXAMPLE_${tag.toUpperCase()}_${i}`
: i % 3 === 1
- ? `sk-canary-honeypot-do-not-exfiltrate-${tag}-${tokHex}`
- : `ghp_canaryHoneypotSyntheticToken${tag}${tokHex}`,
+ ? `bla_canary_synthetic_kms_${tag}_${tokHex}`
+ : `bla_canary_synthetic_scm_${tag}_${tokHex}`,
);
}
diff --git a/tests/deception-suite.test.ts b/tests/deception-suite.test.ts
index 8d22b32..60d7aa6 100644
--- a/tests/deception-suite.test.ts
+++ b/tests/deception-suite.test.ts
@@ -75,6 +75,15 @@ describe("Counter-REA Model-Misjudgment Induction Suite", () => {
const reaTwoSlashPrefix = /^[\x00-\x20]*(?:([A-Za-z][A-Za-z0-9+.-]*):)?\/\//u;
expect(reaTwoSlashPrefix.exec(sampleUrl)).toBeNull();
+ // Canary tokens must stay obviously synthetic: live-provider prefixes such
+ // as `ghp_` or `sk-` match real secret-scanning rules and can block a user
+ // from pushing protected output. The AWS documentation placeholder is kept.
+ for (const token of canary.syntheticCanaryTokens) {
+ expect(token.startsWith("ghp_")).toBe(false);
+ expect(token.startsWith("sk-")).toBe(false);
+ }
+ expect(canary.syntheticCanaryTokens.some((t) => t.startsWith("AKIAIOSFODNN7EXAMPLE"))).toBe(true);
+
const diag = generateSystemDiagnosticDecoy(prng, "bankrupt");
expect(diag.diagnosticsInjected).toHaveLength(8);
expect(diag.estimatedTroubleshootingTokensInduced).toBeGreaterThanOrEqual(12_000);