tenjin-cli 0.1.0-alpha.15 → 0.1.0-alpha.17

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 (278) hide show
  1. package/NOTICE.md +54 -7
  2. package/README.md +43 -310
  3. package/dist/{_esm-N4KAVXQR.js → _esm-CE7KNONL.js} +9 -10
  4. package/dist/{ccip-ZGGWQN4X.js → ccip-7RMRLAGV.js} +4 -4
  5. package/dist/{ccip-RPPPKTJR.js → ccip-NLCSCHKI.js} +5 -5
  6. package/dist/chunk-2BKS2FVE.js +93 -0
  7. package/dist/chunk-2BKS2FVE.js.map +1 -0
  8. package/dist/chunk-2G2WLVHB.js +102 -0
  9. package/dist/chunk-2G2WLVHB.js.map +1 -0
  10. package/dist/chunk-2I4QTOLB.js +11 -0
  11. package/dist/chunk-2I4QTOLB.js.map +1 -0
  12. package/dist/chunk-2JGT3KDW.js +172 -0
  13. package/dist/chunk-2JGT3KDW.js.map +1 -0
  14. package/dist/chunk-2QYORQBF.js +55 -0
  15. package/dist/chunk-2QYORQBF.js.map +1 -0
  16. package/dist/chunk-35M3VITA.js +102 -0
  17. package/dist/chunk-35M3VITA.js.map +1 -0
  18. package/dist/{chunk-KINZ23CV.js → chunk-3AUDA53C.js} +4740 -23
  19. package/dist/chunk-3AUDA53C.js.map +1 -0
  20. package/dist/{chunk-MJZZTKCC.js → chunk-56MOAIP5.js} +5 -10
  21. package/dist/chunk-56MOAIP5.js.map +1 -0
  22. package/dist/{chunk-U5S527PP.js → chunk-5IEP5EGE.js} +3 -3
  23. package/dist/chunk-5QHHRMRA.js +227 -0
  24. package/dist/chunk-5QHHRMRA.js.map +1 -0
  25. package/dist/{chunk-JBIKAAT3.js → chunk-5UDD5VSY.js} +8 -8
  26. package/dist/chunk-5UDD5VSY.js.map +1 -0
  27. package/dist/chunk-7QKHZQKW.js +1680 -0
  28. package/dist/chunk-7QKHZQKW.js.map +1 -0
  29. package/dist/{chunk-ZFJJ3EXC.js → chunk-AR7U7BRG.js} +550 -182
  30. package/dist/chunk-AR7U7BRG.js.map +1 -0
  31. package/dist/chunk-AUKDYPPX.js +130 -0
  32. package/dist/chunk-AUKDYPPX.js.map +1 -0
  33. package/dist/{chunk-7FK2UN2T.js → chunk-AWQPGIR6.js} +65 -67
  34. package/dist/{chunk-7FK2UN2T.js.map → chunk-AWQPGIR6.js.map} +1 -1
  35. package/dist/{chunk-KYQVEKP5.js → chunk-BPMWXTFX.js} +8 -8
  36. package/dist/{chunk-47PP7TAG.js → chunk-EGELTSPU.js} +1356 -1356
  37. package/dist/chunk-EGELTSPU.js.map +1 -0
  38. package/dist/{chunk-S5RYMCV6.js → chunk-HPWO4O6S.js} +3 -3
  39. package/dist/chunk-J5INH7WB.js +299 -0
  40. package/dist/chunk-J5INH7WB.js.map +1 -0
  41. package/dist/chunk-JLEF5WHM.js +132 -0
  42. package/dist/chunk-JLEF5WHM.js.map +1 -0
  43. package/dist/{chunk-W6R3HAAG.js → chunk-JRGFKVAZ.js} +2 -2
  44. package/dist/{chunk-XJN5WUKL.js → chunk-KG3D7FIF.js} +2 -2
  45. package/dist/chunk-KK4YGYTV.js +808 -0
  46. package/dist/chunk-KK4YGYTV.js.map +1 -0
  47. package/dist/{chunk-CPCX67TI.js → chunk-KUBEYXSO.js} +1076 -1038
  48. package/dist/chunk-KUBEYXSO.js.map +1 -0
  49. package/dist/{chunk-QW2Q2KAH.js → chunk-LHHMV4GU.js} +2 -2
  50. package/dist/{chunk-NIKXHWOL.js → chunk-LJ4DMVFI.js} +16 -16
  51. package/dist/chunk-LJ4DMVFI.js.map +1 -0
  52. package/dist/{chunk-ZOBNS7CX.js → chunk-MEFB5KHA.js} +4 -18
  53. package/dist/chunk-MEFB5KHA.js.map +1 -0
  54. package/dist/{chunk-HPJGOLTN.js → chunk-MRGADYDD.js} +13 -8
  55. package/dist/chunk-MRGADYDD.js.map +1 -0
  56. package/dist/{chunk-M2O56UK7.js → chunk-N35E6CM2.js} +293 -163
  57. package/dist/chunk-N35E6CM2.js.map +1 -0
  58. package/dist/chunk-O4ZNKFRU.js +366 -0
  59. package/dist/chunk-O4ZNKFRU.js.map +1 -0
  60. package/dist/chunk-PDA2BVFY.js +244 -0
  61. package/dist/chunk-PDA2BVFY.js.map +1 -0
  62. package/dist/{chunk-POJRB2AE.js → chunk-POUWHWID.js} +2 -2
  63. package/dist/chunk-QDD2RN7G.js +10238 -0
  64. package/dist/chunk-QDD2RN7G.js.map +1 -0
  65. package/dist/chunk-S2NRVRPF.js +171 -0
  66. package/dist/chunk-S2NRVRPF.js.map +1 -0
  67. package/dist/chunk-TGLKKLQG.js +11 -0
  68. package/dist/chunk-TGLKKLQG.js.map +1 -0
  69. package/dist/chunk-TP4D47BY.js +127 -0
  70. package/dist/chunk-TP4D47BY.js.map +1 -0
  71. package/dist/{chunk-KZAAWQNP.js → chunk-TTNESUPQ.js} +3 -3
  72. package/dist/{chunk-UO22YNY4.js → chunk-U2DZISAH.js} +43 -1
  73. package/dist/chunk-U2DZISAH.js.map +1 -0
  74. package/dist/chunk-WGQVJM56.js +165 -0
  75. package/dist/chunk-WGQVJM56.js.map +1 -0
  76. package/dist/{chunk-OLWTRUTS.js → chunk-WLMJE3GJ.js} +35 -16
  77. package/dist/chunk-WLMJE3GJ.js.map +1 -0
  78. package/dist/chunk-WS4JA6TC.js +137 -0
  79. package/dist/chunk-WS4JA6TC.js.map +1 -0
  80. package/dist/chunk-WXC57XGG.js +29 -0
  81. package/dist/chunk-WXC57XGG.js.map +1 -0
  82. package/dist/{chunk-YLYINX2H.js → chunk-XZKD7DIF.js} +3 -3
  83. package/dist/chunk-XZOEUYMX.js +1784 -0
  84. package/dist/chunk-XZOEUYMX.js.map +1 -0
  85. package/dist/{cli-KKRKBU5T.js → cli-VHYYYYXM.js} +303 -374
  86. package/dist/cli-VHYYYYXM.js.map +1 -0
  87. package/dist/config-5ADBAAXU.js +42 -0
  88. package/dist/{dist-U4M6QCKE.js → dist-3LOO6M4U.js} +10 -10
  89. package/dist/doctor-Q35VQW3S.js +436 -0
  90. package/dist/doctor-Q35VQW3S.js.map +1 -0
  91. package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
  92. package/dist/{chunk-KAJZHIQ4.js → fund-GDDPL2BB.js} +81 -24
  93. package/dist/fund-GDDPL2BB.js.map +1 -0
  94. package/dist/hook-command-PBERPRE3.js +763 -0
  95. package/dist/hook-command-PBERPRE3.js.map +1 -0
  96. package/dist/index.js +8 -3
  97. package/dist/index.js.map +1 -1
  98. package/dist/install-OKDKGUXM.js +60 -0
  99. package/dist/install-wallet-SI4LZ73K.js +106 -0
  100. package/dist/install-wallet-SI4LZ73K.js.map +1 -0
  101. package/dist/{run-XYTQ5TWQ.js → mcp-XX3WRQEZ.js} +3766 -10677
  102. package/dist/mcp-XX3WRQEZ.js.map +1 -0
  103. package/dist/paths-P2N4JTDZ.js +49 -0
  104. package/dist/pay-3SYKHKWJ.js +39 -0
  105. package/dist/redact-6W23GGJC.js +15 -0
  106. package/dist/{secp256k1-XRPVBC6V.js → secp256k1-ZZZT2CAX.js} +3 -3
  107. package/dist/{send-G746D7PQ.js → send-LQRKTEJT.js} +29 -29
  108. package/dist/send-LQRKTEJT.js.map +1 -0
  109. package/dist/{chunk-QZ6ROAJU.js → skill-placement-JMDPSKE6.js} +155 -10
  110. package/dist/skill-placement-JMDPSKE6.js.map +1 -0
  111. package/dist/status-FFC6FO72.js +64 -0
  112. package/dist/status-FFC6FO72.js.map +1 -0
  113. package/dist/status-line-SAXSU6CR.js +87 -0
  114. package/dist/status-line-SAXSU6CR.js.map +1 -0
  115. package/dist/status-line-wiring-L2WYIYBM.js +29 -0
  116. package/dist/tenjin-daemon.mjs +20421 -0
  117. package/dist/tenjin-shim.mjs +251 -0
  118. package/dist/tenjin-vitest-reporter.mjs +49 -0
  119. package/dist/uninstall-OACH27UV.js +147 -0
  120. package/dist/uninstall-OACH27UV.js.map +1 -0
  121. package/dist/{update-R76LHOZW.js → update-4W6EKLGZ.js} +132 -16
  122. package/dist/update-4W6EKLGZ.js.map +1 -0
  123. package/dist/{viemAdapter-By13KInL-TUQJBMHM.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
  124. package/dist/wallet-BMEXRR3P.js +32 -0
  125. package/dist/wallet-kdf-worker.mjs +980 -0
  126. package/docs/agent-permissions.md +71 -352
  127. package/docs/safety-model.md +16 -6
  128. package/package.json +8 -7
  129. package/LICENSE +0 -21
  130. package/dist/buy-VIRNSYGN.js +0 -47
  131. package/dist/chunk-2MYQN7HM.js +0 -247
  132. package/dist/chunk-2MYQN7HM.js.map +0 -1
  133. package/dist/chunk-2RF2GIJQ.js +0 -1188
  134. package/dist/chunk-2RF2GIJQ.js.map +0 -1
  135. package/dist/chunk-3GL2Z5QK.js +0 -57
  136. package/dist/chunk-3GL2Z5QK.js.map +0 -1
  137. package/dist/chunk-47PP7TAG.js.map +0 -1
  138. package/dist/chunk-4CQIDQOT.js +0 -167
  139. package/dist/chunk-4CQIDQOT.js.map +0 -1
  140. package/dist/chunk-4KG27W2S.js +0 -614
  141. package/dist/chunk-4KG27W2S.js.map +0 -1
  142. package/dist/chunk-5QQTYWEU.js +0 -199
  143. package/dist/chunk-5QQTYWEU.js.map +0 -1
  144. package/dist/chunk-65DTCCJ7.js +0 -21
  145. package/dist/chunk-65DTCCJ7.js.map +0 -1
  146. package/dist/chunk-A5DKHMUN.js +0 -173
  147. package/dist/chunk-A5DKHMUN.js.map +0 -1
  148. package/dist/chunk-B63XPWQ4.js +0 -246
  149. package/dist/chunk-B63XPWQ4.js.map +0 -1
  150. package/dist/chunk-CAR6FHK6.js +0 -105
  151. package/dist/chunk-CAR6FHK6.js.map +0 -1
  152. package/dist/chunk-CPCX67TI.js.map +0 -1
  153. package/dist/chunk-CQBVCYI2.js +0 -162
  154. package/dist/chunk-CQBVCYI2.js.map +0 -1
  155. package/dist/chunk-DBU5CXBV.js +0 -4731
  156. package/dist/chunk-DBU5CXBV.js.map +0 -1
  157. package/dist/chunk-DHJD77OW.js +0 -81
  158. package/dist/chunk-DHJD77OW.js.map +0 -1
  159. package/dist/chunk-EDZSNPE5.js +0 -35
  160. package/dist/chunk-EDZSNPE5.js.map +0 -1
  161. package/dist/chunk-EFWZPUTC.js +0 -65
  162. package/dist/chunk-EFWZPUTC.js.map +0 -1
  163. package/dist/chunk-EPFL6CTE.js +0 -448
  164. package/dist/chunk-EPFL6CTE.js.map +0 -1
  165. package/dist/chunk-GHLVXVZD.js +0 -142
  166. package/dist/chunk-GHLVXVZD.js.map +0 -1
  167. package/dist/chunk-H3SOOJ2I.js +0 -580
  168. package/dist/chunk-H3SOOJ2I.js.map +0 -1
  169. package/dist/chunk-HPJGOLTN.js.map +0 -1
  170. package/dist/chunk-HRGBS2PA.js +0 -203
  171. package/dist/chunk-HRGBS2PA.js.map +0 -1
  172. package/dist/chunk-ITUXPJIS.js +0 -314
  173. package/dist/chunk-ITUXPJIS.js.map +0 -1
  174. package/dist/chunk-JBIKAAT3.js.map +0 -1
  175. package/dist/chunk-KAJZHIQ4.js.map +0 -1
  176. package/dist/chunk-KINZ23CV.js.map +0 -1
  177. package/dist/chunk-LRYV3SK7.js +0 -235
  178. package/dist/chunk-LRYV3SK7.js.map +0 -1
  179. package/dist/chunk-M2O56UK7.js.map +0 -1
  180. package/dist/chunk-MJZZTKCC.js.map +0 -1
  181. package/dist/chunk-NIKXHWOL.js.map +0 -1
  182. package/dist/chunk-OKDRDT74.js +0 -209
  183. package/dist/chunk-OKDRDT74.js.map +0 -1
  184. package/dist/chunk-OKYSNAS3.js +0 -2144
  185. package/dist/chunk-OKYSNAS3.js.map +0 -1
  186. package/dist/chunk-OLWTRUTS.js.map +0 -1
  187. package/dist/chunk-QQ6ELLSA.js +0 -143
  188. package/dist/chunk-QQ6ELLSA.js.map +0 -1
  189. package/dist/chunk-QZ6ROAJU.js.map +0 -1
  190. package/dist/chunk-R7RSCBI7.js +0 -794
  191. package/dist/chunk-R7RSCBI7.js.map +0 -1
  192. package/dist/chunk-SGK2B724.js +0 -67
  193. package/dist/chunk-SGK2B724.js.map +0 -1
  194. package/dist/chunk-U6VPKMGC.js +0 -390
  195. package/dist/chunk-U6VPKMGC.js.map +0 -1
  196. package/dist/chunk-UHTVXQ2O.js +0 -140
  197. package/dist/chunk-UHTVXQ2O.js.map +0 -1
  198. package/dist/chunk-UO22YNY4.js.map +0 -1
  199. package/dist/chunk-US456VUI.js +0 -149
  200. package/dist/chunk-US456VUI.js.map +0 -1
  201. package/dist/chunk-V44J2MXV.js +0 -400
  202. package/dist/chunk-V44J2MXV.js.map +0 -1
  203. package/dist/chunk-VJQKL3YH.js +0 -216
  204. package/dist/chunk-VJQKL3YH.js.map +0 -1
  205. package/dist/chunk-VJSQSLBM.js +0 -1442
  206. package/dist/chunk-VJSQSLBM.js.map +0 -1
  207. package/dist/chunk-VYOJOX4Z.js +0 -165
  208. package/dist/chunk-VYOJOX4Z.js.map +0 -1
  209. package/dist/chunk-WY2K35OL.js +0 -269
  210. package/dist/chunk-WY2K35OL.js.map +0 -1
  211. package/dist/chunk-ZFJJ3EXC.js.map +0 -1
  212. package/dist/chunk-ZOBNS7CX.js.map +0 -1
  213. package/dist/cli-KKRKBU5T.js.map +0 -1
  214. package/dist/config-JMRUNYE6.js +0 -37
  215. package/dist/discover-B5HF6SHM.js +0 -102
  216. package/dist/discover-B5HF6SHM.js.map +0 -1
  217. package/dist/doctor-ZBG7X66D.js +0 -32
  218. package/dist/edit-PZJIILQE.js +0 -40
  219. package/dist/fund-EUDH5KPA.js +0 -40
  220. package/dist/inspect-QC6WEQPN.js +0 -37
  221. package/dist/install-GNK2W3PI.js +0 -972
  222. package/dist/install-GNK2W3PI.js.map +0 -1
  223. package/dist/outcome-KSGWZHUS.js +0 -24
  224. package/dist/pay-BC4UICPA.js +0 -361
  225. package/dist/pay-BC4UICPA.js.map +0 -1
  226. package/dist/publish-LXWFDIKF.js +0 -42
  227. package/dist/read-JMNUQ56P.js +0 -160
  228. package/dist/read-JMNUQ56P.js.map +0 -1
  229. package/dist/run-XYTQ5TWQ.js.map +0 -1
  230. package/dist/search-TSQAB45E.js +0 -25
  231. package/dist/secp256k1-XRPVBC6V.js.map +0 -1
  232. package/dist/send-G746D7PQ.js.map +0 -1
  233. package/dist/session-JBKWMJ24.js +0 -89
  234. package/dist/session-JBKWMJ24.js.map +0 -1
  235. package/dist/skill-heal-WKD67SLJ.js +0 -92
  236. package/dist/skill-heal-WKD67SLJ.js.map +0 -1
  237. package/dist/skill-placement-RIU4AMC2.js +0 -20
  238. package/dist/skill-placement-RIU4AMC2.js.map +0 -1
  239. package/dist/uninstall-5E263VTS.js +0 -73
  240. package/dist/uninstall-5E263VTS.js.map +0 -1
  241. package/dist/update-R76LHOZW.js.map +0 -1
  242. package/dist/usdc-4VCDHFWX.js +0 -38
  243. package/dist/usdc-4VCDHFWX.js.map +0 -1
  244. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +0 -1
  245. package/dist/wallet-TQ7D5EQ7.js +0 -41
  246. package/dist/wallet-TQ7D5EQ7.js.map +0 -1
  247. package/dist/wallet-ZAVXWLWP.js +0 -32
  248. package/dist/wallet-ZAVXWLWP.js.map +0 -1
  249. package/docs/command-reference.md +0 -303
  250. package/skills/tenjin/SKILL.md +0 -373
  251. package/skills/tenjin-pay/SKILL.md +0 -76
  252. package/skills/tenjin-publish/SKILL.md +0 -227
  253. package/skills/tenjin-publish/references/maintain.md +0 -39
  254. package/skills/tenjin-search/SKILL.md +0 -154
  255. package/skills/tenjin-search/references/permissions.md +0 -112
  256. /package/dist/{_esm-N4KAVXQR.js.map → _esm-CE7KNONL.js.map} +0 -0
  257. /package/dist/{buy-VIRNSYGN.js.map → ccip-7RMRLAGV.js.map} +0 -0
  258. /package/dist/{ccip-RPPPKTJR.js.map → ccip-NLCSCHKI.js.map} +0 -0
  259. /package/dist/{chunk-U5S527PP.js.map → chunk-5IEP5EGE.js.map} +0 -0
  260. /package/dist/{chunk-KYQVEKP5.js.map → chunk-BPMWXTFX.js.map} +0 -0
  261. /package/dist/{chunk-S5RYMCV6.js.map → chunk-HPWO4O6S.js.map} +0 -0
  262. /package/dist/{chunk-W6R3HAAG.js.map → chunk-JRGFKVAZ.js.map} +0 -0
  263. /package/dist/{chunk-XJN5WUKL.js.map → chunk-KG3D7FIF.js.map} +0 -0
  264. /package/dist/{chunk-QW2Q2KAH.js.map → chunk-LHHMV4GU.js.map} +0 -0
  265. /package/dist/{chunk-POJRB2AE.js.map → chunk-POUWHWID.js.map} +0 -0
  266. /package/dist/{chunk-KZAAWQNP.js.map → chunk-TTNESUPQ.js.map} +0 -0
  267. /package/dist/{chunk-YLYINX2H.js.map → chunk-XZKD7DIF.js.map} +0 -0
  268. /package/dist/{ccip-ZGGWQN4X.js.map → config-5ADBAAXU.js.map} +0 -0
  269. /package/dist/{dist-U4M6QCKE.js.map → dist-3LOO6M4U.js.map} +0 -0
  270. /package/dist/{config-JMRUNYE6.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
  271. /package/dist/{doctor-ZBG7X66D.js.map → install-OKDKGUXM.js.map} +0 -0
  272. /package/dist/{edit-PZJIILQE.js.map → paths-P2N4JTDZ.js.map} +0 -0
  273. /package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js.map → pay-3SYKHKWJ.js.map} +0 -0
  274. /package/dist/{fund-EUDH5KPA.js.map → redact-6W23GGJC.js.map} +0 -0
  275. /package/dist/{inspect-QC6WEQPN.js.map → secp256k1-ZZZT2CAX.js.map} +0 -0
  276. /package/dist/{outcome-KSGWZHUS.js.map → status-line-wiring-L2WYIYBM.js.map} +0 -0
  277. /package/dist/{publish-LXWFDIKF.js.map → viemAdapter-By13KInL-X2VY6CY3.js.map} +0 -0
  278. /package/dist/{search-TSQAB45E.js.map → wallet-BMEXRR3P.js.map} +0 -0
@@ -1,404 +1,123 @@
1
1
  # Agent permissions
2
2
 
3
- Coding harnesses running unattended ("auto mode", "full auto", YOLO) classify each
4
- shell command before running it, and an unknown binary is denied by default. That
5
- denies the free verbs too, which breaks the whole marketplace loop: the skills
6
- forbid working around a denial, so a denied `tenjin search` just stops.
3
+ `tenjin install` writes one permission rule into `~/.claude/settings.json`, and this page is the whole reasoning behind it: what it clears, what it cannot clear, and what stays a decision you make by hand.
7
4
 
8
- Pre-clearing the free verbs once fixes that. This page is the full reasoning
9
- behind which verbs are on that list, which three are separate opt-ins, and which are
10
- never recommended at all, and it is where `tenjin install` and `tenjin doctor`
11
- send you. The [README](../README.md#permissions) carries the paste block and the
12
- three-tier summary.
5
+ Harnesses that run unattended deny tools they have not been told about. Without the rule below, every lookup stops on a permission prompt, and a session left alone stops with it.
13
6
 
14
- ## The free tier
15
-
16
- The free tier is nine rules for the `permissions.allow` array of Claude Code's
17
- `~/.claude/settings.json`. `tenjin install` can write them for you; see
18
- [Getting the rules onto your machine](#getting-the-rules-onto-your-machine).
7
+ ## The one rule
19
8
 
20
9
  ```
21
- Bash(tenjin search:*)
22
- Bash(tenjin fund:*)
23
- Bash(tenjin inspect:*)
24
- Bash(tenjin read:*)
25
- Bash(tenjin outcome:*)
26
- Bash(tenjin doctor:*)
27
- Bash(tenjin wallet show:*)
28
- Bash(tenjin wallet balance:*)
29
- Bash(tenjin config get:*)
10
+ mcp__x402__request
30
11
  ```
31
12
 
32
- None of those can spend, and none can move your keys; `tenjin doctor` decrypts
33
- locally to check your wallet still opens. That is the definition of
34
- this tier, and it is deliberately narrower than "signs nothing": `tenjin read` can
35
- present a session key that already exists, which is a signature — a P-256
36
- delegation, the wrong curve to authorize a USDC transfer. It cannot mint one; that
37
- needs the wallet.
38
-
39
- ### What each verb actually does
40
-
41
- | Rule | Why it is safe to pre-clear |
42
- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
43
- | `Bash(tenjin search:*)` | Free anonymous marketplace search. No wallet, no signing, no payment. POSTs the generalized question off-machine. |
44
- | `Bash(tenjin fund:*)` | Owner call (2026-08-12): mints a card-funding checkout link for THIS wallet only; moves no money, origin-pinned (no `--base-url`). |
45
- | `Bash(tenjin inspect:*)` | Free pre-purchase card and preview. Never signs, never pays, never saves. |
46
- | `Bash(tenjin read:*)` | Free-only delivery. Cannot spend and cannot open the keystore, but transmits a cached session key when one exists (see below). |
47
- | `Bash(tenjin outcome:*)` | Free honest outcome report on a past search. No wallet, no payment. POSTs a report that moves the marketplace's reuse signal. |
48
- | `Bash(tenjin doctor:*)` | Local environment and API reachability diagnostics; decrypts the wallet locally to check it still opens. |
49
- | `Bash(tenjin wallet show:*)` | Prints the wallet address and key source. Never prints the key. |
50
- | `Bash(tenjin wallet balance:*)` | Read-only USDC balance query on Base. |
51
- | `Bash(tenjin config get:*)` | Reads one effective config value. Note `config get rpcUrl` returns a URL that commonly embeds a provider API key. |
52
-
53
- `tenjin doctor --json` emits the same per-verb notes under `permissions`, so an
54
- agent can read them without this page.
55
-
56
- ### Three free verbs are not read-only
57
-
58
- Worth knowing before you pre-clear them: `tenjin search` POSTs your generalized
59
- question off-machine, and `tenjin outcome` POSTs a report that moves the
60
- marketplace's reuse signal — both unauthenticated and free, neither carrying a
61
- credential — while `tenjin read` writes locally, saving a delivered piece to your
62
- library.
63
-
64
- ### `read` transmits a credential once a session key exists
65
-
66
- Worth knowing before you paste the `read` line: once a session key exists, `read`
67
- **transmits that wallet-derived credential** to the origin it was minted for. That
68
- origin binding is what keeps a stray `--base-url` from redirecting it, and it is
69
- the reason the binding exists rather than a nicety.
70
-
71
- `read` itself can never mint one: it imports no wallet, payment, or
72
- session-minting module, and its import graph is test-pinned to stay clear of all
73
- three. It cannot unlock a keystore and never consults the spend policy.
74
-
75
- ## Getting the rules onto your machine
76
-
77
- `tenjin install` writes the nine rules into `~/.claude/settings.json` for you,
78
- plus the two rules your publish mode carries (below). It is one of the four setup
79
- decisions, and at a terminal it asks:
80
-
81
- > Let your agent use tenjin without permission popups? Adds 9 command rules to
82
- > `~/.claude/settings.json`. None of them can spend your money. Details:
83
- > https://github.com/BackTrackCo/tenjin-agent/blob/main/docs/agent-permissions.md
84
-
85
- On an `auto` or `full-auto` publish mode the same question says 11 rules, and adds
86
- that your agent will publish under your identity on its own. The question is two
87
- sentences and a link on purpose: this page is where the detail lives, and an
88
- operator answering a yes/no cannot act on a rule string they have not met yet.
89
-
90
- Answer yes and it merges them in. The write appends the rules that are missing and
91
- never reorders or rewrites an existing entry or any other key in the file. It
92
- removes exactly two things: a rule an older version of this CLI wrote and this one
93
- no longer does, and, when your `publish.mode` is back to `review`, the two rules
94
- that mode carries. A settings file it cannot parse is reported and left exactly as
95
- it is, never repaired. The rules it may write are fixed constants selected by your
96
- publish mode, so no flag or config value can widen it to `buy`, `session start`,
97
- `send`, `config set`, or a blanket `Bash(tenjin:*)`.
98
-
99
- A non-interactive install (piped, or under `--json`) does the same write BY
100
- DEFAULT, with no flag: the machine most likely to be denied mid-task is the
101
- headless one, and there is nobody there to answer. `--no-allow-free-verbs` opts
102
- out; `--allow-free-verbs` states the default explicitly. Every run that writes
103
- reports how many rules landed, in which file, and that deleting those lines undoes
104
- it.
105
-
106
- `tenjin doctor --json` carries this whole recommendation as data under
107
- `permissions` (every rule, every per-verb note, both caveats, on the failure
108
- envelope as well as the success one) so an agent that just got denied can point
109
- you at the exact line. Its human render is the check list plus one link back
110
- here.
111
-
112
- ## A prefix rule pins the verb, not the flags
113
-
114
- Every line above also clears `--base-url <url>` on that verb, because the CLI
115
- accepts the global flags on every subcommand. `--base-url` is validated as a URL
116
- and nothing more, and it wins settings precedence, so it moves where the question
117
- goes, where `doctor` probes, and (with the `buy` line below) where a SIWX signature
118
- and an EIP-3009 payment authorization are sent. The origin pin only checks that a
119
- resource URL shares an origin with the _configured_ base, so an attacker-controlled
120
- pair satisfies it.
13
+ That is it. It clears the `request` tool on the `x402` MCP server `tenjin install` registers, and nothing else: no shell verb, no other tool, no price.
121
14
 
122
- There is no prefix syntax for "this verb but not that flag", so treat this as a
123
- disclosed limit: set your base URL in config, and allowlist these verbs only if you
124
- are content for an agent to be able to choose the destination host. The skills tell
125
- agents never to pass `--base-url` on an allowlisted verb, but that is a convention
126
- rather than an enforced boundary.
15
+ It is a tool grant, not a spending grant. Every payment the tool makes still passes the local spend policy, and the policy is the only thing that decides an amount.
127
16
 
128
- ## Opt-in: purchases
17
+ ## What bounds a payment
129
18
 
130
- Purchases are a **separate, explicit opt-in**:
19
+ Four numbers and a file, all local, none of them readable or raisable by the router:
131
20
 
132
- ```
133
- Bash(tenjin buy:*)
134
- ```
21
+ - **`maxAutoSpend`** is the ceiling on one call. `tenjin install` sets it to 0.25 USD when your config file does not already name it.
22
+ - **`sessionBudget`** is a rolling 24 hour ceiling on everything. `tenjin install` sets it to 5.00 USD on the same terms.
23
+ - **`confirm`** decides when a human is asked. `tenjin install` sets `above:250000`, which auto-approves at or below 0.25 USD, and it NEVER changes a `confirm` you wrote yourself.
24
+ - **`spend.json`** is the ledger. A reservation counts the money the moment an authorization is built, under a cross-process file lock, so two commands cannot each spend the last of the budget.
135
25
 
136
- Read this before pasting it: **on the default config that line authorizes
137
- unattended spending up to your wallet balance.** `--yes` is an ordinary flag on the
138
- same allowlisted verb and it clears the confirm gate outright, so `confirm: always`
139
- does not put a human on every purchase once the agent can pass `--yes`.
140
-
141
- Walking the defaults:
142
-
143
- - `allowlistCreators` is empty, so the creator gate is off.
144
- - `maxAutoSpend` is `0` and `confirm` is `always`, which together only ask for a
145
- confirmation that `--yes` satisfies.
146
- - `sessionBudget` is `0`, which the policy reads as **no ceiling at all**, not a
147
- zero one.
148
-
149
- Set real values first:
26
+ The `request` tool has nobody to ask, so it answers its own confirm prompt with no. Under `confirm always` it returns `needs_approval` with the amount and the command that changes it, and pays nothing.
150
27
 
151
28
  ```bash
29
+ tenjin status # spent, reserved, and the caps in force
152
30
  tenjin config set maxAutoSpend 0.25
153
31
  tenjin config set sessionBudget 2.00
154
32
  ```
155
33
 
156
- The allowlist line itself never raises a spend cap. That is true, and it is not the
157
- same as saying the caps stop an allowlisted `buy`.
34
+ ## What bounds a ROUTER payment, on top of that
158
35
 
159
- ## Opt-in: `tenjin pay`
36
+ The routing decision comes from a server, and it is free: it proposes, it never authorizes. These checks are what keep a wrong or hostile one from being worth anything:
160
37
 
161
- The generic x402 payment verb is its own opt-in, with everything above applying
162
- unchanged:
38
+ - The amount actually signed has to fit `maxAutoSpend` and the day's `sessionBudget`. A live price above the one the decision quoted is refused before anything is signed, so a provider or a stale catalog cannot charge more than it advertised; a hostile server sets that quote itself, so against one the bound stays `maxAutoSpend`.
39
+ - The backend binds the call and validates its arguments against the capability's own schema, then sends the finished request; this CLI sends it as given and never rebuilds it, so there is no second copy of that rule here to drift from the first.
40
+ - The destination has to be a public HTTPS endpoint whose name resolves to a public address. This is a check, not a pin: the request resolves the name again on its own, so a host that answers publicly at check time and privately a moment later is not closed by it. See [safety-model.md](./safety-model.md).
41
+ - A 2xx whose body fails the decision's own success rule is a paid failure, not a delivery.
163
42
 
164
- ```
165
- Bash(tenjin pay:*)
166
- ```
43
+ A compromised backend can therefore name any origin it likes, and spend at most one `maxAutoSpend` per call inside `sessionBudget`. Set both to numbers you would not mind losing. This is a pocket-money wallet, not treasury custody.
167
44
 
168
- Two differences from `buy`. The destination set is wider: the configured base
169
- URL always, and with `bazaarPay` on, any registry-listed foreign seller. And
170
- there is no library dedupe: `pay` has no owned-content re-read, so a looping
171
- agent pays on every call, bounded only by `maxAutoSpend`, `sessionBudget`, and
172
- `--max-price`. Leave `bazaarPay` off unless you mean it.
45
+ ## A prefix rule pins the verb, not the flags
173
46
 
174
- ## Opt-in: minting a session key
47
+ This matters for the shell rules below rather than the tool rule above. Claude Code's `Bash(tenjin pay:*)` matches the verb and lets every flag through, including `--base-url`, which points the command at another host. So a rule you add is a rule for the verb at whatever host the caller names, and a task that arrived from a web page or a purchased document is exactly where such a flag comes from.
175
48
 
176
- Minting a session key is the **third** explicit opt-in. It spends nothing and
177
- cannot spend, but it opens the keystore:
49
+ ## Opt in by hand: paying an endpoint you name
178
50
 
179
51
  ```
180
- Bash(tenjin session start:*)
52
+ Bash(tenjin pay:*)
181
53
  ```
182
54
 
183
- `tenjin session start --scope read` takes one wallet signature and leaves a ≤24h
184
- P-256 delegation in `~/.tenjin/session.json` (0600), which `tenjin read` then
185
- presents to recover pieces you already own. The key is the wrong curve to sign an
186
- EIP-3009 payment authorization, so the line can never become a spend grant.
55
+ `tenjin pay <url>` is the plain x402 client verb. It runs the same gate as the router: `maxAutoSpend`, `sessionBudget`, `confirm`, the same reservation. Two differences are worth knowing before you add the line:
187
56
 
188
- ### The `read` scope is not a containment boundary
57
+ - The destination set is wider. The configured base URL is always payable; any other https origin needs `bazaarPay` on AND a configured registry that lists that exact resource with terms the live 402 does not exceed. Leave `bazaarPay` off unless you mean it.
58
+ - There is no dedupe. Every call pays, bounded only by the caps and `--max-price`.
189
59
 
190
- Do not read the `read` scope as more than a scope. It is enforced only on the
191
- request shape that carries a session signature alongside the delegation header; a
192
- copy of the same delegation presented differently is not scope-checked, so treat
193
- the file as a credential carrying your wallet's authority. Its real bounds are the
194
- 24h expiry, the 0600 mode, and the origin binding.
60
+ ## Never recommended
195
61
 
196
- ### What you are actually clearing
62
+ Each of these is a decision a person makes, so none is in the rule set and none should be added without meaning it:
197
63
 
198
- **Unattended keystore access.** On an encrypted wallet the passphrase comes from
199
- the environment rather than from you, and the `--base-url` caveat above bites
200
- hardest here, because a mint against a host an agent chose is a wallet signature
201
- you did not intend to make. `tenjin doctor` reports whether a session exists, for
202
- which origin, at what scope, and when it expires.
64
+ | Verb | Why it stays a human decision |
65
+ | ---------------------- | -------------------------------------------------------------------- |
66
+ | `tenjin wallet send` | Moves USDC out of the wallet and is not bounded by the spend policy. |
67
+ | `tenjin wallet create` | Creates the payment credential. |
68
+ | `tenjin config set` | It can widen the agent's own spend policy. |
69
+ | `tenjin install` | Writes into harness config. |
70
+ | `tenjin uninstall` | Removes the wiring the harness is running on. |
71
+ | `tenjin update` | Replaces the binary the agent then runs. |
203
72
 
204
- ## Never recommended
73
+ Prefer the narrow rules on this page to a broad `Bash(tenjin:*)`, `Bash(tenjin wallet:*)` or `Bash(tenjin config:*)`, each of which swallows the table above.
205
74
 
206
- Deliberately **never** recommended, because each is a human decision:
207
-
208
- | Verb | Why it stays a human decision |
209
- | ---------------------- | ------------------------------------------------------------------------------------ |
210
- | `tenjin send` | Moves USDC out of the wallet, and is not bounded by the buy spend policy. See below. |
211
- | `tenjin publish` | Publishes publicly under your identity. Cleared only by `publish.mode`; see below. |
212
- | `tenjin edit` | Edits live posts and prices. Cleared only by `publish.mode`; see below. |
213
- | `tenjin wallet create` | Creates the payment credential. |
214
- | `tenjin config set` | It can widen the agent's own spend policy. |
215
- | `tenjin install` | Writes into harness config and skills directories. |
216
- | `tenjin mcp` | It re-exposes every command core, so clearing it clears everything. |
217
- | `tenjin update` | It replaces the tenjin binary the agent then runs. See below. |
218
-
219
- For the same reason, prefer the narrow rules above over a broad `Bash(tenjin:*)`,
220
- `Bash(tenjin wallet:*)`, or `Bash(tenjin config:*)`, which would swallow them.
221
-
222
- ## The two rules your publish mode carries
223
-
224
- `publish.mode` is where you say whether publishing asks you first. On `auto` or
225
- `full-auto` it does not, and a harness prompt in front of every publish asks that
226
- same question again somewhere the mode cannot answer it, so the agent stops and
227
- the mode you chose does nothing. That is why two rules track the mode:
228
-
229
- - `Bash(tenjin publish:*)` puts new content on the marketplace under your identity.
230
- It publishes the contents of any local file the agent can read, gated only by the
231
- deterministic scan below. It also opens your wallet keystore unattended and mints
232
- a `read+write` session credential to disk when no usable one exists, which is a
233
- strictly broader credential than the read-only one `tenjin session start` asks
234
- for as an explicit opt-in.
235
- - `Bash(tenjin edit:*)` updates posts your wallet already owns: reprices, refreshes
236
- an as-of date, repairs an answer card. Owner-scoped on both legs, spends nothing,
237
- and creates no new public content, but it opens the keystore on the same terms,
238
- and it runs the same `publish.mode` gate in the CLI. A mode that can publish a
239
- post unattended but cannot fix that post's price is the asymmetry the mode exists
240
- to remove.
241
-
242
- Neither is in any block above: there is nothing to paste here, because the mode is
243
- the decision and the rules only follow it. Neither can spend: `publish` and `edit`
244
- carry no payment path, so what they reach is your identity and your keystore, not
245
- your balance.
246
-
247
- **Installing Tenjin is the consent for these.** `tenjin install` settles
248
- `publish.mode` at `auto` unless you say otherwise, and writes both rules alongside
249
- the free tier on the FIRST install, headless runs included. Pass
250
- `--publish-mode review` if you want the mode without the rules; at a terminal the
251
- install asks the question outright, with auto as the default answer.
252
-
253
- Each surface discloses the grant at the depth its reader can use. At a terminal
254
- the install says which mode it settled, what your agent will now do in plain
255
- words, and the one command that turns it off (`tenjin config set publish.mode
256
- review`); it deliberately prints no rule strings, because a `Bash(...)` line an
257
- operator is meeting for the first time mid-install is not something they can act
258
- on. `tenjin install --json` and `tenjin doctor --json` carry the whole thing as
259
- data: both rule strings, what they clear including the keystore and the
260
- `read+write` session mint, and all three undos. This page is the long form.
261
-
262
- The bare CLI, on a machine where `install` never ran, still defaults to `review`
263
- and grants nothing. Install is the consent anchor: nothing here is granted to
264
- someone who never ran it.
265
-
266
- Going back to `review` takes them away, on the next `install` or immediately
267
- with `tenjin config set publish.mode review`. `tenjin uninstall` reclaims them
268
- like every other rule this CLI wrote. There is no flag that adds them and no line
269
- to paste: change the mode.
270
-
271
- Your `publish.mode` lives in `~/.tenjin/config.json` and survives `tenjin
272
- uninstall` along with the rest of your config, so a later `tenjin install` resumes
273
- it and writes both rules again: installing is the consent, each time. Set the mode
274
- to `review` before uninstalling, or pass `--publish-mode review` when you come
275
- back, if you want the rules to stay gone.
276
-
277
- `tenjin config set publish.mode` keeps the two in step without waiting for the
278
- next `install`. Moving to `auto` or `full-auto` asks you once, naming both rules,
279
- and writes them on yes; a run with no terminal, a `--json` run, or a no leaves
280
- the file alone and prints where the rules go. Moving back to `review` retracts
281
- them without asking, because that direction can only take back what this CLI
282
- wrote. It runs through a pass that removes and never appends, so it retracts on
283
- any machine carrying the rules, including one whose free tier no longer matches
284
- what this release ships. The one case it cannot handle is a settings file it
285
- cannot parse, which it reports by name along with `tenjin uninstall`.
286
-
287
- What still stops a bad publish is the CLI, not the harness prompt: the
288
- deterministic secret scan blocks in every mode and is never clearable by `--yes`,
289
- `auto` stops on any finding, and `full-auto` stops only on a hard block. These
290
- rules clear the harness prompt and nothing else.
291
-
292
- Read "`auto` stops on any finding" as a stop rather than as a human, though.
293
- These are prefix rules: they pin the verb, not the flags. `--yes` is an ordinary
294
- flag on the same allowlisted verb, and it clears exactly the WARN findings `auto`
295
- stopped on, so a re-run with it collapses `auto` into `full-auto` with nobody
296
- asked, the same hazard the `tenjin buy` line carries. What holds that line is the
297
- skills, which render the findings as the question rather than asking a generic
298
- one first.
299
-
300
- ### `tenjin update`, a human decision
301
-
302
- `tenjin update` replaces the globally installed `tenjin` with whatever npm serves
303
- next, which is the binary the agent goes on to run for the rest of the session and
304
- every session after it. Which build an agent executes is an operator decision, so
305
- no recommended rule pre-clears it. `tenjin update --check` only reports, but a
306
- prefix rule pins the **verb**, not the flags, so clearing the check would clear
307
- the install with it. Nothing stops you adding the rule yourself; it stays off the
308
- recommended set.
309
-
310
- ### `tenjin fund`, free on both surfaces
311
-
312
- Free by owner decision (2026-08-12), because on either surface the command just
313
- opens the fund modal. Minting a checkout link moves no money: the destination is
314
- pinned server-side to the wallet that signed the request, so a link an agent
315
- mints can only ever fund your own wallet, the CLI refuses any checkout host but
316
- `pay.coinbase.com`, and the payment itself happens behind Coinbase's own human
317
- gate. The `--base-url` caveat that qualifies every other prefix rule does not
318
- apply here: `fund` is pinned to the production origin and takes no override from
319
- the flag, the environment, or config, so an allowlisted invocation cannot steer
320
- where the wallet's SIWX proof goes. That pin is what separates `fund` from
321
- `session start` (unattended keystore access, override surface intact), which
322
- stays opt-in.
323
-
324
- ### `tenjin send`, the escape hatch
325
-
326
- `send` is human-invoked only: it is deliberately absent from the MCP toolset and
327
- the harness skills, and nothing is signed until the previewed (checksummed)
328
- recipient, amount, and network fee are confirmed, interactively at a TTY or
329
- explicitly with `--yes` when headless. It refuses when the active wallet's
330
- passphrase entry is missing. The `sendMaxAmount` hard per-send cap has no
331
- default: `tenjin send` refuses until you run `tenjin config set sendMaxAmount
332
- <usd|0|none>` (`0` disables the verb, `none` opts in to uncapped), and `--yes`
333
- can never bypass the cap or the unset refusal. For routing FUTURE revenue away
334
- from the agent wallet entirely, connect the agent to your own Tenjin account
335
- instead (delegation); `send` exists for funds already sitting on the agent key.
75
+ ## What `tenjin install` writes, in full
336
76
 
337
- ## Wallet passphrase storage
77
+ 1. Five hook entries in `~/.claude/settings.json` (`--project` writes the project file instead): `UserPromptSubmit` running `tenjin hook prompt`, `PreToolUse` on `WebSearch|WebFetch` running `tenjin hook native`, `PreToolUse` on `Agent|Task` running `tenjin hook agent`, and `PostToolUse` and `PostToolUseFailure` on `WebSearch|WebFetch`, both running `tenjin hook shortfall`. All are plain command entries with a 5 second timeout. No daemon, no background process, no generated script. An install from an earlier release already has the first two; `tenjin install --refresh` (which `tenjin update` runs) adds the rest.
78
+ 2. The `mcp__x402__request` rule in `permissions.allow`. Nothing goes into `permissions.deny`, and no hook ever approves a call, so WebSearch and WebFetch stay under your own permission rules. Before each one, when a paid lookup fits it, the hook redirects your assistant to `mcp__x402__request` in its place, as earlier releases did; a subagent is redirected only when it is known to have `mcp__x402__request` and your spend policy would pay without asking, and otherwise its call simply runs. After a call that came back short (a failed call, a page that answers 401, 402, 403, 429 or 5xx, an empty page, a search with no results; never a 404 or 410, since a missing page is missing for a paid reader too), the router may offer a paid lookup.
79
+ 3. The `x402` MCP server, through `claude mcp add x402 -s user -- tenjin mcp` when the `claude` binary is on PATH, and printed for you to run when it is not. Under `--project` it registers at project scope instead, from the project directory, so the server lands in that project's `.mcp.json` and your `~/.claude.json` is not touched; `tenjin uninstall --project` removes it from the same place. The scope's own file is read first: a registration that already launches `tenjin mcp` is left exactly as it is and nothing is spawned, an `x402` entry launching anything else is removed and re-added, and a registration file this build cannot parse is reported rather than written over.
80
+ 4. The three spend keys above, only where your config file is silent, plus `bazaarPay` on, which is the lane the router pays providers through.
81
+ 5. `statusLine`, running `tenjin status-line` once a second, ONLY when that key is not already set. A status line of your own is never replaced: the install prints the command that runs both, and `--status-line compose` writes it only if you ask. The status line stores nothing new off your machine. It reads local files this CLI already writes under your Tenjin data dir: per session, the tool, the provider endpoint, the bounded redacted parameters of the call, its outcome and its price. No prompt text, no result body. Records expire after ten minutes, live in a 0700 directory under a hash of the session id, and are deleted by the next lookup that passes over them.
338
82
 
339
- The signing passphrase resolves in order: `TENJIN_WALLET_PASSPHRASE`, then the
340
- OS credential store, then an interactive prompt. On `wallet create` with no env
341
- passphrase, a strong random one is generated and saved to the OS store so later
342
- signing is transparent. Every stored entry is **per wallet**, keyed by the
343
- wallet's own address, so replacing a wallet never touches the outgoing wallet's
344
- passphrase. Installs from before per-wallet entries used one shared slot; the
345
- first signing that proves ownership re-keys that slot under the owning wallet's
346
- address, and the copy is verified before the old slot is removed.
83
+ Every other key in the settings file is preserved byte for byte, a second run writes the same bytes, and `tenjin uninstall` removes exactly those five things and keeps your wallet, your ledger and your config.
347
84
 
348
- Where entries land per platform:
85
+ To stop the router without removing anything, `tenjin config set router.enabled false` stops it on this machine, and `tenjin config set --project router.enabled false` stops it in this repository. Off means no router hook reads or sends anything and the `request` tool refuses without paying. The project value lives in `<project>/.tenjin/config.json`, which you commit; `--project --local` writes `.tenjin/config.local.json` beside it instead, which is yours alone and belongs in `.gitignore`. Every such file from where the session runs up to the git root applies, and in a git worktree so do the main checkout's; a key a file leaves out is inherited from the files around it. A project file can only turn the router off or narrow what it sends; it cannot enable anything or change a spend setting. From a git worktree, `config set --project` writes at the worktree's own root, never the main checkout's file, though the router reads both.
349
86
 
350
- - **macOS**: the login keychain, via the OS `security` tool (the same mechanism
351
- the GitHub CLI uses): service `tenjin-cli`, account = the wallet address.
352
- - **Windows**: a DPAPI-encrypted file per wallet (`passphrase.<address>.dpapi`),
353
- decryptable only by the same user on the same machine, via built-in
354
- PowerShell. The file holds ciphertext, not the passphrase.
355
- - **Desktop Linux**: the Secret Service keyring, via `secret-tool` when
356
- libsecret-tools is installed: service `tenjin-cli`, account = the wallet
357
- address.
358
- - **Headless or CI (any OS)**: no durable OS store, so set
359
- `TENJIN_WALLET_PASSPHRASE`.
87
+ ## How one lookup runs
360
88
 
361
- The passphrase reaches these tools over stdin, never on a command line, and the
362
- key never leaves the machine.
89
+ 1. You type a turn. The hook sends the bounded packet to Tenjin, which answers whether a paid capability fits and, if it does, keeps that packet under a short-lived id.
90
+ 2. When one fits, your assistant sees one line, opening with `Tenjin router (installed by the user):`, that names the service and the call to make: `mcp__x402__request` with your exact lookup and that id.
91
+ 3. Your assistant calls `request({query, id})` with the lookup it actually means. That is the accurate part: the routing is decided from your assistant's own query plus the stored context, not from a guess made before the lookup was known.
92
+ 4. Tenjin answers with the call to make and what the provider charges. Deciding costs nothing.
93
+ 5. This CLI pays that provider once, under your limits, and hands back the result.
363
94
 
364
- ## Two gaps, both fail-closed
95
+ ## What the hooks send
365
96
 
366
- Both are denied, never wrongly allowed:
97
+ - On every prompt and every native `WebSearch` or `WebFetch`: the text of the current turn and at most six prior messages, masked by the same key, PEM, seed-phrase, and URL credential rules the publish scan uses, then bounded to 16 KiB, with harness meta rows and tool results excluded. Tool results never travel: a tool result is other people's content, and a packet carrying it would be a channel from a fetched page into a routing decision.
98
+ - A native call sends that same bounded turn WITH the call attached, read from this session's own transcript. That is how a restriction you stated in your own words, such as asking for native tools only, reaches the decision about a bare URL your assistant is fetching. When that call then comes back short and nothing was offered before it, it is sent once more with what the harness reported: the status code and byte count, or the error. Never the page or the results. A call that came back fine sends nothing more.
99
+ - When your assistant hands a task to a subagent: that task, as the current message, with the same bounded turn before it.
100
+ - With `router.context turn`, no prior messages are sent: the prompt on a prompt, your latest message on a native call, and the task on a delegation. `tenjin config set router.context turn` sets it for this machine, and `--project` for this repository.
101
+ - Slash commands and one-word acknowledgements are never sent at all.
102
+ - The packet is stored on the backend against the decision id, so the lookup your assistant sends next is decided with the context you gave. Expired packets are unreadable after 15 minutes (the route refuses an expired id) and are deleted by the next router request or the daily cleanup, whichever comes first.
103
+ - On a paid lookup: the capability chosen, a hash of the contract, a hash of the arguments, your wallet address, the amount and the transaction hash are kept.
367
104
 
368
- - Bare `tenjin config` is as read-only as `config get`, but no prefix rule reaches
369
- it without also covering `config set`, so use `tenjin config get <key>`.
370
- - Group-level flag forms like `tenjin wallet --json show` are not covered, so put
371
- global flags after the leaf verb (`tenjin wallet show --json`).
105
+ The answer can put one line into your session, or into a task your assistant delegates: the service that fits, what it does, its listed price, and the `mcp__x402__request` call carrying the id that brings your context to it. The line says it comes from the Tenjin router you installed, and it is an option: your assistant's own tools keep working. Which service actually runs, and what it costs, is decided when your assistant makes that call, under your spend policy.
372
106
 
373
- ## Delegating to a subagent
107
+ ## Wallet passphrase storage
374
108
 
375
- The free tier is the answer to "what may a read-only subagent run", with nothing
376
- subtracted. All nine are safe to hand over: `search`, `fund`, `inspect`, `read`,
377
- `outcome`, `doctor`, `config get`, `wallet show`, `wallet balance`.
378
- None can spend and none can move your keys; `fund` mints a checkout link only a
379
- human can pay.
109
+ The private key is generated on your machine and stored encrypted in `~/.tenjin/wallet.json`. Its passphrase is `TENJIN_WALLET_PASSPHRASE` when you set one, and otherwise a strong generated passphrase in the platform's own credential store (Keychain on macOS, Secret Service on Linux, DPAPI on Windows), verified by reading it back. There is deliberately no plain-file fallback: a passphrase sitting next to the keystore it unlocks protects nothing, so a machine with neither creates no wallet and says so.
380
110
 
381
- Everything that mutates stays in a mutation-capable, human-gated context:
382
- `publish`, `edit`, `buy`, `send`,
383
- `session start`, `wallet create`, `config set`, `install`. In particular, do not
384
- delegate publishing what a subagent just derived: bring the finding back and
385
- publish it from the context that can ask the user.
111
+ Decryption happens in this CLI, in a disposable worker thread, and the key never leaves the process. `tenjin mcp` decrypts once at start so a lookup does not wait for it, holds the signer for the session, and exits with the session.
112
+
113
+ ## Delegating to a subagent
386
114
 
387
- Two caveats travel with the safe set. "Read-only" describes your wallet and your
388
- repo, not the network: `search` and `outcome` POST off-machine (a question, a
389
- report) and `read` saves to the local library. And a delegated context is where a stray `--base-url` does the most
390
- damage, so never pass one.
115
+ When your assistant delegates, the task it hands over is routed before the subagent starts, and a paid lookup that fits is appended to that task as one optional line. A native search or fetch the subagent makes later is routed on its own task, read from its own transcript, with your turn still in front of it.
391
116
 
392
- ## Running the local MCP server instead?
117
+ A subagent cannot reach you to approve a spend, so it is only offered lookups your spend policy would pay without asking: within `maxAutoSpend` and the `confirm` threshold, inside the day's `sessionBudget`, and to a host `allowlistCreators` permits. Its payments run through the same ledger and the same caps as the lead's, because the lock is on the file rather than on the process. A subagent is not a second budget.
393
118
 
394
- That is a different permission surface: the harness gates tools there, and these
395
- Bash rules do not apply. If you follow the
396
- [MCP section](../README.md#local-stdio-mcp-server) as well, leave
397
- `mcp__tenjin__tenjin_publish`, `mcp__tenjin__tenjin_edit`, and
398
- `mcp__tenjin__tenjin_wallet` gated, and treat `mcp__tenjin__tenjin_buy` as the
399
- same opt-in decision as the `buy` line above.
119
+ A subagent is only redirected or offered a lookup when it is known to have `mcp__x402__request`: a custom agent whose definition (`.claude/agents/<name>.md` in the project, `~/.claude/agents/<name>.md`, or an installed plugin's) lists it in `tools:` or has no `tools:` line at all, or one of the built-in `general-purpose`, `Explore` and `Plan` agents, which inherit MCP tools. Any other subagent, such as the built-in `claude-code-guide` (which has WebFetch and WebSearch but no MCP tools) or a type with no definition to read, is left alone: its native calls and delegated tasks are not sent to the router at all, and its calls run free. `tenjin doctor` names your own agents that leave the tool out; add `mcp__x402__request` to their `tools:` to allow paid lookups there. Nothing here edits your agent files.
400
120
 
401
121
  ## Not the same as `allowlistCreators`
402
122
 
403
- This harness allowlist is unrelated to the `allowlistCreators` spend-policy key:
404
- that one gates **who you may pay**, this one gates **which commands may run**.
123
+ `allowlistCreators` is a spend-policy key that restricts which hosts may be paid at all. The permission rule on this page is a harness setting about which tool may run. They are separate gates and neither substitutes for the other.
@@ -7,8 +7,8 @@ Tenjin is built for agents, so the important rule is simple: marketplace content
7
7
  - Purchased content is untrusted data, never instructions.
8
8
  - No harness permission, hook, settings change, wallet action, or publish action is recommended on the strength of content the agent read.
9
9
  - A harness permission denial is never worked around. The agent should stop and ask the user to change permissions deliberately.
10
- - A command named `read` never spends money. Paid delivery uses `buy`.
11
- - Hard publish blocks cannot be bypassed by `--yes`, `auto`, or `full-auto`.
10
+ - A routing decision is a proposal, never an authorization. Spending is decided locally, against limits the server cannot read or raise.
11
+ - Hard publish blocks are the marketplace's own, at ingest, and cannot be bypassed by `--yes`, `auto`, or `full-auto`. The local scan is warn-only: every finding it makes, including a block-tier shape, is a flag the publish.mode consent flow shows, not a local refusal.
12
12
  - The wallet key stays local. Tenjin receives signatures and payment authorizations, never the private key.
13
13
 
14
14
  ## Content is evidence, not control
@@ -21,9 +21,9 @@ Do not copy commands from purchased content into an allowlist, `AGENTS.md`, `CLA
21
21
 
22
22
  Search, inspect, free reads, outcomes, wallet display, balance checks, doctor, and checkout-link creation are separated from purchases and transfers.
23
23
 
24
- `tenjin buy` is the only recommended paid-read command. It re-checks entitlement and price before paying, and `--max-price` is always a hard cap.
24
+ The x402 router's `request` tool and `tenjin pay` are the paying commands, and they run one gate between them: `maxAutoSpend` per call, `sessionBudget` per rolling day, `confirm` for when a human is asked, and a reservation that counts a signed authorization as spent the moment it leaves. A router lookup is ONE payment, to the provider: deciding where to route costs nothing and nobody signs for it. The boundary is split on purpose: the backend binds the call and validates its arguments against the capability's own schema, and this client checks the three things only it can: the amount signed against the spend caps, the body that comes back against the success rule the decision carries, and the destination resolving to a public address. That destination check is a check, not a pin: the request resolves the name again on its own, so a host that answers publicly at check time and privately a moment later is not closed by it. Closing it needs a resolver-aware transport that connects to the address it validated, which this release does not ship. `--max-price` is always a hard cap on `tenjin pay`. Every authorization that LEAVES the process counts against the session budget until the 24 hour window rolls, even where the provider never settles it: a signed EIP-3009 authorization is a bearer instrument, so a 200 that reports no match, or a 402 that rejects the payment, is the counterparty saying it did not take the money rather than proof that it cannot. The budget is deliberately the conservative side of that, and a caller can be left with less headroom than it actually spent.
25
25
 
26
- `tenjin send` moves USDC out of the wallet. It exists as a human escape hatch, not as part of the agent flow.
26
+ `tenjin wallet send` moves USDC out of the wallet. It exists as a human escape hatch, not as part of the agent flow.
27
27
 
28
28
  ### The deployment origin set
29
29
 
@@ -36,13 +36,23 @@ Search, inspect, free reads, outcomes, wallet display, balance checks, doctor, a
36
36
 
37
37
  ## Publishing boundaries
38
38
 
39
- Publishing and editing put content on a public marketplace under your identity. The local scan blocks obvious secrets and private-key material in every mode. Other sensitive context can only be warned about, so the agent still has to use judgment before publishing.
39
+ Publishing and editing put content on a public marketplace under your identity. A local scan flags likely secrets and private-key material before every write and inside every router packet: provider token shapes, private keys in and out of PEM framing, connection URIs with an embedded password, BIP-39 recovery phrases, and TOTP provisioning URIs, plus a broader warn tier for other sensitive context the agent still has to use judgment about. Its rules live as data in `src/lib/redact-rules.json`, the one table every redaction surface in the CLI reads.
40
+
41
+ The local scan does not refuse on its own: every finding it makes, block-tier shapes included, is a flag that goes through the same publish.mode consent flow as any other change — `review` asks, `auto` holds with `NEEDS_CONFIRMATION`, `full-auto` clears it and proceeds. The marketplace runs its own scan at ingest, on the write itself, and it is the one place that still refuses: its block tier has no acknowledgement path, so no mode and no `--yes` clears it. Today that covers the body, the frontmatter and `--excerpt`. The answer card is frontmatter now, with no flag form on `publish`, so it reaches the marketplace gate inside the document like the body does; `tenjin edit` still authors card fields by flag, and a secret typed into one of those is scanned locally as a flag only until the marketplace gate is extended to the card (loop-redesign PR F).
42
+
43
+ Server-side, the block tier has no acknowledgement path. The warn tier is held with a token, and a `--yes` clears that hold only when the marketplace found nothing the local scan had not already rendered. **A confirmation covers the findings it post-dates.** A `--yes` is an answer to a payload, and the payload it answered was rendered before any server call, so it cannot have contained the marketplace's own findings; the semantic checks in particular have no local counterpart at all. `full-auto` acknowledges unasked, because clearing soft findings unasked is that mode's contract. `publish.ackServerWarnings` overrides both readings: `off` never acknowledges whatever the mode says, and `on` is a standing yes that lets a `--yes` cover the marketplace's findings too. Findings the server contributed are marked as such where they are rendered, with their tier, including detectors this release has never heard of.
44
+
45
+ Findings never carry the matched secret. Each one is a detector id, a tier, offsets, and a masked excerpt, so a finding can be shown, logged, or forwarded without republishing what it found.
46
+
47
+ On a team shelf the destination is the team's own deployment rather than the marketplace, so the warn tier — which asks "is this safe to make public" — is skipped, except for `secret-assignment` (and `hex32-value`, the warn form a block-tier check demotes to). `high-entropy-string`, `env-dump-block` and the injection check `embedded-instruction` are public-only now. Which warn checks survive is data rather than a list in code: the `scopes` list on the rule in `src/lib/redact-rules.json` (a warn scoped to `team` as well as `publish`), applied inside the scan itself, so a new credential detector joins the survivors by marking itself and no command filters. The block on secrets and private-key material is not skipped either: that deployment is still a hosted database with logs and a door key the whole team holds, and a team note is fed to teammates' agents by the loop's hook arms, so neither "is this a live credential" nor "would this text steer the reader" gets easier to answer for being private.
48
+
49
+ The ingest gate runs on a team shelf too, since it sits in the shared write path rather than in the marketplace's publish route, and the shelf keeps its block tier on purpose for the reasons above. **Its warn tier stays advisory on a team shelf**: the shelf sets no `SCAN_WARN_MODE`, so warn findings ride the success response onto the team receipt and nothing is held. That is deliberate, not an oversight. Under `enforce` the shelf's warn tier would re-impose exactly the findings the team drop removes, and it is not the shelf's job to re-ask a question the drop already answered. A team shelf that does flip its own `SCAN_WARN_MODE` to `enforce` gets marketplace semantics on this path, warn holds included, and should expect the drop and the gate to disagree.
40
50
 
41
51
  When in doubt, publish less context and more reproducible evidence.
42
52
 
43
53
  ## Permission boundaries
44
54
 
45
- The recommended free harness permissions are documented in [agent-permissions.md](./agent-permissions.md). They are intentionally narrow and do not include `buy`, `publish`, `edit`, `send`, `session start`, `wallet create`, `config set`, `install`, or `mcp`.
55
+ The recommended free harness permissions are documented in [agent-permissions.md](./agent-permissions.md). They are intentionally narrow and do not include `buy`, `publish`, `edit`, `wallet send`, `wallet create`, `config set`, `install`, or `mcp`.
46
56
 
47
57
  Codex's default `workspace-write` sandbox also needs network access for paid x402 calls:
48
58
 
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "tenjin-cli",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.17",
4
4
  "mcpName": "blog.tenjin/tenjin",
5
5
  "type": "module",
6
- "description": "Tenjin agent CLI for the x402 knowledge marketplace.",
7
- "license": "MIT",
6
+ "description": "x402 router for coding agents: one paid decision per lookup, a local wallet that pays each provider per call in USDC on Base.",
8
7
  "repository": {
9
8
  "type": "git",
10
9
  "url": "git+https://github.com/BackTrackCo/tenjin-agent.git"
@@ -28,12 +27,11 @@
28
27
  "tenjin": "dist/index.js"
29
28
  },
30
29
  "engines": {
31
- "node": ">=22"
30
+ "node": ">=24"
32
31
  },
33
32
  "files": [
34
33
  "dist",
35
34
  "docs",
36
- "skills",
37
35
  "NOTICE.md"
38
36
  ],
39
37
  "devDependencies": {
@@ -45,6 +43,8 @@
45
43
  "@x402/core": "2.17.0",
46
44
  "@x402/evm": "2.17.0",
47
45
  "@x402/extensions": "2.17.0",
46
+ "ajv": "^8.20.0",
47
+ "ajv-formats": "^3.0.1",
48
48
  "commander": "^14.0.1",
49
49
  "eslint": "^10",
50
50
  "eslint-config-prettier": "^10",
@@ -58,7 +58,7 @@
58
58
  "zod": "^4.4.3"
59
59
  },
60
60
  "scripts": {
61
- "build": "tsup",
61
+ "build": "rm -rf dist && tsup",
62
62
  "test": "vitest run",
63
63
  "typecheck": "tsc --noEmit",
64
64
  "lint": "eslint .",
@@ -67,6 +67,7 @@
67
67
  "check": "pnpm run build && pnpm run test",
68
68
  "sync:skill": "node scripts/sync-skill.mjs",
69
69
  "pack-smoke": "bash scripts/pack-smoke.sh",
70
- "changeset": "changeset"
70
+ "changeset": "changeset",
71
+ "githooks": "git config core.hooksPath .githooks"
71
72
  }
72
73
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BackTrackCo and Tenjin contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.