approval-md 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/README.md +629 -559
  2. package/SPEC.md +99 -24
  3. package/dist/src/adapters/agentmail.d.ts +426 -0
  4. package/dist/src/adapters/agentmail.js +2 -2
  5. package/dist/src/adapters/conformance.d.ts +149 -0
  6. package/dist/src/adapters/contract.d.ts +628 -0
  7. package/dist/src/adapters/contract.js +110 -16
  8. package/dist/src/adapters/contract.js.map +1 -1
  9. package/dist/src/adapters/email.d.ts +324 -0
  10. package/dist/src/adapters/env-passphrase.d.ts +93 -0
  11. package/dist/src/adapters/public.d.ts +11 -0
  12. package/dist/src/adapters/public.js +11 -0
  13. package/dist/src/adapters/public.js.map +1 -0
  14. package/dist/src/adapters/registry.d.ts +59 -0
  15. package/dist/src/adapters/registry.js +2 -1
  16. package/dist/src/adapters/registry.js.map +1 -1
  17. package/dist/src/adapters/smtp.d.ts +213 -0
  18. package/dist/src/adapters/vault-provider.d.ts +114 -0
  19. package/dist/src/adapters/vault-provider.js +3 -3
  20. package/dist/src/adapters/zzz.d.ts +66 -0
  21. package/dist/src/adapters/zzz.js +299 -0
  22. package/dist/src/adapters/zzz.js.map +1 -0
  23. package/dist/src/channels/batch.d.ts +109 -0
  24. package/dist/src/channels/cli.d.ts +193 -0
  25. package/dist/src/channels/conformance.d.ts +92 -0
  26. package/dist/src/channels/contract.d.ts +656 -0
  27. package/dist/src/channels/contract.js +200 -7
  28. package/dist/src/channels/contract.js.map +1 -1
  29. package/dist/src/channels/payload-view.d.ts +35 -0
  30. package/dist/src/channels/render-queue.d.ts +149 -0
  31. package/dist/src/channels/tagging.d.ts +196 -0
  32. package/dist/src/channels/telegram.d.ts +1944 -0
  33. package/dist/src/channels/telegram.js +218 -23
  34. package/dist/src/channels/telegram.js.map +1 -1
  35. package/dist/src/channels/web.d.ts +350 -0
  36. package/dist/src/channels/web.js +17 -0
  37. package/dist/src/channels/web.js.map +1 -1
  38. package/dist/src/cli/adapter.d.ts +90 -0
  39. package/dist/src/cli/adapter.js +25 -15
  40. package/dist/src/cli/adapter.js.map +1 -1
  41. package/dist/src/cli/amend.d.ts +59 -0
  42. package/dist/src/cli/amend.js +214 -30
  43. package/dist/src/cli/amend.js.map +1 -1
  44. package/dist/src/cli/args.d.ts +43 -0
  45. package/dist/src/cli/attest.d.ts +50 -0
  46. package/dist/src/cli/attest.js +134 -7
  47. package/dist/src/cli/attest.js.map +1 -1
  48. package/dist/src/cli/audit-card.d.ts +62 -0
  49. package/dist/src/cli/audit.d.ts +59 -0
  50. package/dist/src/cli/channel-telegram.d.ts +879 -0
  51. package/dist/src/cli/channel-telegram.js +311 -13
  52. package/dist/src/cli/channel-telegram.js.map +1 -1
  53. package/dist/src/cli/channel-web.d.ts +131 -0
  54. package/dist/src/cli/channel.d.ts +80 -0
  55. package/dist/src/cli/channel.js +9 -0
  56. package/dist/src/cli/channel.js.map +1 -1
  57. package/dist/src/cli/checkpoint-tap.d.ts +169 -0
  58. package/dist/src/cli/codex-bridge.d.ts +819 -0
  59. package/dist/src/cli/codex-bridge.js +1607 -0
  60. package/dist/src/cli/codex-bridge.js.map +1 -0
  61. package/dist/src/cli/codex.d.ts +2 -0
  62. package/dist/src/cli/codex.js +469 -0
  63. package/dist/src/cli/codex.js.map +1 -0
  64. package/dist/src/cli/coverage.d.ts +61 -0
  65. package/dist/src/cli/daemon.d.ts +120 -0
  66. package/dist/src/cli/daemon.js +4 -1
  67. package/dist/src/cli/daemon.js.map +1 -1
  68. package/dist/src/cli/doctor.d.ts +129 -0
  69. package/dist/src/cli/doctor.js +586 -17
  70. package/dist/src/cli/doctor.js.map +1 -1
  71. package/dist/src/cli/env.d.ts +65 -0
  72. package/dist/src/cli/execute.d.ts +202 -0
  73. package/dist/src/cli/execute.js +25 -2
  74. package/dist/src/cli/execute.js.map +1 -1
  75. package/dist/src/cli/exit-codes.d.ts +73 -0
  76. package/dist/src/cli/feedback.d.ts +60 -0
  77. package/dist/src/cli/gate-window.d.ts +40 -0
  78. package/dist/src/cli/gate.d.ts +68 -0
  79. package/dist/src/cli/git-scope.d.ts +190 -0
  80. package/dist/src/cli/gloss-attach.d.ts +85 -0
  81. package/dist/src/cli/gloss-codex-child.d.ts +9 -0
  82. package/dist/src/cli/gloss-codex.d.ts +24 -0
  83. package/dist/src/cli/gloss-options.d.ts +42 -0
  84. package/dist/src/cli/gloss.d.ts +265 -0
  85. package/dist/src/cli/help.d.ts +107 -0
  86. package/dist/src/cli/help.js +320 -93
  87. package/dist/src/cli/help.js.map +1 -1
  88. package/dist/src/cli/hook-codex.d.ts +126 -0
  89. package/dist/src/cli/hook-codex.js +226 -0
  90. package/dist/src/cli/hook-codex.js.map +1 -0
  91. package/dist/src/cli/hook.d.ts +787 -0
  92. package/dist/src/cli/hook.js +1235 -181
  93. package/dist/src/cli/hook.js.map +1 -1
  94. package/dist/src/cli/import.d.ts +35 -0
  95. package/dist/src/cli/import.js +1 -1
  96. package/dist/src/cli/import.js.map +1 -1
  97. package/dist/src/cli/init.d.ts +84 -0
  98. package/dist/src/cli/init.js +2 -2
  99. package/dist/src/cli/init.js.map +1 -1
  100. package/dist/src/cli/instructions.d.ts +23 -0
  101. package/dist/src/cli/journal.d.ts +41 -0
  102. package/dist/src/cli/log-advance.d.ts +287 -0
  103. package/dist/src/cli/log-advance.js +102 -11
  104. package/dist/src/cli/log-advance.js.map +1 -1
  105. package/dist/src/cli/log-anchor.d.ts +176 -0
  106. package/dist/src/cli/log-checkpoint.d.ts +22 -0
  107. package/dist/src/cli/log-sync.d.ts +243 -0
  108. package/dist/src/cli/log-verbs.d.ts +16 -0
  109. package/dist/src/cli/log-verbs.js +7 -1
  110. package/dist/src/cli/log-verbs.js.map +1 -1
  111. package/dist/src/cli/long-help.d.ts +70 -0
  112. package/dist/src/cli/main.d.ts +77 -0
  113. package/dist/src/cli/main.js +159 -7
  114. package/dist/src/cli/main.js.map +1 -1
  115. package/dist/src/cli/mcp.d.ts +52 -0
  116. package/dist/src/cli/paths.d.ts +56 -0
  117. package/dist/src/cli/payload.d.ts +58 -0
  118. package/dist/src/cli/policy-apply.d.ts +195 -0
  119. package/dist/src/cli/policy-apply.js +573 -0
  120. package/dist/src/cli/policy-apply.js.map +1 -0
  121. package/dist/src/cli/policy.d.ts +43 -0
  122. package/dist/src/cli/policy.js +14 -1
  123. package/dist/src/cli/policy.js.map +1 -1
  124. package/dist/src/cli/preflight.d.ts +501 -0
  125. package/dist/src/cli/preflight.js +689 -45
  126. package/dist/src/cli/preflight.js.map +1 -1
  127. package/dist/src/cli/progress.d.ts +78 -0
  128. package/dist/src/cli/prompt.d.ts +209 -0
  129. package/dist/src/cli/quickstart.d.ts +46 -0
  130. package/dist/src/cli/quickstart.js +297 -0
  131. package/dist/src/cli/quickstart.js.map +1 -0
  132. package/dist/src/cli/records.d.ts +34 -0
  133. package/dist/src/cli/render.d.ts +22 -0
  134. package/dist/src/cli/sandbox.d.ts +51 -0
  135. package/dist/src/cli/sandbox.js +17 -1
  136. package/dist/src/cli/sandbox.js.map +1 -1
  137. package/dist/src/cli/scaffold.d.ts +79 -0
  138. package/dist/src/cli/scaffold.js +1 -1
  139. package/dist/src/cli/setup-adapter.d.ts +137 -0
  140. package/dist/src/cli/setup-adapter.js +38 -4
  141. package/dist/src/cli/setup-adapter.js.map +1 -1
  142. package/dist/src/cli/setup-channel.d.ts +126 -0
  143. package/dist/src/cli/setup-channel.js +28 -1
  144. package/dist/src/cli/setup-channel.js.map +1 -1
  145. package/dist/src/cli/setup-checkpoint.d.ts +57 -0
  146. package/dist/src/cli/setup-common.d.ts +277 -0
  147. package/dist/src/cli/setup-common.js +3 -2
  148. package/dist/src/cli/setup-common.js.map +1 -1
  149. package/dist/src/cli/setup-flow.d.ts +287 -0
  150. package/dist/src/cli/setup-service.d.ts +96 -0
  151. package/dist/src/cli/setup.d.ts +204 -0
  152. package/dist/src/cli/setup.js +94 -2
  153. package/dist/src/cli/setup.js.map +1 -1
  154. package/dist/src/cli/style.d.ts +320 -0
  155. package/dist/src/cli/token.d.ts +39 -0
  156. package/dist/src/cli/up.d.ts +155 -0
  157. package/dist/src/cli/up.js +119 -53
  158. package/dist/src/cli/up.js.map +1 -1
  159. package/dist/src/cli/usage.d.ts +37 -0
  160. package/dist/src/cli/values.d.ts +40 -0
  161. package/dist/src/cli/values.js +3 -4
  162. package/dist/src/cli/values.js.map +1 -1
  163. package/dist/src/cli/vault.d.ts +59 -0
  164. package/dist/src/cli/vault.js +2 -2
  165. package/dist/src/cli/vault.js.map +1 -1
  166. package/dist/src/cli/verb-registry.d.ts +76 -0
  167. package/dist/src/cli/verb-registry.js +344 -11
  168. package/dist/src/cli/verb-registry.js.map +1 -1
  169. package/dist/src/cli/wordmark.d.ts +31 -0
  170. package/dist/src/cli/wordmark.js +2 -2
  171. package/dist/src/codex/broker.d.ts +229 -0
  172. package/dist/src/codex/broker.js +548 -0
  173. package/dist/src/codex/broker.js.map +1 -0
  174. package/dist/src/codex/doctor.d.ts +13 -0
  175. package/dist/src/codex/doctor.js +41 -0
  176. package/dist/src/codex/doctor.js.map +1 -0
  177. package/dist/src/codex/manifest.d.ts +49 -0
  178. package/dist/src/codex/manifest.js +103 -0
  179. package/dist/src/codex/manifest.js.map +1 -0
  180. package/dist/src/codex/runner.d.ts +178 -0
  181. package/dist/src/codex/runner.js +231 -0
  182. package/dist/src/codex/runner.js.map +1 -0
  183. package/dist/src/codex/serve.d.ts +56 -0
  184. package/dist/src/codex/serve.js +98 -0
  185. package/dist/src/codex/serve.js.map +1 -0
  186. package/dist/src/codex/templates.d.ts +41 -0
  187. package/dist/src/codex/templates.js +319 -0
  188. package/dist/src/codex/templates.js.map +1 -0
  189. package/dist/src/codex/trust.d.ts +19 -0
  190. package/dist/src/codex/trust.js +183 -0
  191. package/dist/src/codex/trust.js.map +1 -0
  192. package/dist/src/codex/workspace-commit.d.ts +219 -0
  193. package/dist/src/codex/workspace-commit.js +549 -0
  194. package/dist/src/codex/workspace-commit.js.map +1 -0
  195. package/dist/src/codex/workspace-plan.d.ts +131 -0
  196. package/dist/src/codex/workspace-plan.js +561 -0
  197. package/dist/src/codex/workspace-plan.js.map +1 -0
  198. package/dist/src/core/actor.d.ts +2 -0
  199. package/dist/src/core/actor.js +5 -0
  200. package/dist/src/core/actor.js.map +1 -0
  201. package/dist/src/core/advance-cycle.d.ts +221 -0
  202. package/dist/src/core/advance-cycle.js +66 -2
  203. package/dist/src/core/advance-cycle.js.map +1 -1
  204. package/dist/src/core/agents-md.d.ts +278 -0
  205. package/dist/src/core/agents-md.js +33 -31
  206. package/dist/src/core/agents-md.js.map +1 -1
  207. package/dist/src/core/apply-patch.d.ts +49 -0
  208. package/dist/src/core/apply-patch.js +266 -0
  209. package/dist/src/core/apply-patch.js.map +1 -0
  210. package/dist/src/core/attest.d.ts +635 -0
  211. package/dist/src/core/attest.js +326 -4
  212. package/dist/src/core/attest.js.map +1 -1
  213. package/dist/src/core/audit.d.ts +510 -0
  214. package/dist/src/core/audit.js +13 -0
  215. package/dist/src/core/audit.js.map +1 -1
  216. package/dist/src/core/budgets.d.ts +238 -0
  217. package/dist/src/core/channel-owner.d.ts +213 -0
  218. package/dist/src/core/channel-owner.js +358 -0
  219. package/dist/src/core/channel-owner.js.map +1 -0
  220. package/dist/src/core/checkpoint.d.ts +500 -0
  221. package/dist/src/core/child-env.d.ts +88 -0
  222. package/dist/src/core/clock.d.ts +52 -0
  223. package/dist/src/core/command-class.d.ts +697 -0
  224. package/dist/src/core/command-class.js +713 -25
  225. package/dist/src/core/command-class.js.map +1 -1
  226. package/dist/src/core/commit-guard.d.ts +272 -0
  227. package/dist/src/core/commit-guard.js +424 -0
  228. package/dist/src/core/commit-guard.js.map +1 -0
  229. package/dist/src/core/coverage-sources/adapter.d.ts +40 -0
  230. package/dist/src/core/coverage-sources/gh.d.ts +48 -0
  231. package/dist/src/core/coverage-sources/git.d.ts +101 -0
  232. package/dist/src/core/coverage.d.ts +217 -0
  233. package/dist/src/core/credential-spec.d.ts +72 -0
  234. package/dist/src/core/daemon-actor.d.ts +45 -0
  235. package/dist/src/core/daemon-actor.js +54 -0
  236. package/dist/src/core/daemon-actor.js.map +1 -0
  237. package/dist/src/core/dark-session.d.ts +432 -0
  238. package/dist/src/core/dark-session.js +266 -82
  239. package/dist/src/core/dark-session.js.map +1 -1
  240. package/dist/src/core/decision-refusal.d.ts +206 -0
  241. package/dist/src/core/decision-refusal.js +24 -2
  242. package/dist/src/core/decision-refusal.js.map +1 -1
  243. package/dist/src/core/env-file.d.ts +455 -0
  244. package/dist/src/core/env-file.js +60 -1
  245. package/dist/src/core/env-file.js.map +1 -1
  246. package/dist/src/core/execute.d.ts +871 -0
  247. package/dist/src/core/execute.js +59 -8
  248. package/dist/src/core/execute.js.map +1 -1
  249. package/dist/src/core/frontmatter.d.ts +78 -0
  250. package/dist/src/core/gate-window.d.ts +312 -0
  251. package/dist/src/core/gate.d.ts +1449 -0
  252. package/dist/src/core/gate.js +149 -14
  253. package/dist/src/core/gate.js.map +1 -1
  254. package/dist/src/core/gesture-refusal.d.ts +166 -0
  255. package/dist/src/core/gesture-refusal.js +188 -0
  256. package/dist/src/core/gesture-refusal.js.map +1 -0
  257. package/dist/src/core/git-run.d.ts +73 -0
  258. package/dist/src/core/harness-version.d.ts +157 -0
  259. package/dist/src/core/harness-version.js +4 -1
  260. package/dist/src/core/harness-version.js.map +1 -1
  261. package/dist/src/core/harness-wait.d.ts +55 -0
  262. package/dist/src/core/head-retry.d.ts +107 -0
  263. package/dist/src/core/instance.d.ts +310 -0
  264. package/dist/src/core/instance.js +113 -0
  265. package/dist/src/core/instance.js.map +1 -1
  266. package/dist/src/core/intake-limits.d.ts +247 -0
  267. package/dist/src/core/jcs.d.ts +52 -0
  268. package/dist/src/core/journal.d.ts +144 -0
  269. package/dist/src/core/live-draw.d.ts +436 -0
  270. package/dist/src/core/log-reconcile.d.ts +89 -0
  271. package/dist/src/core/log-subscribe.d.ts +36 -0
  272. package/dist/src/core/log-subscribe.js +162 -0
  273. package/dist/src/core/log-subscribe.js.map +1 -0
  274. package/dist/src/core/log.d.ts +316 -0
  275. package/dist/src/core/log.js.map +1 -1
  276. package/dist/src/core/loop.d.ts +274 -0
  277. package/dist/src/core/loop.js +11 -0
  278. package/dist/src/core/loop.js.map +1 -1
  279. package/dist/src/core/md-fence.d.ts +41 -0
  280. package/dist/src/core/money.d.ts +147 -0
  281. package/dist/src/core/payload-census.d.ts +74 -0
  282. package/dist/src/core/payload-store.d.ts +175 -0
  283. package/dist/src/core/payload.d.ts +71 -0
  284. package/dist/src/core/policy-diff.d.ts +292 -0
  285. package/dist/src/core/policy-diff.js +27 -4
  286. package/dist/src/core/policy-diff.js.map +1 -1
  287. package/dist/src/core/policy-expectations.d.ts +199 -0
  288. package/dist/src/core/policy-explain.d.ts +160 -0
  289. package/dist/src/core/policy-explain.js +63 -3
  290. package/dist/src/core/policy-explain.js.map +1 -1
  291. package/dist/src/core/policy-load.d.ts +567 -0
  292. package/dist/src/core/policy-load.js +36 -6
  293. package/dist/src/core/policy-load.js.map +1 -1
  294. package/dist/src/core/policy-match.d.ts +324 -0
  295. package/dist/src/core/policy-match.js +72 -9
  296. package/dist/src/core/policy-match.js.map +1 -1
  297. package/dist/src/core/policy-proposal.d.ts +317 -0
  298. package/dist/src/core/policy-proposal.js +102 -2
  299. package/dist/src/core/policy-proposal.js.map +1 -1
  300. package/dist/src/core/prompt-layout.d.ts +221 -0
  301. package/dist/src/core/protected-path-guard.d.ts +566 -0
  302. package/dist/src/core/protected-path-guard.js +848 -55
  303. package/dist/src/core/protected-path-guard.js.map +1 -1
  304. package/dist/src/core/question-preempted.d.ts +141 -0
  305. package/dist/src/core/question-preempted.js +152 -0
  306. package/dist/src/core/question-preempted.js.map +1 -0
  307. package/dist/src/core/read-scope.d.ts +172 -0
  308. package/dist/src/core/read-scope.js +252 -0
  309. package/dist/src/core/read-scope.js.map +1 -0
  310. package/dist/src/core/registration.d.ts +25 -0
  311. package/dist/src/core/reindex.d.ts +99 -0
  312. package/dist/src/core/sampler.d.ts +313 -0
  313. package/dist/src/core/sandbox.d.ts +371 -0
  314. package/dist/src/core/sandbox.js +190 -1
  315. package/dist/src/core/sandbox.js.map +1 -1
  316. package/dist/src/core/seal.d.ts +165 -0
  317. package/dist/src/core/sender-identity.d.ts +476 -0
  318. package/dist/src/core/sender-identity.js +572 -0
  319. package/dist/src/core/sender-identity.js.map +1 -0
  320. package/dist/src/core/shlex.d.ts +102 -0
  321. package/dist/src/core/shlex.js +159 -0
  322. package/dist/src/core/shlex.js.map +1 -0
  323. package/dist/src/core/state.d.ts +505 -0
  324. package/dist/src/core/task-file.d.ts +185 -0
  325. package/dist/src/core/telegram-config.d.ts +93 -0
  326. package/dist/src/core/token.d.ts +409 -0
  327. package/dist/src/core/token.js +21 -38
  328. package/dist/src/core/token.js.map +1 -1
  329. package/dist/src/core/validate.d.ts +138 -0
  330. package/dist/src/core/values.d.ts +147 -0
  331. package/dist/src/core/values.js +36 -1
  332. package/dist/src/core/values.js.map +1 -1
  333. package/dist/src/core/vault.d.ts +291 -0
  334. package/dist/src/core/verified-snapshot.d.ts +204 -0
  335. package/dist/src/core/verify.d.ts +336 -0
  336. package/dist/src/core/version.d.ts +8 -0
  337. package/dist/src/core/wysiwys.d.ts +370 -0
  338. package/dist/src/daemon/advance-child.d.ts +39 -0
  339. package/dist/src/daemon/advance.d.ts +476 -0
  340. package/dist/src/daemon/advance.js +25 -4
  341. package/dist/src/daemon/advance.js.map +1 -1
  342. package/dist/src/daemon/audit.d.ts +87 -0
  343. package/dist/src/daemon/daemon.d.ts +1180 -0
  344. package/dist/src/daemon/daemon.js +9 -0
  345. package/dist/src/daemon/daemon.js.map +1 -1
  346. package/dist/src/daemon/dark-session.d.ts +64 -0
  347. package/dist/src/daemon/draw-child.d.ts +36 -0
  348. package/dist/src/daemon/draw.d.ts +154 -0
  349. package/dist/src/daemon/git-evidence.d.ts +173 -0
  350. package/dist/src/daemon/git-evidence.js +1 -1
  351. package/dist/src/daemon/projection.d.ts +180 -0
  352. package/dist/src/daemon/prune.d.ts +207 -0
  353. package/dist/src/mcp/http.d.ts +113 -0
  354. package/dist/src/mcp/server.d.ts +265 -0
  355. package/dist/src/mcp/server.js +17 -1
  356. package/dist/src/mcp/server.js.map +1 -1
  357. package/docs/adapter-api.md +106 -0
  358. package/docs/cli-reference.md +1316 -63
  359. package/docs/codex-enforced-session.md +103 -0
  360. package/docs/codex-workspace-broker.md +118 -0
  361. package/package.json +14 -2
  362. package/schema/codex-instance.schema.json +82 -0
  363. package/schema/event.schema.json +539 -9
  364. package/schema/fixtures/codex-instance/invalid/unpinned-codex-version.json +40 -0
  365. package/schema/fixtures/codex-instance/valid/canonical.json +40 -0
  366. package/schema/fixtures/event/invalid/approval-granted-sender-hashed-false.json +20 -0
  367. package/schema/fixtures/event/invalid/approval-granted-sender-hashed-raw-id.json +20 -0
  368. package/schema/fixtures/event/invalid/audit-gesture-refused-human-actor.json +16 -0
  369. package/schema/fixtures/event/invalid/audit-gesture-refused-no-actor-no-sender.json +15 -0
  370. package/schema/fixtures/event/invalid/audit-gesture-refused-unknown-gesture.json +16 -0
  371. package/schema/fixtures/event/invalid/audit-question-preempted-agent-actor.json +16 -0
  372. package/schema/fixtures/event/invalid/audit-question-preempted-no-question-id.json +16 -0
  373. package/schema/fixtures/event/invalid/audit-question-preempted-unknown-source.json +15 -0
  374. package/schema/fixtures/event/invalid/gate-path-signed-off-absolute-path.json +14 -0
  375. package/schema/fixtures/event/invalid/gate-path-signed-off-agent-actor.json +14 -0
  376. package/schema/fixtures/event/invalid/gate-path-signed-off-missing-path.json +13 -0
  377. package/schema/fixtures/event/valid/approval-granted-sender-hashed.json +20 -0
  378. package/schema/fixtures/event/valid/audit-gesture-refused-review-note.json +21 -0
  379. package/schema/fixtures/event/valid/audit-gesture-refused-sender-key-unavailable.json +19 -0
  380. package/schema/fixtures/event/valid/audit-gesture-refused.json +19 -0
  381. package/schema/fixtures/event/valid/audit-question-preempted-no-verdict.json +16 -0
  382. package/schema/fixtures/event/valid/audit-question-preempted.json +20 -0
  383. package/schema/fixtures/event/valid/gate-path-signed-off.json +14 -0
  384. package/schema/fixtures/event/valid/harness-kind-claude-code.json +23 -0
  385. package/schema/fixtures/event/valid/harness-kind-codex.json +23 -0
  386. package/schema/fixtures/event/valid/harness-kind-cursor.json +23 -0
  387. package/schema/fixtures/event/valid/harness-kind-grok.json +23 -0
  388. package/schema/fixtures/event/valid/harness-kind-muse.json +23 -0
  389. package/schema/fixtures/policy/invalid/senders-half-keyed.json +20 -0
  390. package/schema/fixtures/policy/valid/canonical.json +1 -1
  391. package/schema/fixtures/policy/valid/senders-keyed.json +24 -0
  392. package/schema/fixtures/policy-md/valid/canonical.md +1 -1
  393. package/schema/fixtures/policy-md/valid/with-values.md +5 -7
  394. package/schema/fixtures/values/invalid/class-shaped.json +1 -1
  395. package/schema/fixtures/values/invalid/duplicate-entry.json +1 -1
  396. package/schema/fixtures/values/invalid/non-string-item.json +1 -1
  397. package/schema/fixtures/values/invalid/over-cap.json +1 -1
  398. package/schema/fixtures/values/invalid/unknown-key.json +1 -1
  399. package/schema/fixtures/values/invalid/version-float.json +1 -0
  400. package/schema/fixtures/values/invalid/version-integer.json +1 -0
  401. package/schema/fixtures/values/invalid/version-wrong-string.json +1 -0
  402. package/schema/fixtures/values/valid/empty-lists.json +2 -3
  403. package/schema/fixtures/values/valid/full.json +5 -7
  404. package/schema/fixtures/values/valid/minimal.json +1 -1
  405. package/schema/fixtures/values-md/invalid/schema-invalid.md +5 -3
  406. package/schema/fixtures/values-md/invalid/two-blocks.md +3 -3
  407. package/schema/fixtures/values-md/invalid/unterminated.md +2 -2
  408. package/schema/fixtures/values-md/invalid/version-1.md +69 -0
  409. package/schema/fixtures/values-md/invalid/version-unquoted.md +64 -0
  410. package/schema/fixtures/values-md/invalid/yaml-error.md +2 -2
  411. package/schema/fixtures/values-md/valid/absent.md +1 -1
  412. package/schema/fixtures/values-md/valid/with-values.md +5 -7
  413. package/schema/policy.schema.json +75 -3
  414. package/schema/values.schema.json +7 -11
  415. package/templates/codex/README.md +9 -0
  416. package/schema/fixtures/values/invalid/version-string.json +0 -1
