{"record":{"id":"32050d335fa6749f","repo":"paperclipai/paperclip","slug":"verified-runtime-executable-path-is-invalid","errorCode":null,"errorMessage":"Verified runtime executable path is invalid","messagePattern":"Verified runtime executable path is invalid","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/drivers/acpx/verified-runtime-executable.ts","lineNumber":38,"sourceCode":"  platform: NodeJS.Platform = process.platform,\n  _currentPid: number = process.pid,\n  fallback: string = process.execPath,\n): string {\n  const configured = environment[VERIFIED_RUNTIME_EXECUTABLE_ENV];\n  if (configured === undefined) return fallback;\n\n  if (platform === \"linux\") {\n    if (/^\\/proc\\/self\\/fd\\/[0-9]+$/.test(configured)) return configured;\n    throw new Error(\"Verified runtime executable descriptor is invalid\");\n  }\n\n  if (platform === \"darwin\") {\n    if (\n      !isAbsolute(fallback) ||\n      resolve(fallback) !== fallback ||\n      configured !== fallback\n    ) {\n      throw new Error(\"Verified runtime executable path is invalid\");\n    }\n    // The Rust supervisor materializes the authenticated runtime as a private,\n    // read-only executable and starts this process from that exact pathname.\n    // Descendants may inherit the handoff variable, but they cannot nominate a\n    // different absolute path and have it treated as verified.\n    return fallback;\n  }\n\n  throw new Error(\n    \"Verified runtime executable is unsupported on this platform\",\n  );\n}\n\n/**\n * Project the current verified runtime into a chosen child descriptor. The\n * caller must place sourceFd at child targetFd in its stdio table.\n */\nexport function verifiedRuntimeExecutableHandoff(","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/drivers/acpx/verified-runtime-executable.ts#L20-L56","documentation":"On macOS there is no /proc fd-descriptor handoff, so verifiedRuntimeExecutable() requires the env value to equal the absolute, normalized process.execPath exactly: the Rust supervisor materializes the authenticated runtime as a private read-only executable launched from that exact pathname. Any deviation is rejected.","triggerScenarios":"On darwin, calling verifiedRuntimeExecutable() when PAPERCLIP_VERIFIED_RUNTIME_EXECUTABLE differs from process.execPath, when execPath is not absolute, or when it contains non-normalized segments (resolve(execPath) !== execPath), e.g. after re-exec or a symlinked launch path.","commonSituations":"Launching the runner via a symlink or relative path so execPath differs from the supervisor's canonical path; manually setting the env var to a different binary; a tool re-execing node with a changed execPath.","solutions":["Launch the runner exactly as the supervisor does, from the materialized executable's canonical absolute path","Unset PAPERCLIP_VERIFIED_RUNTIME_EXECUTABLE to fall back to process.execPath if no verified handoff applies","Avoid symlinks/relative paths when starting the runner; use the resolved absolute path","Do not manually export the env var on macOS; let the supervisor set it"],"exampleFix":"// before\nenv.PAPERCLIP_VERIFIED_RUNTIME_EXECUTABLE = \"/opt/bin/runner\"; // differs from execPath\n// after\ndelete env.PAPERCLIP_VERIFIED_RUNTIME_EXECUTABLE; // fall back to process.execPath","handlingStrategy":"validation","validationCode":"const v = process.env.PAPERCLIP_VERIFIED_RUNTIME_EXECUTABLE;\nif (v !== undefined && process.platform === \"darwin\" &&\n    (v !== process.execPath || path.resolve(process.execPath) !== process.execPath)) {\n  delete process.env.PAPERCLIP_VERIFIED_RUNTIME_EXECUTABLE;\n}","typeGuard":"function isValidDarwinHandoff(v, fallback) {\n  return path.isAbsolute(fallback) && path.resolve(fallback) === fallback && v === fallback;\n}","tryCatchPattern":"try {\n  const exe = verifiedRuntimeExecutable();\n} catch (err) {\n  if (err.message === \"Verified runtime executable path is invalid\") {\n    const { [VERIFIED_RUNTIME_EXECUTABLE_ENV]: _omit, ...clean } = process.env;\n    return verifiedRuntimeExecutable(clean);\n  }\n  throw err;\n}","preventionTips":["Launch the runner from the exact materialized executable path the supervisor uses","Avoid symlinks and relative paths when starting the runner on macOS","Do not export the handoff var manually on darwin","Re-exec through the supervisor rather than exec-ing node directly"],"tags":["macos","env-var","path-validation","security"],"backgroundTag":"invalid-env-var-value","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}