blake-gate
Policy outside the model.
Part of blake-guard: compile owner rules into a policy artifact, then gate every dangerous intent before the tool runs. Same package on Blake or your host.
blake-guard · blake-gate · Apache-2.0 · Node ≥ 20
why
Gate before the tool.
Outside the model
The LLM proposes intents. The gate decides. Prompts are not the enforcement layer.
Allow · deny · ask
Every dangerous action returns allow, deny, or require_approval — with reasons and rule ids for audit.
Spawn locked by default
agent.spawn and agent.replicate default to deny — uncontrolled replication stays at zero until the owner authorizes.
install
Get the package.
npm install blake-gate
# or from GitHub
npm install github:ndblk3/blake-gategate
Compile, then evaluate.
import { compilePolicy, evaluateIntent } from "blake-gate";
const policy = compilePolicy({
agentId: "your-agent-id",
ownerId: "your-user-id",
environment: "personal_private",
agentSpawn: "deny",
agentReplicate: "deny",
connectors: [{ id: "github", tier: "write" }],
stops: "No send. No force-push.",
});
const decision = evaluateIntent(
{ type: "git.merge", agentId: "your-agent-id", environment: "personal_private", connectorId: "github" },
policy,
{ now: new Date().toISOString() },
);intents
What the gate understands.
run.startsecret.readgit.pushgit.force_pushgit.open_prgit.mergemail.sendchat.sendoutbound.publishagent.spawnagent.replicate
cli
No import required.
npx blake-gate compile --in source.json --out policy.json
npx blake-gate evaluate --policy policy.json --intent intent.json
npx blake-gate materialize --policy policy.json --dir ./workspaceschematics
Not a prompt.
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 wired into runs.
Blake gates run.start, writes .blake-policy/, and owners can probe intents at /api/account/policy.
Part of blake-guard — gate · witness · trail.