@@ -0,0 +1,371 @@
1
+ /**
2
+ * The egress sandbox (APRV-193): the room an allowed command runs in.
3
+ *
4
+ * ## What this is for
5
+ *
6
+ * Arbitrary code execution is capability-complete. The gate classifies a
7
+ * command by its TEXT, and `npm test` runs whatever the agent wrote a minute
8
+ * ago, so for laundered exec the text has stopped describing the effect. No
9
+ * classifier over shell strings can close that, and `core/child-env.ts`
10
+ * (APRV-205) closed only half of it: the child no longer inherits the session's
11
+ * credentials, and it still inherits the session's network.
12
+ *
13
+ * This module removes the network. It does not try to predict what the code
14
+ * will do; it takes away what the code would need. Where APRV-205 starves the
15
+ * child of secrets, this starves it of a place to send them.
16
+ *
17
+ * ## The shape, and why it is this shape
18
+ *
19
+ * A NETWORK-ONLY sandbox, with one filesystem exception. The filesystem is left
20
+ * alone because the gate's own IPC is a FILE: `src/daemon/` opens no socket, it
21
+ * polls `.approval/log/events.jsonl`. So denying egress costs the gate nothing
22
+ * and needs no plumbing to stay reachable, and the "one door" other agent
23
+ * sandboxes build an egress proxy for already exists as an append to a file.
24
+ * That is the single largest simplification available here, and it is why the
25
+ * default profile denies the network, denies reads of the credential material
26
+ * beside the log, and touches nothing else.
27
+ *
28
+ * Loopback is denied WITH the rest. There is no gate socket to except: the
29
+ * daemon is a file reader. The one thing loopback costs is a test suite that
30
+ * starts its own localhost server, which is what {@link EgressAllowance.loopback}
31
+ * is for, and that allowance is an operator's decision recorded where it is
32
+ * used (`docs/sandboxed-exec.md` has the survey).
33
+ *
34
+ * ## The mechanism, and what is verified rather than assumed
35
+ *
36
+ * macOS only in this build: `/usr/bin/sandbox-exec` with a Sandbox Profile
37
+ * Language (SBPL) profile. It ships with every macOS, needs no privilege and no
38
+ * daemon, and every macOS agent sandbox in the field uses it. Linux
39
+ * (`bwrap --unshare-net`, `unshare --net`) is a stated follow-up rather than a
40
+ * silent omission: {@link detectSandbox} reports `supported: false` there and
41
+ * says so, and `docs/sandboxed-exec.md` carries the gap.
42
+ *
43
+ * Three Seatbelt behaviours are measured, not assumed. Each of them, got wrong,
44
+ * ships a profile that silently protects nothing, which is the worst artifact
45
+ * this design could produce:
46
+ *
47
+ * 1. `network-outbound` covers AF_UNIX connects as well as AF_INET. A bare
48
+ * `(deny network-outbound)` kills local IPC — DNS's mDNSResponder socket
49
+ * included — and the process dies before it can do anything. The unix
50
+ * exception is mandatory.
51
+ * 2. `subpath` and `literal` filters match the kernel's RESOLVED path. On macOS
52
+ * `/tmp` is a symlink to `/private/tmp`, so a profile naming `/tmp/x` denies
53
+ * NOTHING. Every path is realpath-resolved before it is written into a
54
+ * profile, and `tests/sandbox.test.ts` pins the unresolved spelling as the
55
+ * no-op it is.
56
+ * 3. `sandbox-exec` execs through `execvp`, so a PATH lookup still happens
57
+ * inside the wrapper — but a lookup that FAILS exits 71 (EX_OSERR), which
58
+ * would be recorded as the child's own exit code. So {@link resolveExecutable}
59
+ * does the lookup first and a command that cannot be found is never wrapped:
60
+ * it reaches `spawnSync` unwrapped and fails as ENOENT exactly as it does
61
+ * today.
62
+ *
63
+ * ## What it does not claim
64
+ *
65
+ * A sandboxed child can still WRITE files, including files a later unsandboxed
66
+ * process will run. That is the same laundering one step removed, and it is why
67
+ * `APPROVAL_HOOK_REQUIRE_SANDBOX` (which makes the hook insist that every
68
+ * code-running command wear the room) matters more than any single wrapper. It
69
+ * would be closed properly by running the whole SESSION under the profile,
70
+ * which this build cannot do: an agent harness needs the model API, and denying
71
+ * egress denies exactly that. A session-wide sandbox needs an allowlist
72
+ * reaching one host, which Seatbelt cannot express by hostname and which the
73
+ * prior art solves with a local proxy.
74
+ *
75
+ * Inbound sockets are not denied, so a child could in principle bind a port and
76
+ * wait to be contacted; that needs a peer that can reach this machine and is
77
+ * recorded here as a stated limit rather than an oversight. And the sandbox is
78
+ * not isolation: it is one capability removed from a process that otherwise has
79
+ * the ordinary powers of the session.
80
+ */
81
+ /**
82
+ * The mechanisms this build knows. One, today.
83
+ *
84
+ * A union rather than a string so the Linux follow-up (APRV-193g) is an
85
+ * addition the compiler finds every site of, rather than a value that quietly
86
+ * flows through code written for Seatbelt.
87
+ */
88
+ export declare const SANDBOX_MECHANISMS: readonly ["sandbox-exec"];
89
+ export type SandboxMechanism = (typeof SANDBOX_MECHANISMS)[number];
90
+ /**
91
+ * What an execution's record says about the room it ran in.
92
+ *
93
+ * Written to `execution.started` as `sandbox`, and it is a fact about the
94
+ * runtime's own behaviour rather than anything a caller asserted: three of the
95
+ * four values are computed here, and the fourth (`opted-out`) is a flag the
96
+ * operator typed, which is exactly why it is RECORDED — an opt-out nobody can
97
+ * see afterwards is an opt-out that costs nothing to take.
98
+ */
99
+ export declare const SANDBOX_STATES: readonly [
100
+ /** The child ran with outbound network denied. */
101
+ "egress-denied",
102
+ /** `--no-sandbox` was passed. The child ran with the session's own network. */
103
+ "opted-out",
104
+ /**
105
+ * The manual path: a human granted these exact bytes and the grant is the
106
+ * authority to reach the world. `approval run` on a token is the one door,
107
+ * and a door that denied egress would not be a door.
108
+ */
109
+ "granted-egress",
110
+ /**
111
+ * This platform has no mechanism in this build (anything but macOS today).
112
+ * Recorded on every execution so an auditor can see exactly which runs were
113
+ * unprotected, rather than inferring it from the absence of a field.
114
+ */
115
+ "unsupported"];
116
+ export type SandboxState = (typeof SANDBOX_STATES)[number];
117
+ /** What the machine can do, probed rather than inferred. */
118
+ export interface SandboxDetection {
119
+ /** Can a command be run egress-denied here, right now? */
120
+ readonly available: boolean;
121
+ /** The mechanism that would be used, or `null`. */
122
+ readonly mechanism: SandboxMechanism | null;
123
+ /**
124
+ * Does this build have a mechanism for this platform AT ALL?
125
+ *
126
+ * The distinction from {@link available} is load-bearing and it is the one
127
+ * place this module is deliberately not maximally strict. `supported: false`
128
+ * means "nothing was ever written for this platform", which is a known gap
129
+ * with a follow-up task and a docs row. `supported: true, available: false`
130
+ * means "the mechanism that should be here did not work", which is a broken
131
+ * promise, and the callers treat the two differently: the first proceeds and
132
+ * records `unsupported`, the second refuses to run the command at all.
133
+ */
134
+ readonly supported: boolean;
135
+ /** Can loopback be carved back in? (Seatbelt yes; a Linux netns cannot.) */
136
+ readonly loopback: boolean;
137
+ /** Why, when {@link available} is false. Empty otherwise. */
138
+ readonly reason: string;
139
+ }
140
+ /** What the profile lets through. Everything absent here is denied. */
141
+ export interface EgressAllowance {
142
+ /**
143
+ * Allow connections to `localhost:*`.
144
+ *
145
+ * Off by default. The gate needs nothing: its IPC is a file. This exists for
146
+ * the one legitimate case the survey found, a test suite that starts its own
147
+ * server, and it is a real widening — a loopback port is a port, and anything
148
+ * listening on one is reachable from inside.
149
+ */
150
+ readonly loopback: boolean;
151
+ /**
152
+ * Absolute paths whose CONTENTS the child may not read. Resolved before they
153
+ * reach the profile. Directories deny their whole subtree.
154
+ */
155
+ readonly denyRead: readonly string[];
156
+ /**
157
+ * WRITE CONFINEMENT (APRV-325.3): the only absolute subtrees the child may
158
+ * write, or `undefined` for the ordinary egress-only profile.
159
+ *
160
+ * This flips the posture for one rule family and one only. The header explains
161
+ * why the rest of this module is a deny-LIST: a `(deny default)` profile
162
+ * spends itself re-allowing dyld, the process's own binary and every temporary
163
+ * directory, and a control that breaks ordinary development is a control that
164
+ * gets switched off. That reasoning holds for reads and for everything else,
165
+ * and it does NOT hold for writes in a confined session, where the whole
166
+ * property being enforced is "this shell cannot change the canonical
167
+ * workspace". A write deny-list would have to enumerate every path worth
168
+ * protecting; this names the handful worth writing, so a path nobody thought
169
+ * of is denied rather than forgotten.
170
+ *
171
+ * `/dev` is allowed alongside them, unconditionally. Writes there are process
172
+ * I/O rather than filesystem state — `/dev/null`, `/dev/stdout`, `/dev/tty`,
173
+ * the pty a shell needs — and denying them kills the child before it can
174
+ * demonstrate anything, which is the failure mode point 1 of the header
175
+ * records for `network-outbound` and unix sockets.
176
+ *
177
+ * An EMPTY array is meaningful and is not the same as `undefined`: it denies
178
+ * every write outside `/dev`. `undefined` emits no write rules at all.
179
+ */
180
+ readonly writeAllow?: readonly string[];
181
+ /**
182
+ * The READ JAIL (APRV-347): absolute directories the child may read, with
183
+ * everything else denied.
184
+ *
185
+ * Absent or empty leaves the profile exactly as it was — allow-default with a
186
+ * deny-list — and the bytes are identical to the pre-APRV-347 profile, which
187
+ * a fixture test pins. That default is deliberate: a deny-default read
188
+ * profile is a much larger change to what ordinary development can do, and a
189
+ * control that breaks `npm run build` is a control someone switches off.
190
+ *
191
+ * When it IS set, the profile flips to `(deny file-read*)` plus a `subpath`
192
+ * allow for each of these roots and for the fixed runtime set a process needs
193
+ * to exist at all (see {@link RUNTIME_READ_PATHS}). `denyRead` still applies
194
+ * and is emitted AFTER the allows, so a credential file inside an allowed
195
+ * root stays unreadable: last match wins in SBPL, and the credential denial
196
+ * must be the last word.
197
+ */
198
+ readonly allowRead?: readonly string[];
199
+ }
200
+ /** The default: nothing allowed, nothing denied beyond the network. */
201
+ export declare const DENY_ALL_EGRESS: EgressAllowance;
202
+ /**
203
+ * What a process must be able to read to exist, regardless of the jail.
204
+ *
205
+ * Deliberately a fixed compiled-in list rather than anything a caller supplies:
206
+ * a jail whose runtime set could be widened by the party under oversight is not
207
+ * a jail (SPEC.md §11.1, self-reported fields never reduce scrutiny).
208
+ *
209
+ * - `/usr/lib`, `/usr/share`, `/System`, `/Library` — dyld, the shared cache,
210
+ * ICU data and the frameworks every Mach-O binary links. A profile without
211
+ * them kills the process before `main`, which reads as the command failing
212
+ * rather than as the sandbox working.
213
+ * - `/private/var/db/dyld` and `/var/db/dyld` — the dyld shared cache, which
214
+ * moved out of `/usr/lib` and is opened by name.
215
+ * - `/dev` — `/dev/null`, `/dev/urandom`, `/dev/dtracehelper`, the tty.
216
+ * - `/bin`, `/usr/bin`, `/sbin`, `/usr/sbin`, `/opt/homebrew`, `/usr/local` —
217
+ * the interpreters and tools a build shells out to. The node binary's own
218
+ * realpath is added separately by {@link runtimeReadRoots}, because a Node
219
+ * installed by a version manager lives under the user's home and none of
220
+ * these covers it.
221
+ * - `/etc`, `/private/etc` — `resolv.conf`, `passwd`, the locale tables.
222
+ *
223
+ * `node_modules` is NOT here, and that is a stated limit rather than an
224
+ * oversight: a repository's dependencies live inside the repository, so they
225
+ * are covered by the gate root being a read root. A project whose dependencies
226
+ * sit OUTSIDE the root (a pnpm store elsewhere, a linked package) must name
227
+ * that directory in `read_scope.roots`, which is exactly the widening that key
228
+ * exists for. docs/sandboxed-exec.md says so beside the survey.
229
+ *
230
+ * **The temp roots are not here either**, and that one is load-bearing. They
231
+ * reach the profile through the CALLER — `resolveReadRoots` puts the session
232
+ * scratchpad and the system temp root in the effective read scope, so
233
+ * `approval run` and `approval sandbox` open them and build tooling keeps
234
+ * working — and a caller that passes narrower roots gets a narrower jail. A
235
+ * temp root compiled in here would have been a widening no operator could turn
236
+ * off and no test could demonstrate a denial against, which is how it was
237
+ * found.
238
+ */
239
+ export declare const RUNTIME_READ_PATHS: readonly string[];
240
+ /**
241
+ * The files beside a log that hold credential material, for the profile's
242
+ * `denyRead`.
243
+ *
244
+ * Named individually rather than by denying the whole approval home. The home
245
+ * also holds the log, the payload store and the queue, and a child that could
246
+ * not read the log could not read the decision that authorized it. What is
247
+ * denied is what a laundering script would want: the vault's ciphertext, the
248
+ * environment source map that says where the secrets come from, and the
249
+ * per-request private keys that seal tokens.
250
+ *
251
+ * This is defence in depth over material that is already encrypted or already
252
+ * useless without the passphrase — the load-bearing custody control is that
253
+ * the passphrase is not in the child's environment at all (APRV-205). It is
254
+ * worth having on the one platform where it costs nothing.
255
+ */
256
+ export declare function credentialPathsFor(logPath: string): string[];
257
+ /**
258
+ * Forces the unavailable branch. A STRICTNESS increase in every caller — the
259
+ * run path refuses and the session launcher refuses — so a forged value cannot
260
+ * widen anything, which is what keeps it clear of SPEC.md §11.1 invariant 4.
261
+ */
262
+ export declare const FORCE_UNAVAILABLE_ENV = "APPROVAL_SANDBOX_FORCE_UNAVAILABLE";
263
+ /**
264
+ * Treat an unsupported platform as a broken promise rather than a known gap:
265
+ * with this set, a machine with no mechanism refuses instead of proceeding.
266
+ * The same one-way property holds — it can only ever refuse more.
267
+ */
268
+ export declare const REQUIRE_SANDBOX_ENV = "APPROVAL_SANDBOX_REQUIRED";
269
+ export interface DetectOptions {
270
+ readonly platform?: NodeJS.Platform;
271
+ readonly env?: NodeJS.ProcessEnv;
272
+ }
273
+ /**
274
+ * What this machine can do. Cached for the default call, because every verb
275
+ * that asks would otherwise spawn a probe per invocation, and the answer cannot
276
+ * change inside one process.
277
+ */
278
+ export declare function detectSandbox(options?: DetectOptions): SandboxDetection;
279
+ /** Testing seam: forget the cached probe. Never called by the runtime. */
280
+ export declare function resetSandboxDetection(): void;
281
+ /**
282
+ * A path as the KERNEL will see it.
283
+ *
284
+ * A path that does not exist yet cannot be resolved, so its directory is
285
+ * resolved and the name re-joined. A profile naming an unresolved path denies
286
+ * nothing at all and reports no error, which is the failure this function
287
+ * exists to prevent.
288
+ */
289
+ export declare function resolveForProfile(path: string): string;
290
+ /**
291
+ * The SBPL profile.
292
+ *
293
+ * `(allow default)` first, then the denial: SBPL takes the LAST matching rule,
294
+ * so exceptions are written after the deny. This is deliberately a deny-LIST
295
+ * and not the `(deny default)` posture a true isolation sandbox takes. The
296
+ * property being enforced is egress, and a deny-default profile spends itself
297
+ * re-allowing dyld, `/dev/urandom`, the process's own binary and every
298
+ * temporary directory, which is a different task with a different failure mode
299
+ * (and a much larger chance of breaking ordinary development, which is how a
300
+ * control gets switched off).
301
+ */
302
+ export declare function seatbeltProfile(allowance: EgressAllowance): string;
303
+ /** The argv to spawn, and the temporary directory the caller must remove. */
304
+ export interface WrappedSpawn {
305
+ readonly command: string;
306
+ readonly args: string[];
307
+ /** A directory holding the profile file; remove it once the child is gone. */
308
+ readonly cleanup: string;
309
+ /** What the caller records. */
310
+ readonly mechanism: SandboxMechanism;
311
+ }
312
+ /**
313
+ * Resolve a command the way `execvp` would, and say when it cannot be found.
314
+ *
315
+ * Done HERE rather than left to the wrapper for the reason in the header: an
316
+ * execvp failure inside `sandbox-exec` exits 71, and 71 recorded as the child's
317
+ * exit code is a lie about a command that never ran. A command that does not
318
+ * resolve is returned as `null`, and the caller spawns it unwrapped so the
319
+ * ENOENT surfaces exactly as it does with no sandbox in the picture.
320
+ */
321
+ export declare function resolveExecutable(command: string, env?: NodeJS.ProcessEnv): string | null;
322
+ /**
323
+ * Build the wrapped spawn for `argv`.
324
+ *
325
+ * Writes the profile to a fresh 0600 file under a private directory: the
326
+ * profile names the paths whose reads are denied, which is not secret, but a
327
+ * world-writable profile would be a profile another process could rewrite
328
+ * between this write and the exec.
329
+ */
330
+ export declare function wrapForSandbox(mechanism: SandboxMechanism, command: string, args: readonly string[], allowance?: EgressAllowance): WrappedSpawn;
331
+ export interface PostureInput {
332
+ /** `--no-sandbox` was passed. */
333
+ readonly optedOut: boolean;
334
+ /**
335
+ * A human's grant over these exact bytes is in the caller's hand (the manual
336
+ * path presented a token). The grant IS the authority to reach the world.
337
+ *
338
+ * Not a self-report that widens anything: a token that does not verify runs
339
+ * no command at all, so the loosening is reachable only by holding something
340
+ * a human minted. SPEC.md §11.1 invariant 4 is about a declaration the
341
+ * executing party authors; this is a secret it cannot author.
342
+ */
343
+ readonly granted: boolean;
344
+ /** The machine's capability. */
345
+ readonly detection: SandboxDetection;
346
+ /** `APPROVAL_SANDBOX_REQUIRED=1` promotes an unsupported platform to a refusal. */
347
+ readonly requireSupported?: boolean;
348
+ }
349
+ export type SandboxPosture = {
350
+ readonly kind: "apply";
351
+ readonly state: "egress-denied";
352
+ readonly mechanism: SandboxMechanism;
353
+ } | {
354
+ readonly kind: "skip";
355
+ readonly state: Exclude<SandboxState, "egress-denied">;
356
+ } | {
357
+ readonly kind: "refuse";
358
+ readonly reason: string;
359
+ };
360
+ /**
361
+ * What to do about the sandbox for one execution.
362
+ *
363
+ * Total, pure, and exhaustively testable: it reads a detection and two booleans
364
+ * and returns one of three answers. The ORDER of the branches is the policy —
365
+ * a broken mechanism refuses before an opt-out is considered, so `--no-sandbox`
366
+ * on a machine whose sandbox is broken is still a refusal rather than a way to
367
+ * turn the noise off.
368
+ */
369
+ export declare function sandboxPosture(input: PostureInput): SandboxPosture;
370
+ /** Is `APPROVAL_SANDBOX_REQUIRED` set on this environment? */
371
+ export declare function sandboxRequired(env?: NodeJS.ProcessEnv): boolean;
@@ -125,6 +125,77 @@ export const SANDBOX_STATES = [
125
125
  ];
