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.

chore(supply-chain): zod bump, tag-only release, pin Actions, CI matrix

qybaihe80270f35c671
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..e025ae7
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,16 @@
+version: 2
+updates:
+ - package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: weekly
+ open-pull-requests-limit: 10
+ labels:
+ - dependencies
+ - package-ecosystem: github-actions
+ directory: "/"
+ schedule:
+ interval: weekly
+ open-pull-requests-limit: 5
+ labels:
+ - dependencies
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0b51bf3..f01ec10 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,14 +18,21 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest, macos-latest]
- node: [24]
+ include:
+ - os: ubuntu-latest
+ node: 24
+ - os: macos-latest
+ node: 24
+ - os: windows-latest
+ node: 24
+ - os: ubuntu-latest
+ node: 22
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Setup Node.js ${{ matrix.node }}
- uses: actions/setup-node@v4
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node }}
cache: npm
@@ -46,6 +53,7 @@ jobs:
run: npm run benchmark
- name: Verify CLI doctor & update commands
+ shell: bash
run: |
node dist/cli.js --version
node dist/cli.js doctor --json
@@ -55,7 +63,6 @@ jobs:
id: rea
shell: bash
run: |
- # Sibling checkout patterns: ../rea (monorepo-style) or $REA_ROOT.
REA_CANDIDATE="${REA_ROOT:-$(dirname "$GITHUB_WORKSPACE")/rea}"
if [ -d "$REA_CANDIDATE/src" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
@@ -68,6 +75,7 @@ jobs:
fi
- name: Verify REA constant alignment (skip if REA absent)
+ shell: bash
env:
REA_ROOT: ${{ steps.rea.outputs.root }}
run: |
@@ -78,6 +86,7 @@ jobs:
npm run verify:rea
- name: Empirical REA red-team (skip if REA absent)
+ shell: bash
env:
REA_ROOT: ${{ steps.rea.outputs.root }}
run: |
@@ -85,7 +94,6 @@ jobs:
echo "SKIP: npm run redteam:rea (sibling REA not checked out alongside BLA)"
exit 0
fi
- # Ensure REA dist is built when the sibling tree is present.
if [ ! -f "${REA_ROOT}/dist/go/GoBinaryImage.js" ]; then
echo "Building REA dist for red-team…"
(cd "$REA_ROOT" && npm install --ignore-scripts && npx tsc -p tsconfig.build.json)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f24f1ca..861f451 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,29 +1,18 @@
name: Release bla-agents
+# Tag-only releases. Do not publish on plain main pushes.
on:
push:
- branches:
- - main
tags:
- "bla-agents-*"
- "v*"
workflow_dispatch:
inputs:
version:
- description: "Expected release version (must match package.json after optional bump)"
+ description: "Expected release version (must match package.json / tag)"
required: false
default: ""
type: string
- bump:
- description: "Optional version bump before publishing (none | patch | minor | major)"
- required: false
- default: "none"
- type: choice
- options:
- - none
- - patch
- - minor
- - major
permissions:
contents: write
@@ -35,16 +24,16 @@ concurrency:
jobs:
release:
- name: Build, Verify & Auto-Publish bla-agents to npm
+ name: Build, Verify & Publish bla-agents (OIDC / Trusted Publishing)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- name: Setup Node.js 24
- uses: actions/setup-node@v4
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
@@ -53,18 +42,6 @@ jobs:
- name: Install dependencies
run: npm ci
- - name: Optional version bump (on workflow_dispatch)
- if: ${{ github.event_name == 'workflow_dispatch' && inputs.bump != 'none' && inputs.bump != '' }}
- run: |
- git config user.name "github-actions[bot]"
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- npm version "${{ inputs.bump }}" --no-git-tag-version
- node scripts/sync-version.mjs
- VERSION=$(node -p "require('./package.json').version")
- git add package.json package-lock.json src/identity.ts
- git commit -m "chore(release): bump bla-agents to v${VERSION}"
- git push origin HEAD:main
-
- name: Verify version, trigger tag, and target tag commit consistency
id: check_npm
env:
@@ -77,7 +54,6 @@ jobs:
HEAD_SHA=$(git rev-parse HEAD)
TAG="bla-agents-${LOCAL_VERSION}"
- # 1. Verify workflow_dispatch version input matches manifest if provided
if [ -n "${DISPATCH_VERSION}" ]; then
NORM_DISPATCH="${DISPATCH_VERSION#v}"
NORM_DISPATCH="${NORM_DISPATCH#bla-agents-}"
@@ -87,7 +63,6 @@ jobs:
fi
fi
- # 2. Verify trigger tag matches manifest if triggered by refs/tags/*
if [[ "${TRIGGER_REF}" == refs/tags/* ]]; then
RAW_TAG="${TRIGGER_REF#refs/tags/}"
if [[ "${RAW_TAG}" == bla-agents-* ]]; then
@@ -102,6 +77,11 @@ jobs:
echo "::error::Trigger tag '${RAW_TAG}' does not match package.json version '${LOCAL_VERSION}'"
exit 1
fi
+ elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
+ echo "::notice::workflow_dispatch release for bla-agents@${LOCAL_VERSION} (tag ${TAG})"
+ else
+ echo "::error::Release workflow only runs on version tags or workflow_dispatch"
+ exit 1
fi
PRIMARY_NPM_VERSION=$(npm view "bla-agents@${LOCAL_VERSION}" version 2>/dev/null || echo "none")
@@ -111,14 +91,11 @@ jobs:
if [ "${LOCAL_VERSION}" != "${PRIMARY_NPM_VERSION}" ] && ! gh release view "${TAG}" >/dev/null 2>&1; then
SHOULD_PUBLISH="true"
- elif [ "${{ github.event_name }}" = "workflow_dispatch" ] || [[ "${TRIGGER_REF}" == refs/tags/* ]]; then
- SHOULD_PUBLISH="true"
else
- SHOULD_PUBLISH="false"
- echo "bla-agents@${LOCAL_VERSION} release '${TAG}' already exists; skipping release on regular branch push."
+ SHOULD_PUBLISH="true"
+ echo "Release requested for bla-agents@${LOCAL_VERSION}; will attempt idempotent publish/GitHub Release."
fi
- # 3. Verify existing remote/local tag points to current HEAD_SHA when publishing/releasing
EXISTING_TAG_SHA=""
if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
git fetch origin "refs/tags/${TAG}:refs/tags/${TAG}" --force
@@ -135,7 +112,7 @@ jobs:
echo "should_publish=${SHOULD_PUBLISH}" >> "$GITHUB_OUTPUT"
- - name: Run full verification gates (typecheck, build, test, 8-target benchmark)
+ - name: Run full verification gates (typecheck, build, test, benchmark)
if: steps.check_npm.outputs.should_publish == 'true'
run: |
npm run typecheck
@@ -171,7 +148,9 @@ jobs:
'
cat release-assets/SHA256SUMS.txt
- - name: Publish bla-agents tarball to npm
+ # Prefer npm Trusted Publishing (OIDC). Optional NPM_TOKEN remains as a fallback
+ # when OIDC is not yet configured on the npm package. Never publish without provenance.
+ - name: Publish bla-agents tarball to npm (provenance required)
if: steps.check_npm.outputs.should_publish == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -182,11 +161,16 @@ jobs:
if npm view "bla-agents@${VERSION}" version >/dev/null 2>&1; then
echo "bla-agents@${VERSION} is already published on npm; skipping primary publish."
- elif [ -z "${NODE_AUTH_TOKEN:-}" ] || ! npm whoami >/dev/null 2>&1; then
- echo "::notice::Valid NPM_TOKEN not available in environment; skipping npm registry publish and proceeding to GitHub Release."
+ exit 0
+ fi
+
+ # Trusted Publishing (OIDC) needs no token. If NPM_TOKEN is set, it is used
+ # with provenance. There is intentionally no --access-only / no-provenance fallback.
+ if npm publish "${PRIMARY_TGZ}" --provenance --access public; then
+ echo "Published bla-agents@${VERSION} with provenance."
else
- npm publish "${PRIMARY_TGZ}" --provenance --access public \
- || npm publish "${PRIMARY_TGZ}" --access public
+ echo "::error::npm publish --provenance failed. Configure npm Trusted Publishing (OIDC) for qybaihe/bla or set a valid NPM_TOKEN secret. Refusing to publish without provenance."
+ exit 1
fi
- name: Create or idempotently verify GitHub Release (no cross-commit clobber)
diff --git a/.github/workflows/website-pages.yml b/.github/workflows/website-pages.yml
index 5bcaa50..bdd82b9 100644
--- a/.github/workflows/website-pages.yml
+++ b/.github/workflows/website-pages.yml
@@ -17,7 +17,7 @@ jobs:
name: Verify website HTML, assets & links
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Verify required pages and assets exist
run: |
@@ -34,7 +34,9 @@ jobs:
website/assets/logo.png \
website/assets/favicon.png \
website/assets/favicon.svg \
- website/assets/social-card.svg; do
+ website/assets/social-card.svg \
+ website/schemas/defense-manifest-v1.json \
+ website/schemas/bla.config.v1.json; do
test -f "$f" || (echo "Missing required website file: $f" && exit 1)
done
echo "All website pages and assets verified."
diff --git a/.gitignore b/.gitignore
index 745ecb4..5754c58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,8 @@ coverage/
.env.*
tmp/
.bla-cache/
+
+# Per-project BLA config / seed (local)
+.blarc
+.blarc.json
+bla.config.json
diff --git a/.nvmrc b/.nvmrc
index 2bd5a0a..a45fd52 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-22
+24
diff --git a/package-lock.json b/package-lock.json
index e466cbe..9837800 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,19 +1,19 @@
{
"name": "bla-agents",
- "version": "1.4.0",
+ "version": "1.5.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bla-agents",
- "version": "1.4.0",
+ "version": "1.5.2",
"license": "MIT",
"dependencies": {
"@babel/generator": "^7.26.0",
"@babel/parser": "^7.26.0",
"@babel/traverse": "^7.26.0",
"@babel/types": "^7.26.0",
- "zod": "^3.24.0"
+ "zod": "^4.6.7"
},
"bin": {
"bla": "dist/cli.js",
@@ -29,7 +29,7 @@
"vitest": "^2.1.8"
},
"engines": {
- "node": "^22.13.0 || >=24.0.0"
+ "node": "^22.23.4 || >=24.0.0"
}
},
"node_modules/@babel/code-frame": {
@@ -2213,9 +2213,9 @@
}
},
"node_modules/zod": {
- "version": "3.25.76",
- "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
- "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
+ "version": "4.6.7",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
+ "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
diff --git a/package.json b/package.json
index 0984424..d8040f8 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "bla-agents",
"version": "1.5.2",
- "description": "BLA (Blind LLM Agents) \u2014 Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, WebAssembly, SQLite, AI Models, and Android DEX/IL2CPP against AI reverse-engineering agents like REA.",
+ "description": "BLA (Blind LLM Agents) — Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, WebAssembly, SQLite, AI Models, and Android DEX/IL2CPP against AI reverse-engineering agents like REA.",
"keywords": [
"reverse-engineering-defense",
"anti-rea",
@@ -55,7 +55,7 @@
"DISCLAIMER.md"
],
"engines": {
- "node": "^22.13.0 || >=24.0.0"
+ "node": "^22.23.4 || >=24.0.0"
},
"scripts": {
"build": "node scripts/sync-version.mjs && tsc -p tsconfig.build.json && chmod +x dist/cli.js",
@@ -78,7 +78,7 @@
"@babel/parser": "^7.26.0",
"@babel/traverse": "^7.26.0",
"@babel/types": "^7.26.0",
- "zod": "^3.24.0"
+ "zod": "^4.6.7"
},
"devDependencies": {
"@types/babel__generator": "^7.6.8",
diff --git a/tests/sqlite-runtime.test.ts b/tests/sqlite-runtime.test.ts
index 6b2aa08..d717a95 100644
--- a/tests/sqlite-runtime.test.ts
+++ b/tests/sqlite-runtime.test.ts
@@ -20,7 +20,7 @@ describe("SQLite runtime floor", () => {
) as {
engines?: { node?: string };
};
- expect(pkg.engines?.node).toBe("^22.13.0 || >=24.0.0");
+ expect(pkg.engines?.node).toBe("^22.23.4 || >=24.0.0");
});
it("exposes an availability probe that matches getDatabaseSyncClass success", () => {