Update to Atbash Safety
Snapshot Nov 22, 2026 · 12:12 UTC · version 0.3.5
Package or technical metadata updated
Package or technical metadata updated
Observed in package metadata. These changes alone do not establish a new customer-facing feature.
Up to 3 plugins free · no card required.
All fields and original values.
These are saved file metadata. Open a changed file to read its text edits.
Package file
Nov 2, 2026 · 12:47 UTC
534ef507f0d85ce94d2d7b07a32e706af35c517b3c2c70e3e657ed35e357080c
Nov 22, 2026 · 12:12 UTC
cb9a06cc286c130250f0fba59a038b6256ca38cbbca1780c77bdd66a9ac93251
Package file
Nov 2, 2026 · 12:47 UTC
1878
Nov 22, 2026 · 12:12 UTC
1404
Package file
Nov 2, 2026 · 12:47 UTC
ecf21c55cce78863d269cb23b95b2bf9573d2a67849183bcfbcbe13c44dad9e9
Nov 22, 2026 · 12:12 UTC
5b7b62abff9016087ebe9f363063133ed40a134c2e56b2b230ecf71a8af4e4dd
Package file
Nov 2, 2026 · 12:47 UTC
711540
Nov 22, 2026 · 12:12 UTC
644493
Compare saved observations
Download comparison JSONChanged files
Choose a file to see its text changes. Binary or large files show metadata only.
runtime/licenses/atbash-sdk.LICENSE →
runtime/native/darwin-arm64/atbash.node →
runtime/native/linux-arm64/atbash.node →
runtime/native/linux-x64/atbash.node →
runtime/native/win32-x64/atbash.node →
runtime/pre-tool-use-main.cjs →
runtime/pre-tool-use-shim.cjs →
skills/atbash-manage/SKILL.md →
skills/atbash-manage/agents/openai.yaml →
skills/atbash-safety/SKILL.md →
skills/atbash-safety/agents/openai.yaml →
skills/atbash-safety/scripts/atbash-safety.mjs →
skills/atbash-setup/SKILL.md →
runtime/pre-tool-use.cjs
− removed · + added
--- before +++ after @@ -0,0 +1,273 @@ +"use strict"; +// The process the host starts (runtime/pre-tool-use.cjs). Plain CommonJS, no dependencies, never +// bundled, and it never loads the native SDK. It runs the real hook - the shim, which loads the +// bundle and the native addon - in a CHILD process, and keeps its own clock. +// +// Why a second process: the shim's deadline timer lives on the shim's event loop. A synchronous +// stall in that process - the native addon's load held by an antivirus scanner (measured on +// 2026-10-20: over 25 s for atbash.node under a PowerShell-started node), a hang inside the addon, +// a suspended process - keeps that timer from ever running, and the host's own timeout (35 s) +// is a permit on both hosts. The supervisor's loop is never blocked by the child, so its timer +// runs whatever the child does: past the deadline the child is killed and the call is denied. +// +// The answer the host sees is decided here, from what the child produced: +// - exit 0, an empty stdout AND the shim's permit sign on the private fd 3 pipe: the bundle's +// explicit permit - nothing is written. The sign is written from the shim's exit listener, so +// a child that ends 0 without running its listeners (process.reallyExit(0), a native exit(0)) +// has no sign and is denied: silence alone is never a permit; +// - exit 0 with exactly one PreToolUse deny: that deny, re-serialized here; +// - anything else - another exit code, a signal, unparseable or extra output, a child that +// could not start, a child still running at the deadline: a deny with exit 0. +// The child's stderr is relayed to the host's stderr (the transcript), bounded, so the host's +// output handles are held by this process alone: a killed child whose teardown the OS defers (a +// scanner holding it in a kernel wait) cannot keep the host waiting for end-of-file. +// +// What this cannot close: a stall of THIS process before its timer is armed (node itself not +// starting) or while it starts the child (process creation held by a scanner in this process's +// context) - only the host timeout ends those; this file loads nothing but node built-ins. Code +// preloaded into this process (NODE_OPTIONS=--require) runs here as it runs in the shim: the +// supervisor shares the shim's in-process trust boundary (src/hook/shim.cjs, header) and adds none. +const { spawn } = require("node:child_process"); +const fs = require("node:fs"); +const path = require("node:path"); + +// Taken once, before anything else in the process can run (the shim does the same). +const writeSync = fs.writeSync; + +// The shim's own deadline bounds (src/hook/shim.cjs). The supervisor fires after the shim's +// deadline, so a live shim always answers first with its own reason, and still well under the +// host's 35 s: 30 s (the largest shim deadline) + 1.5 s = 31.5 s from the supervisor's start. +const DEFAULT_DEADLINE_MS = 28000; +const MIN_DEADLINE_MS = 1000; +const MAX_DEADLINE_MS = 30000; +const SUPERVISOR_MARGIN_MS = 1500; +// The largest deny written to the host, in serialized bytes - the shim's bound (see there). +const MAX_DENY_BYTES = 3584; +// The child's stdout is at most one bounded deny; anything far larger is not a decision. +const MAX_CHILD_STDOUT_BYTES = 16384; +// The child's log lines relayed to the host's stderr, in total. Written synchronously and kept, +// with the supervisor's own short reason lines, under the smallest pipe buffer a host hands a hook +// (4 KiB), so a host that never reads stderr cannot block this process's event loop - and with it +// the deadline. Lines past the bound are dropped with one note. +const MAX_STDERR_RELAY_BYTES = 2048; +// The shim's permit sign (src/hook/shim.cjs PERMIT_SIGN), on the private fd 3 pipe. +const PERMIT_SIGN = "atbash-permit\n"; +const WRITE_RETRY_WAIT_MS = 25; +const WRITE_STALL_BUDGET_MS = 2000; +// The write to the host is bounded in wall-clock time as well as by the stall budget: a transport +// that keeps taking one byte between refusals is never "stalled", and a 900-byte deny through it +// took over 45 s in the shim before the shim got the same bound. No retry starts after this many +// ms of uptime - 1.5 s past the supervisor's latest possible deadline, 1.5 s under the host's 35 s. +const WRITE_CEILING_MS = MAX_DEADLINE_MS + SUPERVISOR_MARGIN_MS + 1500; + +function shimDeadlineMs(raw) { + if (raw === undefined || raw.trim() === "") return DEFAULT_DEADLINE_MS; + const parsed = Number(raw); + if (!Number.isInteger(parsed) || parsed < MIN_DEADLINE_MS || parsed > MAX_DEADLINE_MS) { + // The shim denies an invalid value at once; the supervisor only needs an upper bound. + return MAX_DEADLINE_MS; + } + return parsed; +} + +function serializeDeny(reason) { + return ( + JSON.stringify({ + hookSpecificOutput: { + hookEventName: "PreToolUse", + permissionDecision: "deny", + permissionDecisionReason: reason, + }, + }) + "\n" + ); +} + +// The deny the child produced, or null. Exactly one PreToolUse deny object with a string reason; +// the reason is re-serialized so no sibling key the child wrote reaches the host. +function childDeny(stdout) { + const trimmed = stdout.trim(); + if (!trimmed.startsWith("{") || trimmed.includes("\n")) return null; + try { + const out = JSON.parse(trimmed)?.hookSpecificOutput; + if ( + typeof out === "object" && + out !== null && + out.hookEventName === "PreToolUse" && + out.permissionDecision === "deny" && + typeof out.permissionDecisionReason === "string" + ) { + const text = serializeDeny(out.permissionDecisionReason); + // The shim already bounds its deny; a child that did not is not trusted with the host's pipe. + return Buffer.byteLength(text, "utf8") <= MAX_DENY_BYTES ? text : null; + } + } catch { + // not a decision + } + return null; +} + +// The supervisor's deadline, in ms of this process's uptime. +const DEADLINE_AT_MS = shimDeadlineMs(process.env.ATBASH_HOOK_DEADLINE_MS) + SUPERVISOR_MARGIN_MS; + +let decided = false; +let child = null; +let deadlineTimer = null; + +function uptimeMs() { + return Math.ceil(process.uptime() * 1000); +} + +function writeAllSync(text) { + // Every byte or an error, retried on EAGAIN without outliving the host's timeout (the shim's + // writeDecisionSync, without its in-process adversary handling: no bundle runs here). The + // first attempt always happens; retries stop at the stall budget or at the give-up: 1.5 s past + // this run's deadline, or one stall budget after the first attempt if that is later, and never + // past WRITE_CEILING_MS. + const buffer = Buffer.from(text, "utf8"); + let offset = 0; + let attempts = 0; + const firstAttempt = uptimeMs(); + const giveUp = Math.min( + WRITE_CEILING_MS, + Math.max(DEADLINE_AT_MS + 1500, firstAttempt + WRITE_STALL_BUDGET_MS), + ); + let lastProgress = firstAttempt; + while (offset < buffer.length) { + if (attempts > 0) { + const now = uptimeMs(); + if (now >= giveUp || now - lastProgress >= WRITE_STALL_BUDGET_MS) { + throw Object.assign(new Error("the decision could not be written"), { code: "ETIMEDOUT" }); + } + } + attempts += 1; + try { + const written = writeSync(1, buffer, offset, buffer.length - offset); + if (!Number.isInteger(written) || written < 0 || written > buffer.length - offset) { + throw Object.assign(new Error("impossible byte count"), { code: "EIO" }); + } + if (written > 0) { + offset += written; + lastProgress = uptimeMs(); + continue; + } + } catch (error) { + if (!(error && error.code === "EAGAIN")) throw error; + } + Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, WRITE_RETRY_WAIT_MS); + } +} + +function finish(text) { + if (decided) return; + decided = true; + if (deadlineTimer !== null) clearTimeout(deadlineTimer); + if (child !== null && child.exitCode === null && child.signalCode === null) { + try { + child.kill("SIGKILL"); + } catch { + // already gone + } + } + if (text === "") { + process.exit(0); + return; + } + try { + writeAllSync(text); + process.exit(0); + } catch { + // stdout is gone: a blocking exit (Claude Code), never 0 with an empty, permit-shaped stdout. + try { + writeSync(2, "Atbash ERROR: the decision could not be delivered to the host.\n"); + } catch { + // nothing left to report to + } + process.exit(2); + } +} + +function deny(reason) { + finish(serializeDeny(reason)); +} + +// Last word: a supervisor that ends any other way still denies. +process.on("uncaughtException", () => deny("Atbash ERROR: the hook supervisor failed.")); +process.on("exit", () => { + if (decided) return; + decided = true; + try { + writeAllSync(serializeDeny("Atbash ERROR: the hook ended without a decision.")); + process.exitCode = 0; + } catch { + process.exitCode = 2; + } +}); + +// Armed first, before the child exists: the clock counts from this process's start. +deadlineTimer = setTimeout( + () => deny("Atbash ERROR: the safety check did not finish before the host's hook timeout."), + Math.max(0, DEADLINE_AT_MS - uptimeMs()), +); + +try { + child = spawn(process.execPath, [path.join(__dirname, "pre-tool-use-shim.cjs")], { + env: { ...process.env, ATBASH_HOOK_PERMIT_FD: "3" }, + stdio: ["pipe", "pipe", "pipe", "pipe"], + windowsHide: true, + }); +} catch { + deny("Atbash ERROR: the hook runtime could not start."); +} + +if (!decided) { + const chunks = []; + let size = 0; + let overflow = false; + child.on("error", () => deny("Atbash ERROR: the hook runtime could not start.")); + child.stdout.on("data", (chunk) => { + size += chunk.length; + if (size > MAX_CHILD_STDOUT_BYTES) overflow = true; + else chunks.push(chunk); + }); + let sign = ""; + child.stdio[3].on("data", (chunk) => { + if (sign.length <= PERMIT_SIGN.length) sign += chunk.toString("utf8"); + }); + child.stdio[3].on("error", () => {}); + let relayed = 0; + child.stderr.on("data", (chunk) => { + if (relayed >= MAX_STDERR_RELAY_BYTES) return; + const room = MAX_STDERR_RELAY_BYTES - relayed; + relayed += Math.min(chunk.length, room); + try { + writeSync(2, chunk.subarray(0, room)); + if (relayed >= MAX_STDERR_RELAY_BYTES) { + writeSync(2, "\n[Atbash: further hook log lines were dropped]\n"); + } + } catch { + // the transcript is optional; the decision is on stdout + } + }); + child.stderr.on("error", () => {}); + child.stdout.on("error", () => {}); + child.stdin.on("error", () => {}); + // The host's tool-call payload, passed through unchanged. + process.stdin.on("error", () => child.stdin.end()); + process.stdin.pipe(child.stdin); + child.on("close", (code, signal) => { + if (decided) return; + const stdout = Buffer.concat(chunks).toString("utf8"); + if (code === 0 && signal === null && !overflow) { + if (stdout === "" && sign === PERMIT_SIGN) { + finish(""); + return; + } + const forwarded = childDeny(stdout); + if (forwarded !== null) { + finish(forwarded); + return; + } + } + deny("Atbash ERROR: the hook ended without a usable decision."); + }); +}
Full technical diff · 35 changed fields
changed /files/.codex-plugin~1plugin.json/sha256
"534ef507f0d85ce94d2d7b07a32e706af35c517b3c2c70e3e657ed35e357080c"
"cb9a06cc286c130250f0fba59a038b6256ca38cbbca1780c77bdd66a9ac93251"
changed /files/.codex-plugin~1plugin.json/size
1878
1404
changed /files/runtime~1control.cjs/sha256
"ecf21c55cce78863d269cb23b95b2bf9573d2a67849183bcfbcbe13c44dad9e9"
"5b7b62abff9016087ebe9f363063133ed40a134c2e56b2b230ecf71a8af4e4dd"
changed /files/runtime~1control.cjs/size
711540
644493
added /files/runtime~1index.cjs
Field was absent
{
"sha256": "bcee9cc5d2eb90ff693bc4d8237a4f6374679447afffe3a2156e94305e10a2ac",
"size": 623498
}added /files/runtime~1install-hook.cjs
Field was absent
{
"sha256": "f4fdd9a99561f49f43abc042f7bf6fa1f31e8206cdaf873b4a5a23f3569e75e2",
"size": 15854
}changed /files/runtime~1licenses~1atbash-sdk.LICENSE/sha256
"99ee25e71599d37e4ee845ab0f3c5b613238383f02ea2c877d360dcc1b5dda97"
"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
changed /files/runtime~1licenses~1atbash-sdk.LICENSE/size
1534
11358
changed /files/runtime~1manifest.json/sha256
"54bd89a7af19f3e0045f49f925628cbe34f6f8d1879138dcccdfd2eb0b560649"
"8d01efa9323a1e790349537f4e929aa7773015d00afe0c4152f73e970cfaf342"
changed /files/runtime~1manifest.json/size
758
730
changed /files/runtime~1native~1darwin-arm64~1atbash.node/sha256
"184212d2aed30ee0d114cc5988294f0cc746c82dfde7b0f532c612745d8005bc"
"739cda841ad826cc10b68125090d006fc6fee01dc020e0c26f4c89944d21fbfa"
changed /files/runtime~1native~1darwin-arm64~1atbash.node/size
4211120
4234960
changed /files/runtime~1native~1linux-arm64~1atbash.node/sha256
"c0577a859697d9aa278fc0beb5dcdaf3f37f6112370285908b13daa7524051d7"
"c8fc8305a7975aa0626f6d36c3e34b384973d19d275d85bb905889cb01c930d5"
changed /files/runtime~1native~1linux-arm64~1atbash.node/size
4573976
4605056
changed /files/runtime~1native~1linux-x64~1atbash.node/sha256
"4859d994668c0c604f84760b39f407f3b6d479e3f51ca87b6722d28159419a59"
"e2e0139335f35b2456d83bdb586be9e286aed60122455ee3f73c5fd65014f806"
changed /files/runtime~1native~1linux-x64~1atbash.node/size
4746224
4764680
changed /files/runtime~1native~1win32-x64~1atbash.node/sha256
"5c1a2cca53b3340820412696b9d5f50445a3460e6c9f03004b20b2709288b6bc"
"9716522468c4c30d2cab3ba9fac9a3443616cd8d64d311de006b38292d478154"
changed /files/runtime~1native~1win32-x64~1atbash.node/size
4257792
4323840
added /files/runtime~1pre-tool-use-main.cjs
Field was absent
{
"sha256": "a355bb9937c5a95033d512e2bf3b3af52aca72f3c5de32d91cbc584c0a58f750",
"size": 622974
}added /files/runtime~1pre-tool-use-shim.cjs
Field was absent
{
"sha256": "11be15923a155b1359a04f2cc5a6e3b64b43cfbbc946a84c45f5feb1258f76ed",
"size": 31709
}added /files/runtime~1pre-tool-use.cjs
Field was absent
{
"sha256": "c6fe2773b564a791f4b0191242d7e24f5a05c0018794e3697fcb65bdc0748f5d",
"size": 11079
}removed /files/runtime~1public-safety.cjs
{
"sha256": "53fb8d8dea78341529c3d76cdc86b3c5b5164c75155b466e0a74221b869bb0c5",
"size": 1165435
}Field is absent
added /files/runtime~1status.cjs
Field was absent
{
"sha256": "6a5ad23427e92f14330f356afe47017202091c05d37b6d9ed57d9661a66bb214",
"size": 621406
}changed /files/skills~1atbash-manage~1SKILL.md/sha256
"7f54fd1b0941e464ecd0265cd856c460a34d62c51fa7fbea6844f2c70eac9115"
"e9985485ba6755637d70feef001872e08a02fd2199b8da8010033ecc92037565"
changed /files/skills~1atbash-manage~1SKILL.md/size
2034
2898
changed /files/skills~1atbash-manage~1agents~1openai.yaml/sha256
"9b1bb2dfa411b616091a1be45c354217cb813d59e55d7a6266a8f2923b871c16"
"8b9dc528dd9c157e9de909b815b90a737388a53abc9e072f057818dd57bca14c"
changed /files/skills~1atbash-manage~1agents~1openai.yaml/size
208
233
removed /files/skills~1atbash-safety~1SKILL.md
{
"sha256": "5735456fb796ba4bf2cb638b74d57cf699639205fe1132a8937b4ecebb085279",
"size": 2390
}Field is absent
removed /files/skills~1atbash-safety~1agents~1openai.yaml
{
"sha256": "9c948f11c37c10cc4df62b2e8eab787bb085227bcfa3419a8e3c239e37e0a79f",
"size": 209
}Field is absent
removed /files/skills~1atbash-safety~1scripts~1atbash-safety.mjs
{
"sha256": "22a7fc9c77b060a5ebaadd3d018b5b8cb4e5ff1f66ea88da99aacd286277d91b",
"size": 544
}Field is absent
changed /files/skills~1atbash-setup~1SKILL.md/sha256
"987152f634fc01288568848ef91a34951f1b22294eb2adb506ac7e8dd1728217"
"efdbdb11df9b8f0b6d51c5ecf283b61f493841d72274094573fa0f9262291de7"
changed /files/skills~1atbash-setup~1SKILL.md/size
4545
14421
changed /files/skills~1atbash-setup~1agents~1openai.yaml/sha256
"956a5689c14f91100cb8d6c375cde053c536fcb9c4e4edc4c61ffa506f1094ad"
"1a894778c8d138639c709fcbe7203c5ff7666e8ffaeb094a3376b2a67c1ca424"
changed /files/skills~1atbash-setup~1agents~1openai.yaml/size
207
183
added /files/skills~1atbash-setup~1scripts~1prepare-config.mjs
Field was absent
{
"sha256": "de87b6dfcccd4960918daf3c1409da26b89df223629df813b60c7fdbfe9700e4",
"size": 2788
}Full snapshot data
{
"files": {
".codex-plugin/plugin.json": {
"sha256": "cb9a06cc286c130250f0fba59a038b6256ca38cbbca1780c77bdd66a9ac93251",
"size": 1404
},
"assets/atbash-icon.png": {
"sha256": "201afa65e5968d33a60622dfd2f162927d9cf0004cd53ed2f8fcbe0bbb5a5ac0",
"size": 5676
},
"runtime/atbash-native.cjs": {
"sha256": "1c220fceb85a0a6489e2f562438f548c585a9d53a1861921ca44c7593d187a29",
"size": 460
},
"runtime/control.cjs": {
"sha256": "5b7b62abff9016087ebe9f363063133ed40a134c2e56b2b230ecf71a8af4e4dd",
"size": 644493
},
"runtime/index.cjs": {
"sha256": "bcee9cc5d2eb90ff693bc4d8237a4f6374679447afffe3a2156e94305e10a2ac",
"size": 623498
},
"runtime/install-hook.cjs": {
"sha256": "f4fdd9a99561f49f43abc042f7bf6fa1f31e8206cdaf873b4a5a23f3569e75e2",
"size": 15854
},
"runtime/licenses/atbash-sdk.LICENSE": {
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
"size": 11358
},
"runtime/manifest.json": {
"sha256": "8d01efa9323a1e790349537f4e929aa7773015d00afe0c4152f73e970cfaf342",
"size": 730
},
"runtime/native/darwin-arm64/atbash.node": {
"sha256": "739cda841ad826cc10b68125090d006fc6fee01dc020e0c26f4c89944d21fbfa",
"size": 4234960
},
"runtime/native/linux-arm64/atbash.node": {
"sha256": "c8fc8305a7975aa0626f6d36c3e34b384973d19d275d85bb905889cb01c930d5",
"size": 4605056
},
"runtime/native/linux-x64/atbash.node": {
"sha256": "e2e0139335f35b2456d83bdb586be9e286aed60122455ee3f73c5fd65014f806",
"size": 4764680
},
"runtime/native/win32-x64/atbash.node": {
"sha256": "9716522468c4c30d2cab3ba9fac9a3443616cd8d64d311de006b38292d478154",
"size": 4323840
},
"runtime/pre-tool-use-main.cjs": {
"sha256": "a355bb9937c5a95033d512e2bf3b3af52aca72f3c5de32d91cbc584c0a58f750",
"size": 622974
},
"runtime/pre-tool-use-shim.cjs": {
"sha256": "11be15923a155b1359a04f2cc5a6e3b64b43cfbbc946a84c45f5feb1258f76ed",
"size": 31709
},
"runtime/pre-tool-use.cjs": {
"sha256": "c6fe2773b564a791f4b0191242d7e24f5a05c0018794e3697fcb65bdc0748f5d",
"size": 11079
},
"runtime/status.cjs": {
"sha256": "6a5ad23427e92f14330f356afe47017202091c05d37b6d9ed57d9661a66bb214",
"size": 621406
},
"skills/atbash-manage/SKILL.md": {
"sha256": "e9985485ba6755637d70feef001872e08a02fd2199b8da8010033ecc92037565",
"size": 2898
},
"skills/atbash-manage/agents/openai.yaml": {
"sha256": "8b9dc528dd9c157e9de909b815b90a737388a53abc9e072f057818dd57bca14c",
"size": 233
},
"skills/atbash-manage/scripts/atbash-control.mjs": {
"sha256": "f8c9c7bfa63168d7eccb8f706edf9b2ce355d82b7d14e76638103b754a6bfdef",
"size": 551
},
"skills/atbash-setup/SKILL.md": {
"sha256": "efdbdb11df9b8f0b6d51c5ecf283b61f493841d72274094573fa0f9262291de7",
"size": 14421
},
"skills/atbash-setup/agents/openai.yaml": {
"sha256": "1a894778c8d138639c709fcbe7203c5ff7666e8ffaeb094a3376b2a67c1ca424",
"size": 183
},
"skills/atbash-setup/scripts/atbash-control.mjs": {
"sha256": "f8c9c7bfa63168d7eccb8f706edf9b2ce355d82b7d14e76638103b754a6bfdef",
"size": 551
},
"skills/atbash-setup/scripts/prepare-config.mjs": {
"sha256": "de87b6dfcccd4960918daf3c1409da26b89df223629df813b60c7fdbfe9700e4",
"size": 2788
}
}
}SHA-256 of public snapshot: fee26be2663312459316a8436964ce4556d5efc571200cae76f47cca9fd04158