126
126
  /** The default: nothing allowed, nothing denied beyond the network. */
127
127
  export const DENY_ALL_EGRESS = { loopback: false, denyRead: [] };
128
+ /**
129
+ * What a process must be able to read to exist, regardless of the jail.
130
+ *
131
+ * Deliberately a fixed compiled-in list rather than anything a caller supplies:
132
+ * a jail whose runtime set could be widened by the party under oversight is not
133
+ * a jail (SPEC.md §11.1, self-reported fields never reduce scrutiny).
134
+ *
135
+ * - `/usr/lib`, `/usr/share`, `/System`, `/Library` — dyld, the shared cache,
136
+ * ICU data and the frameworks every Mach-O binary links. A profile without
137
+ * them kills the process before `main`, which reads as the command failing
138
+ * rather than as the sandbox working.
139
+ * - `/private/var/db/dyld` and `/var/db/dyld` — the dyld shared cache, which
140
+ * moved out of `/usr/lib` and is opened by name.
141
+ * - `/dev` — `/dev/null`, `/dev/urandom`, `/dev/dtracehelper`, the tty.
142
+ * - `/bin`, `/usr/bin`, `/sbin`, `/usr/sbin`, `/opt/homebrew`, `/usr/local` —
143
+ * the interpreters and tools a build shells out to. The node binary's own
144
+ * realpath is added separately by {@link runtimeReadRoots}, because a Node
145
+ * installed by a version manager lives under the user's home and none of
146
+ * these covers it.
147
+ * - `/etc`, `/private/etc` — `resolv.conf`, `passwd`, the locale tables.
148
+ *
149
+ * `node_modules` is NOT here, and that is a stated limit rather than an
150
+ * oversight: a repository's dependencies live inside the repository, so they
151
+ * are covered by the gate root being a read root. A project whose dependencies
152
+ * sit OUTSIDE the root (a pnpm store elsewhere, a linked package) must name
153
+ * that directory in `read_scope.roots`, which is exactly the widening that key
154
+ * exists for. docs/sandboxed-exec.md says so beside the survey.
155
+ *
156
+ * **The temp roots are not here either**, and that one is load-bearing. They
157
+ * reach the profile through the CALLER — `resolveReadRoots` puts the session
158
+ * scratchpad and the system temp root in the effective read scope, so
159
+ * `approval run` and `approval sandbox` open them and build tooling keeps
160
+ * working — and a caller that passes narrower roots gets a narrower jail. A
161
+ * temp root compiled in here would have been a widening no operator could turn
162
+ * off and no test could demonstrate a denial against, which is how it was
163
+ * found.
164
+ */
165
+ export const RUNTIME_READ_PATHS = [
166
+ "/usr/lib",
167
+ "/usr/share",
168
+ "/System",
169
+ "/Library",
170
+ "/private/var/db/dyld",
171
+ "/var/db/dyld",
172
+ "/dev",
173
+ "/bin",
174
+ "/sbin",
175
+ "/usr/bin",
176
+ "/usr/sbin",
177
+ "/usr/local",
178
+ "/opt/homebrew",
179
+ "/etc",
180
+ "/private/etc",
181
+ ];
182
+ /**
183
+ * The runtime set plus this process's own interpreter.
184
+ *
185
+ * `process.execPath` is resolved because a version manager's `node` is usually
186
+ * a symlink, and a `subpath` rule matches what the KERNEL resolves rather than
187
+ * what the profile was handed (the lesson APRV-193's design lane paid for).
188
+ */
189
+ function runtimeReadRoots() {
190
+ const roots = [...RUNTIME_READ_PATHS];
191
+ try {
192
+ roots.push(dirname(realpathSync(process.execPath)));
193
+ }
194
+ catch {
195
+ // A process that cannot resolve its own binary is one the jail cannot help.
196
+ }
197
+ return roots;
198
+ }
128
199
  // ---------------------------------------------------------------------------
