{"draft":null,"from":94,"to":95,"files":[{"path":"client/src/config.ts","added":25,"removed":3,"diff":"--- a/client/src/config.ts\n+++ b/client/src/config.ts\n@@ -2,7 +2,8 @@\n // them, and the token.\n //\n // The token is never in the folder: it comes from the ABSO_TOKEN environment\n-// variable, or else from ~/.avcs/token, outside every repo.\n+// variable, or else from ~/.avcs/token, outside every repo. A pipeline run's\n+// key comes from the file ABSO_KEY_FILE names, and is only ever held in memory.\n \n import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\n import { homedir } from \"node:os\";\n@@ -97,12 +98,14 @@\n \troot: string,\n \tserver: string,\n \tenv: Readonly<Record<string, string | undefined>> = process.env,\n-): { kind: \"agent key\" | \"shared token\" | \"none\"; id: string | null } {\n+): { kind: \"agent key\" | \"shared token\" | \"pipeline run key\" | \"none\"; id: string | null } {\n \tconst key = readKeyFile(root);\n \tif (key) {\n \t\tif (originOf(key.server) !== originOf(server)) return { kind: \"none\", id: null };\n \t\treturn { kind: \"agent key\", id: key.id };\n \t}\n+\tif (fromEnv(env, \"TOKEN\")) return { kind: \"shared token\", id: null };\n+\tif (fromEnv(env, \"KEY_FILE\")) return { kind: \"pipeline run key\", id: null };\n \treturn { kind: readToken(env) ? \"shared token\" : \"none\", id: null };\n }\n \n@@ -184,7 +187,7 @@\n \t\t\treturn key.key;\n \t\t}\n \t}\n-\tconst token = readToken(env);\n+\tconst token = fromEnv(env, \"TOKEN\")?.trim() || runKey(env) || readToken(env);\n \tconst trusted = trustedServers(env);\n \tif (token === undefined || tokenGoesTo(server, trusted)) return token;\n \tthrow new UsageError(\n@@ -213,6 +216,25 @@\n \treturn trustedList(fromEnv(env, \"TRUSTED_SERVERS\"), readMachineServers(env));\n }\n \n+/**\n+ * A pipeline run's key, from the file ABSO_KEY_FILE names (the runner writes it, mode 600, holding the bare key).\n+ * Read each time and kept in memory only; nothing abso writes or prints holds it, errors included.\n+ */\n+export function runKey(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {\n+\tconst path = fromEnv(env, \"KEY_FILE\");\n+\tif (!path) return undefined;\n+\tlet text: string;\n+\ttry {\n+\t\ttext = readFileSync(path, \"utf8\");\n+\t} catch {\n+\t\tthrow new UsageError(`ABSO_KEY_FILE names ${path}, which abso can't read`);\n+\t}\n+\tconst key = text.trim();\n+\tif (!/^abso_sk_[A-Za-z0-9_-]+$/.test(key))\n+\t\tthrow new UsageError(`ABSO_KEY_FILE names ${path}, which doesn't hold an abso key`);\n+\treturn key;\n+}\n+\n /** ABSO_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */\n export function readToken(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {\n \tconst fromVar = fromEnv(env, \"TOKEN\");"}],"unmatched":[]}