spine
Gate · witness · trail.
Three independent npm packages. Same contract on Blake or your own runner — no Blake UI required.
- 01
- 02
- 03
install
Add the suite.
npm install blake-gate blake-witness blake-trail
# Gate before the tool
import { compilePolicy, evaluateIntent } from "blake-gate";
# Witness FS contact
import { createFsAccessLog, recordSpaceAccess } from "blake-witness";
# Trail after the fact
import { createFsComplianceLog, recordDecision, recordOutcome } from "blake-trail";loop
Before the tool. After the fact.
Compile owner rules → evaluate every dangerous intent → record the decision → run only on allow → record whether the side-effect happened → witness space contact.
const policy = compilePolicy({
agentId, ownerId,
agentSpawn: "deny", // default
agentReplicate: "deny", // uncontrolled replication = 0
connectors: [{ id: "github", tier: "write" }],
});
const decision = evaluateIntent(intent, policy, ctx);
await recordDecision(trail, { …decision fields });
if (decision.effect !== "allow") throw new Error("blocked");
// … run tool …
await recordOutcome(trail, {
fingerprint: decision.fingerprint,
expectedEffect: decision.effect,
occurred: true,
});
await recordSpaceAccess(accessLog, { spaceId, op: "write", actor });replication
Uncontrolled replication = 0.
agent.spawn and agent.replicate default to deny on the policy artifact. Set require_approval or allow only when the owner explicitly authorizes growth. Anything else is a hard stop — and a trail violation if it still occurs.
intent catalog
What the gate understands.
run.startsecret.readgit.pushgit.force_pushgit.open_prgit.mergemail.sendchat.sendoutbound.publishagent.spawnagent.replicate
gate deep dive
Schematics — not a prompt.
How blake-gate compiles artifacts, fingerprints intents, and verifies allow tokens.
Prompts are not enforcement. The decision object carries effect, rules, fingerprint, and optional signed allowToken.
- Host maps product fields → PolicySource.
compilePolicystampspolicyHash/ version.materializePolicyWorkspacewrites.blake-policy/+ history jsonl.diffPoliciesshows what changed for this agent.
personal_private
may personal secrets
not practice credentials
org_private
may org secrets
not personal secrets
hire_sandbox
may practice tools only
not personal · org
CI: npx blake-gate env-check · assertEnvIsolation()
Competitors often stop at “before.” Drift between prompt and merge log becomes a violation event.
type · target · repo · branch · agent · envNot chat moderation — capability tickets. Without a valid allow-token, merge/send must refuse even if the model “decides.”
- Cursor CLI
- Claude Code
- GitHub Actions
- custom worker
- Blake host
Delivery adapters stay thin. Core is runtime — approval is protocol, not a Blake-only UI.
on Blake
Already on the host.
Blake depends on the public packages — not a private fork. Runs gate run.start, materialize .blake-policy/, witness spaces under .blake-space-access/, append the compliance trail under .blake-compliance/, and owners can probe policy at /api/account/policy.