129
200
  // The credential material
130
201
  // ---------------------------------------------------------------------------
@@ -293,6 +364,39 @@ export function seatbeltProfile(allowance) {
293
364
  if (allowance.loopback) {
294
365
  lines.push(";; Carve-out: a suite that starts its own localhost server. A real widening.", '(allow network-outbound (remote ip "localhost:*"))');
295
366
  }
367
+ // APRV-347, the read jail. Emitted between the egress rules and the
368
+ // credential denials, and the ORDER is the policy: SBPL takes the last
369
+ // matching rule, so the roots open the filesystem and `denyRead` closes the
370
+ // credential material inside them afterwards. An empty (or absent)
371
+ // `allowRead` emits nothing at all, which is why a profile built without it
372
+ // is byte-identical to the profile this function produced before this task.
373
+ const allowRead = allowance.allowRead ?? [];
374
+ if (allowRead.length > 0) {
375
+ lines.push(";; APRV-347: the read jail. Deny-default, then the roots and the fixed", ";; runtime set a process needs to start at all.", "(deny file-read*)");
376
+ const seen = new Set();
377
+ for (const path of [...allowRead, ...runtimeReadRoots()]) {
378
+ const resolved = resolveForProfile(path);
379
+ if (seen.has(resolved))
380
+ continue;
381
+ seen.add(resolved);
382
+ lines.push(`(allow file-read* (subpath ${sbplString(resolved)}))`);
383
+ }
384
+ // The ROOT DIRECTORY needs `file-read*`, not metadata, and this was
385
+ // measured rather than reasoned: with every other directory a process needs
386
+ // opened by subpath and `/` allowed for metadata only, `/usr/bin/true`
387
+ // dies with SIGABRT before `main`. `/` alone, as a literal: it opens the
388
+ // top-level directory listing and no file in it.
389
+ lines.push('(allow file-read* (literal "/"))');
390
+ // `file-read-metadata` on every other ancestor of every allowed root:
391
+ // resolving a path means stat-ing each directory on the way down, and a
392
+ // jail that denied that would refuse `/Users/x/dev/muse` for lack of
393
+ // `/Users`. Metadata leaks a directory's existence, never its contents.
394
+ for (const ancestor of ancestorsOf([...seen])) {
395
+ if (ancestor === "/")
396
+ continue;
397
+ lines.push(`(allow file-read-metadata (literal ${sbplString(ancestor)}))`);
398
+ }
399
+ }
296
400
  for (const path of allowance.denyRead) {
297
401
  const resolved = resolveForProfile(path);
298
402
  // `literal` for a file, `subpath` for a directory. Both are emitted for a
@@ -312,8 +416,91 @@ export function seatbeltProfile(allowance) {
312
416
  if (!file)
313
417
  lines.push(`(deny file-read* (subpath ${sbplString(resolved)}))`);
314
418
  }
419
+ if (allowance.writeAllow !== undefined) {
420
+ lines.push(";; APRV-325.3: write confinement. Deny-DEFAULT for this rule family only,", ";; so a path nobody thought of is denied rather than forgotten.", "(deny file-write*)", ";; /dev is process I/O, not filesystem state. Denying it kills a shell", ";; before it can do anything, for the reason a bare network-outbound deny does.", '(allow file-write* (subpath "/dev"))');
421
+ for (const path of allowance.writeAllow) {
422
+ lines.push(`(allow file-write* (subpath ${sbplString(resolveForProfile(path))}))`);
423
+ }
424
+ }
315
425
  return `${lines.join("\n")}\n`;
316
426
  }
427
+ /**
428
+ * The read jail, plus the directories the command being run lives in (APRV-347).
429
+ *
430
+ * You cannot run a program you may not read. `sandbox-exec` execs the RESOLVED
431
+ * path, so a `node` or `npm` installed outside the compiled-in runtime set — a
432
+ * version manager under `~`, a `.local/bin` shim — fails `execvp` with
433
+ * `Operation not permitted` and exits 71, which reads as the command failing
434
+ * rather than as the jail working.
435
+ *
436
+ * Two directories are opened: the resolved executable's own, and its PARENT.
437
+ * The parent is what makes a toolchain work rather than merely start: an
438
+ * interpreter's entry point lives at `<prefix>/bin/<name>` and the library it
439
+ * immediately requires lives at `<prefix>/lib` or beside it, so opening only
440
+ * `bin` gets a process that launches and cannot find itself. `npm` resolves to
441
+ * `…/lib/node_modules/npm/bin/npm-cli.js`, whose parent is the npm package, and
442
+ * that is the shape this rule is for.
443
+ *
444
+ * It is NOT a widening a caller chooses: it is derived from the argv this
445
+ * function was already given, and it does nothing at all when no jail was
446
+ * asked for. Anything a command needs BEYOND its own install prefix — a
447
+ * dependency store elsewhere, a linked package — is the operator's
448
+ * `read_scope.roots` to declare.
449
+ */
450
+ function withExecutableRoots(allowance, command) {
451
+ const jail = allowance.allowRead ?? [];
452
+ if (jail.length === 0)
453
+ return allowance;
454
+ let real = command;
455
+ try {
456
+ real = realpathSync(command);
457
+ }
458
+ catch {
459
+ // Not resolvable: the caller already handles a command that is not there.
460
+ }
461
+ const own = dirname(real);
462
+ // `dirname(command)` as well as `dirname(real)`: a PATH entry is usually a
463
+ // directory of symlinks (`~/.local/bin/npm` -> a version manager's tree), and
464
+ // traversing the link needs the link's own directory open, not just the
465
+ // target's. Leaving it out fails `execvp` before the program starts.
466
+ const roots = [own, dirname(command)];
467
+ // The prefix, behind a DEPTH FLOOR. `dirname("/bin")` is `/`, and a root of
468
+ // `/` would open the entire filesystem — a jail that opened everything and
469
+ // reported nothing, which is the worst failure this file can have. Two
470
+ // segments, the same floor the hook applies to a scratch root and for the
471
+ // same reason: a value derived from somewhere else must not be able to name
472
+ // the root of the disk.
473
+ const prefix = dirname(own);
474
+ if (prefix.split("/").filter((segment) => segment.length > 0).length >= 2) {
475
+ roots.push(prefix);
476
+ }
477
+ return { ...allowance, allowRead: [...jail, ...roots] };
478
+ }
479
+ /**
480
+ * Every proper ancestor directory of these paths, sorted and de-duplicated.
481
+ *
482
+ * `subpath` opens a subtree; it says nothing about the directories ABOVE it,
483
+ * and opening `/Users/carter/dev/muse` is useless if the process may not stat
484
+ * `/Users`, `/Users/carter` and `/Users/carter/dev` on the way down. Metadata
485
+ * only: the names of the intermediate directories leak, their contents do not.
486
+ */
487
+ function ancestorsOf(paths) {
488
+ const out = new Set();
489
+ for (const path of paths) {
490
+ let at = dirname(path);
491
+ for (let depth = 0; depth < 64; depth += 1) {
492
+ if (at === "/" || at === "." || at === "")
493
+ break;
494
+ out.add(at);
495
+ const up = dirname(at);
496
+ if (up === at)
497
+ break;
498
+ at = up;
499
+ }
500
+ }
501
+ out.add("/");
502
+ return [...out].sort();
503
+ }
317
504
  /**
318
505
  * A path as an SBPL string literal.
319
506
  *
@@ -377,7 +564,9 @@ export function wrapForSandbox(mechanism, command, args, allowance = DENY_ALL_EG
377
564
  }
378
565
  const dir = mkdtempSync(join(realTmpdir(), "approval-sandbox-"));
379
566
  const profile = join(dir, "egress-denied.sb");
380
- writeFileSync(profile, seatbeltProfile(allowance), { mode: 0o600 });
567
+ writeFileSync(profile, seatbeltProfile(withExecutableRoots(allowance, command)), {
568
+ mode: 0o600,
569
+ });
381
570
  return {
382
571
  command: SANDBOX_EXEC,
383
572
  args: [...profileFlags(profile), command, ...args],
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../src/core/sandbox.ts"],"names":[],"mappings":"A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