tenjin-cli 0.1.0-alpha.2 → 0.1.0-alpha.20
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.
- package/NOTICE.md +54 -7
- package/README.md +161 -257
- package/dist/{_esm-FEASBWRP.js → _esm-CE7KNONL.js} +9 -10
- package/dist/{ccip-NQXCEK2U.js → ccip-7RMRLAGV.js} +4 -4
- package/dist/{ccip-XR5NE5QK.js → ccip-NLCSCHKI.js} +5 -5
- package/dist/chunk-2E6GVIRP.js +888 -0
- package/dist/chunk-2E6GVIRP.js.map +1 -0
- package/dist/chunk-2G2WLVHB.js +102 -0
- package/dist/chunk-2G2WLVHB.js.map +1 -0
- package/dist/chunk-2QYORQBF.js +55 -0
- package/dist/chunk-2QYORQBF.js.map +1 -0
- package/dist/chunk-3BS55ANY.js +245 -0
- package/dist/chunk-3BS55ANY.js.map +1 -0
- package/dist/chunk-3KKKB2AQ.js +40 -0
- package/dist/chunk-3KKKB2AQ.js.map +1 -0
- package/dist/chunk-4AS52HUG.js +165 -0
- package/dist/chunk-4AS52HUG.js.map +1 -0
- package/dist/chunk-4M5FBWT5.js +368 -0
- package/dist/chunk-4M5FBWT5.js.map +1 -0
- package/dist/chunk-5FYKPQNX.js +1784 -0
- package/dist/chunk-5FYKPQNX.js.map +1 -0
- package/dist/{chunk-ZMHYXMO6.js → chunk-5IEP5EGE.js} +3 -3
- package/dist/chunk-5KD5HRAJ.js +241 -0
- package/dist/chunk-5KD5HRAJ.js.map +1 -0
- package/dist/chunk-72UHZRG6.js +231 -0
- package/dist/chunk-72UHZRG6.js.map +1 -0
- package/dist/chunk-7ACHDNJA.js +155 -0
- package/dist/chunk-7ACHDNJA.js.map +1 -0
- package/dist/chunk-7QKHZQKW.js +1680 -0
- package/dist/chunk-7QKHZQKW.js.map +1 -0
- package/dist/chunk-A36LQPHV.js +29 -0
- package/dist/chunk-A36LQPHV.js.map +1 -0
- package/dist/{chunk-UGX7YPX2.js → chunk-AWQPGIR6.js} +7 -9
- package/dist/{chunk-UGX7YPX2.js.map → chunk-AWQPGIR6.js.map} +1 -1
- package/dist/{chunk-5CLSD5YN.js → chunk-BPMWXTFX.js} +2 -2
- package/dist/{chunk-XJIW7USF.js → chunk-BTX2QE2Y.js} +115 -11
- package/dist/chunk-BTX2QE2Y.js.map +1 -0
- package/dist/{chunk-OYMYCW7J.js → chunk-CCDOV45D.js} +588 -97
- package/dist/chunk-CCDOV45D.js.map +1 -0
- package/dist/chunk-CXUYCDPX.js +127 -0
- package/dist/chunk-CXUYCDPX.js.map +1 -0
- package/dist/{chunk-YALGASEU.js → chunk-EGELTSPU.js} +2 -2
- package/dist/chunk-HH3PDYIG.js +194 -0
- package/dist/chunk-HH3PDYIG.js.map +1 -0
- package/dist/{chunk-CYOF7ROH.js → chunk-HPWO4O6S.js} +3 -3
- package/dist/chunk-JLEF5WHM.js +132 -0
- package/dist/chunk-JLEF5WHM.js.map +1 -0
- package/dist/{chunk-QVX5MWJZ.js → chunk-JRGFKVAZ.js} +2 -2
- package/dist/{chunk-HIVZG55D.js → chunk-KG3D7FIF.js} +2 -2
- package/dist/chunk-LHHMV4GU.js +27 -0
- package/dist/chunk-LHHMV4GU.js.map +1 -0
- package/dist/chunk-LI44XLMB.js +242 -0
- package/dist/chunk-LI44XLMB.js.map +1 -0
- package/dist/chunk-LN2HISWU.js +172 -0
- package/dist/chunk-LN2HISWU.js.map +1 -0
- package/dist/{chunk-YBMMV4Y4.js → chunk-MEFB5KHA.js} +13 -5
- package/dist/chunk-MEFB5KHA.js.map +1 -0
- package/dist/{chunk-NCE5NSN6.js → chunk-N35E6CM2.js} +140 -10
- package/dist/chunk-N35E6CM2.js.map +1 -0
- package/dist/chunk-NSG5TVZQ.js +447 -0
- package/dist/chunk-NSG5TVZQ.js.map +1 -0
- package/dist/chunk-O2JYBOUO.js +47 -0
- package/dist/chunk-O2JYBOUO.js.map +1 -0
- package/dist/{chunk-N62ROTMC.js → chunk-P42QX3QF.js} +14 -10
- package/dist/chunk-P42QX3QF.js.map +1 -0
- package/dist/chunk-PO4HAXAW.js +10528 -0
- package/dist/chunk-PO4HAXAW.js.map +1 -0
- package/dist/{chunk-ZABPQJ3M.js → chunk-POUWHWID.js} +2 -2
- package/dist/{chunk-S3IGX57D.js → chunk-RGVOODF4.js} +7703 -7475
- package/dist/chunk-RGVOODF4.js.map +1 -0
- package/dist/chunk-RPR2C2JO.js +112 -0
- package/dist/chunk-RPR2C2JO.js.map +1 -0
- package/dist/chunk-S2NRVRPF.js +171 -0
- package/dist/chunk-S2NRVRPF.js.map +1 -0
- package/dist/chunk-TGLKKLQG.js +11 -0
- package/dist/chunk-TGLKKLQG.js.map +1 -0
- package/dist/{chunk-RRN3YTK7.js → chunk-TTNESUPQ.js} +3 -3
- package/dist/chunk-TU7XH3JJ.js +97 -0
- package/dist/chunk-TU7XH3JJ.js.map +1 -0
- package/dist/{chunk-HSDCI7OV.js → chunk-XZKD7DIF.js} +3 -3
- package/dist/{chunk-Z6MFJV5Z.js → chunk-YEBNE5NW.js} +851 -500
- package/dist/chunk-YEBNE5NW.js.map +1 -0
- package/dist/chunk-YREKMJPP.js +131 -0
- package/dist/chunk-YREKMJPP.js.map +1 -0
- package/dist/{cli-4NNBEQYH.js → cli-XJQYUOHI.js} +355 -217
- package/dist/cli-XJQYUOHI.js.map +1 -0
- package/dist/config-KMJLFPSI.js +39 -0
- package/dist/dist-3LOO6M4U.js +2842 -0
- package/dist/dist-3LOO6M4U.js.map +1 -0
- package/dist/doctor-KMN55D7U.js +444 -0
- package/dist/doctor-KMN55D7U.js.map +1 -0
- package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
- package/dist/fund-LT6ZPGEQ.js +298 -0
- package/dist/fund-LT6ZPGEQ.js.map +1 -0
- package/dist/hook-command-U5XPEHAJ.js +1052 -0
- package/dist/hook-command-U5XPEHAJ.js.map +1 -0
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/install-MMNXJ5LM.js +61 -0
- package/dist/install-identity-B7FVIWML.js +27 -0
- package/dist/install-wallet-XMVUBCHS.js +107 -0
- package/dist/install-wallet-XMVUBCHS.js.map +1 -0
- package/dist/mcp-TUPRIPSI.js +10000 -0
- package/dist/mcp-TUPRIPSI.js.map +1 -0
- package/dist/paths-LRMWNTJP.js +51 -0
- package/dist/pay-XAWW3NV3.js +44 -0
- package/dist/redact-6W23GGJC.js +15 -0
- package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-ZZZT2CAX.js} +3 -3
- package/dist/secp256k1-ZZZT2CAX.js.map +1 -0
- package/dist/send-HESQYRKM.js +225 -0
- package/dist/send-HESQYRKM.js.map +1 -0
- package/dist/status-ANZPRZJJ.js +71 -0
- package/dist/status-ANZPRZJJ.js.map +1 -0
- package/dist/status-line-J3TUWVRQ.js +87 -0
- package/dist/status-line-J3TUWVRQ.js.map +1 -0
- package/dist/status-line-wiring-HSV7DXO5.js +29 -0
- package/dist/status-line-wiring-HSV7DXO5.js.map +1 -0
- package/dist/tenjin-daemon.mjs +20547 -0
- package/dist/tenjin-shim.mjs +251 -0
- package/dist/tenjin-vitest-reporter.mjs +49 -0
- package/dist/uninstall-GUU34YKP.js +165 -0
- package/dist/uninstall-GUU34YKP.js.map +1 -0
- package/dist/update-KO2NZRJ5.js +433 -0
- package/dist/update-KO2NZRJ5.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
- package/dist/viemAdapter-By13KInL-X2VY6CY3.js.map +1 -0
- package/dist/wallet-3URC5QPK.js +33 -0
- package/dist/wallet-3URC5QPK.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +980 -0
- package/docs/agent-permissions.md +139 -0
- package/docs/safety-model.md +70 -0
- package/package.json +14 -9
- package/LICENSE +0 -21
- package/dist/buy-U35DQ6XM.js +0 -1598
- package/dist/buy-U35DQ6XM.js.map +0 -1
- package/dist/candidate-RLYCQMF5.js +0 -127
- package/dist/candidate-RLYCQMF5.js.map +0 -1
- package/dist/chunk-27ONARHV.js +0 -171
- package/dist/chunk-27ONARHV.js.map +0 -1
- package/dist/chunk-3OV7E5G5.js +0 -18
- package/dist/chunk-3OV7E5G5.js.map +0 -1
- package/dist/chunk-7KUW4MJD.js +0 -59
- package/dist/chunk-7KUW4MJD.js.map +0 -1
- package/dist/chunk-7PHSZKQS.js +0 -333
- package/dist/chunk-7PHSZKQS.js.map +0 -1
- package/dist/chunk-IYLHQMT5.js +0 -211
- package/dist/chunk-IYLHQMT5.js.map +0 -1
- package/dist/chunk-JPHG2JW3.js +0 -96
- package/dist/chunk-JPHG2JW3.js.map +0 -1
- package/dist/chunk-MUBUQVC3.js +0 -67
- package/dist/chunk-MUBUQVC3.js.map +0 -1
- package/dist/chunk-N62ROTMC.js.map +0 -1
- package/dist/chunk-NCE5NSN6.js.map +0 -1
- package/dist/chunk-OYMYCW7J.js.map +0 -1
- package/dist/chunk-QNP7H47L.js +0 -152
- package/dist/chunk-QNP7H47L.js.map +0 -1
- package/dist/chunk-RY4XKNV3.js +0 -140
- package/dist/chunk-RY4XKNV3.js.map +0 -1
- package/dist/chunk-S3IGX57D.js.map +0 -1
- package/dist/chunk-TFGSOPWR.js +0 -261
- package/dist/chunk-TFGSOPWR.js.map +0 -1
- package/dist/chunk-TLCMMYLY.js +0 -126
- package/dist/chunk-TLCMMYLY.js.map +0 -1
- package/dist/chunk-UO22YNY4.js +0 -69
- package/dist/chunk-UO22YNY4.js.map +0 -1
- package/dist/chunk-UPIEAMGH.js +0 -160
- package/dist/chunk-UPIEAMGH.js.map +0 -1
- package/dist/chunk-XJIW7USF.js.map +0 -1
- package/dist/chunk-YBMMV4Y4.js.map +0 -1
- package/dist/chunk-YIYQ2ZNT.js +0 -286
- package/dist/chunk-YIYQ2ZNT.js.map +0 -1
- package/dist/chunk-YN5SHIXQ.js +0 -126
- package/dist/chunk-YN5SHIXQ.js.map +0 -1
- package/dist/chunk-Z52RA3NC.js +0 -137
- package/dist/chunk-Z52RA3NC.js.map +0 -1
- package/dist/chunk-Z6MFJV5Z.js.map +0 -1
- package/dist/cli-4NNBEQYH.js.map +0 -1
- package/dist/config-2VSXWWHK.js +0 -21
- package/dist/doctor-JJPNIBYH.js +0 -20
- package/dist/inspect-JGYJWFDP.js +0 -96
- package/dist/inspect-JGYJWFDP.js.map +0 -1
- package/dist/install-ZQRMSRGW.js +0 -378
- package/dist/install-ZQRMSRGW.js.map +0 -1
- package/dist/lookup-WYVTOMVY.js +0 -113
- package/dist/lookup-WYVTOMVY.js.map +0 -1
- package/dist/outcome-HKKT6QIA.js +0 -66
- package/dist/outcome-HKKT6QIA.js.map +0 -1
- package/dist/publish-D76B3MBK.js +0 -1480
- package/dist/publish-D76B3MBK.js.map +0 -1
- package/dist/usdc-JIAJW4SV.js +0 -22
- package/dist/wallet-6QKS6UHW.js +0 -179
- package/dist/wallet-6QKS6UHW.js.map +0 -1
- package/dist/wallet-PA54CRBL.js +0 -30
- package/skills/tenjin/SKILL.md +0 -199
- package/skills/tenjin-publish/SKILL.md +0 -96
- package/skills/tenjin-search/SKILL.md +0 -122
- /package/dist/{_esm-FEASBWRP.js.map → _esm-CE7KNONL.js.map} +0 -0
- /package/dist/{ccip-NQXCEK2U.js.map → ccip-7RMRLAGV.js.map} +0 -0
- /package/dist/{ccip-XR5NE5QK.js.map → ccip-NLCSCHKI.js.map} +0 -0
- /package/dist/{chunk-ZMHYXMO6.js.map → chunk-5IEP5EGE.js.map} +0 -0
- /package/dist/{chunk-5CLSD5YN.js.map → chunk-BPMWXTFX.js.map} +0 -0
- /package/dist/{chunk-YALGASEU.js.map → chunk-EGELTSPU.js.map} +0 -0
- /package/dist/{chunk-CYOF7ROH.js.map → chunk-HPWO4O6S.js.map} +0 -0
- /package/dist/{chunk-QVX5MWJZ.js.map → chunk-JRGFKVAZ.js.map} +0 -0
- /package/dist/{chunk-HIVZG55D.js.map → chunk-KG3D7FIF.js.map} +0 -0
- /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POUWHWID.js.map} +0 -0
- /package/dist/{chunk-RRN3YTK7.js.map → chunk-TTNESUPQ.js.map} +0 -0
- /package/dist/{chunk-HSDCI7OV.js.map → chunk-XZKD7DIF.js.map} +0 -0
- /package/dist/{config-2VSXWWHK.js.map → config-KMJLFPSI.js.map} +0 -0
- /package/dist/{doctor-JJPNIBYH.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → install-MMNXJ5LM.js.map} +0 -0
- /package/dist/{secp256k1-N3ZHU7LB.js.map → install-identity-B7FVIWML.js.map} +0 -0
- /package/dist/{usdc-JIAJW4SV.js.map → paths-LRMWNTJP.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → pay-XAWW3NV3.js.map} +0 -0
- /package/dist/{wallet-PA54CRBL.js.map → redact-6W23GGJC.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/redact.ts","../src/lib/redact-rules.json","../src/lib/bip39-wordlist.json"],"sourcesContent":["/**\n * The one redaction module: every surface that decides what text may leave\n * this machine reads the same rule table (`redact-rules.json`) through this\n * file. Two verbs over one table, and the audience is a parameter:\n *\n * `findings(text, scope)` is the deterministic, offline publish scan. Pure:\n * identical input yields an identical `Finding[]`, no network and no model\n * call. It REPORTS, it never rewrites: every finding is a detector id, a tier,\n * offsets and a masked excerpt that never carries the matched secret. Locally\n * a finding is a flag the consent flow shows the agent, which fixes the text or\n * overrides with `--yes`; the server's ingest gate is the one place that\n * refuses (vendor tokens, private keys, seed phrases, DB passwords, bearer\n * headers). `publish` is the marketplace and reports every row; `team` is the\n * team shelf and reports only the rows whose `scopes` include it. WHICH rows\n * is data on the rule, never a list in a caller.\n *\n * `mask(text)` is the query-side verb: for the rows scoped `query` it replaces\n * each match with that row's excerpt (`ghp_…[redacted 36 chars]`,\n * `postgres://app:[redacted]@host`, `PGPASSWORD=[redacted 7 chars]`,\n * `0x…[redacted 64 chars]`) and touches nothing else. The regex rows run\n * first, then the hex-key, PEM and seed-phrase algorithms. Precision first,\n * the way gitleaks and GitHub push protection work: a vendor prefix fires on\n * format alone, the generic assignment rule needs a secret-named word plus `=`\n * or `:`, and entropy is never a trigger. Paths, hosts, IPs, commit SHAs, env\n * names and prose are never touched; a long mixed token in a URL path is\n * (owner policy, tenjin-agent#197 and the 2026-09-04 decision in\n * tenjin-notes/loop-redesign/06-pr-a-redact.md: search availability over\n * scrubbing; measured, the old scrub altered 16% of real prompts to stop two\n * vendor tokens).\n *\n * Two invariants, pinned by redact.fixtures.test.ts and redact.test.ts:\n *\n * REDACTION: a `block` excerpt is masked — a type-identifying prefix plus a\n * redaction count, never the matched secret. `pem-private-key` is the one\n * exception, its excerpt being the armor header. Secret-shaped warns\n * (secret-assignment, customer-identifier, high-entropy-string) are masked too.\n *\n * ReDoS: no pattern may contain a quantified group whose body can also match the\n * group's own separator while a further obligation follows it. Audited against a\n * single line of hundreds of kilobytes, the shape a JSONL transcript record takes.\n *\n * The rule corpus lives as DATA in `redact-rules.json` so the tenjin server-side\n * ingest gate can vendor it verbatim; this file compiles that data and\n * implements the handlers and algorithmic detectors it names. Per-rule\n * attribution is in the data file's `source` field and in NOTICE.md. No pattern\n * set is a runtime dependency: this is a wallet-holding CLI, kept offline with a\n * tight dep tree by design.\n */\n\nimport { createHash } from 'node:crypto';\nimport corpusJson from './redact-rules.json';\nimport wordlistJson from './bip39-wordlist.json';\n\n/** Where a rule applies: masked in hook queries, reported on the public\n * marketplace, reported on a team shelf. A row may carry any combination. */\nexport type Scope = 'query' | 'publish' | 'team';\n/** The audiences `findings()` reports for. */\nexport type ReportScope = Exclude<Scope, 'query'>;\n\nexport type FindingSeverity = 'block' | 'warn';\n\nexport interface Finding {\n /** Stable machine id for the detector, e.g. \"aws-access-key\". */\n check: string;\n severity: FindingSeverity;\n /** 1-based line number of the match (its start line, for multi-line matches). */\n line: number;\n /** [startColumn, endColumn) within `line`, 0-based (the start line for spans). */\n span: [number, number];\n /** Human-readable snippet; masked for every `block` finding. */\n excerpt: string;\n}\n\n/** Contiguous quoted/fenced runs at or above this word count read as copied. */\nconst LONG_QUOTE_WORDS = 80;\n\nexport function findings(text: string, scope: ReportScope): Finding[] {\n const lines = text.split('\\n');\n // EVERY detector runs whatever the scope, and the scope filters the RESULT.\n // The entropy catch-all suppresses itself against the spans the named\n // detectors claimed, and that set has to be the full one: a checksummed\n // wallet address is a publish-only warn, and on a team shelf it must stay\n // silent rather than resurface as high-entropy-string because the detector\n // that knows what it is was switched off.\n const found: Finding[] = [\n ...scanHex64(lines),\n ...scanLineDetectors(lines),\n ...scanPemBlocks(lines),\n ...scanSeedPhrases(lines),\n ...scanEnvDumpBlocks(lines),\n ...scanLongVerbatim(lines),\n ];\n const named = dedupeAndSort(suppressEmailsInDbUris(found));\n const all = dedupeAndSort([...named, ...scanHighEntropy(lines, named)]);\n if (scope === 'publish') return all;\n // Filtered by the EMITTING rule's scopes, never by a list of check names:\n // `checksFor` maps an emitted check (hex32-value) through the rule it comes\n // from, so dropping `team` from a rule's scopes drops everything it emits.\n const keep = CHECKS[scope];\n return all.filter((f) => keep.has(f.check));\n}\n\n/**\n * Replace every match of a `query`-scoped row with that row's masked excerpt.\n * Nothing else changes: no deletion, no squash, no bound. The `skip` handlers\n * apply exactly as they do for `findings()`, so a placeholder or a `$VAR`\n * value is left as written.\n */\nexport function mask(text: string): string {\n // C0 bytes are deleted first (whitespace kept): a control byte inside a name\n // is a splitter, `api_key<0x01>=hunter2` reads as two tokens to every row\n // below, and the hooks' clean() only removes it after the mask has decided.\n // eslint-disable-next-line no-control-regex\n let out = text.replace(/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/g, '');\n // Table order is mask order: the assignment row is first so a value that is\n // itself a vendor token is taken whole, name kept, and no later row sees a\n // stub to re-match.\n for (const detector of MASK_DETECTORS) {\n out = out.replace(detector.re, (...args: unknown[]) => {\n // replace() hands (match, ...groups, offset, input[, named groups]).\n // Rebuilt as an exec array so a skip can read the text around its match.\n const tail = typeof args.at(-1) === 'object' ? 3 : 2;\n const m = Object.assign(args.slice(0, -tail), {\n index: args.at(-tail) as number,\n input: args.at(-tail + 1) as string,\n }) as unknown as RegExpExecArray;\n return detector.skip?.(m) === true ? m[0] : detector.excerpt(m);\n });\n }\n // The algorithm rows after the regex pass, through the same scanners\n // findings() runs, so a key the publish scan blocks is a key the packet\n // never carries. A value the regex pass already masked no longer matches.\n if (MASKED_ALGORITHMS.has('hex64') || MASKED_ALGORITHMS.has('bip39')) {\n out = out.split('\\n').map(maskLineSpans).join('\\n');\n }\n if (MASKED_ALGORITHMS.has('bip39')) out = maskLooseMnemonics(out);\n return MASKED_ALGORITHMS.has('pemBlock') ? maskPemBlocks(out) : out;\n}\n\n/**\n * One line's hex and seed-phrase spans, each replaced by its finding's\n * excerpt. Built in one left-to-right pass rather than a splice per span: a\n * transcript line can carry thousands of keys. A `hex32-value` is a hash, not\n * a key, and stays as written.\n *\n * A wordlist run longer than the longest recovery phrase is not masked here:\n * a run of common words that long is text a routing decision reads (a repeated\n * word, a pasted list). {@link maskLooseMnemonics} masks any phrase inside it.\n * The publish scan reports the whole run either way.\n */\nfunction maskLineSpans(line: string): string {\n const lines = [line];\n const spans = [\n ...(MASKED_ALGORITHMS.has('hex64') ? scanHex64(lines) : []),\n ...(MASKED_ALGORITHMS.has('bip39') ? scanSeedPhrases(lines) : []),\n ]\n .filter((f) => f.check !== 'hex32-value')\n .filter(\n (f) =>\n f.check !== 'bip39-seed-phrase' ||\n line.slice(f.span[0], f.span[1]).split(/[\\s\"'`]+/).length <= SEED_PHRASE_MAX_WORDS,\n )\n .sort((a, b) => a.span[0] - b.span[0]);\n if (spans.length === 0) return line;\n const parts: string[] = [];\n let cursor = 0;\n for (const f of spans) {\n if (f.span[0] < cursor) continue;\n parts.push(line.slice(cursor, f.span[0]), f.excerpt);\n cursor = f.span[1];\n }\n parts.push(line.slice(cursor));\n return parts.join('');\n}\n\n/**\n * A PEM private key from its BEGIN marker through its END marker, or to the\n * end of the text when the paste has no END line. The armor header is kept as\n * the type marker; everything after it is key material and goes.\n */\nfunction maskPemBlocks(text: string): string {\n let out = '';\n let rest = text;\n for (;;) {\n const begin = PEM_BEGIN.exec(rest);\n if (begin === null) return out + rest;\n const body = begin.index + begin[0].length;\n const end = PEM_END.exec(rest.slice(body));\n const stop = end === null ? rest.length : body + end.index + end[0].length;\n out += rest.slice(0, begin.index) + maskKeeping(rest.slice(begin.index, stop), begin[0].length);\n rest = rest.slice(stop);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Rule corpus: redact-rules.json compiled into executable detectors.\n// ---------------------------------------------------------------------------\n\ninterface RuleExcerpt {\n kind: string;\n keep?: number;\n max?: number;\n head?: number;\n tail?: number;\n handler?: string;\n}\n\ninterface Rule {\n id: string;\n tier: string;\n scopes: string[];\n description: string;\n source: string;\n match: { kind: string; pattern?: string; flags?: string; algorithm?: string };\n excerpt: RuleExcerpt;\n /** Drop the match without a finding (e.g. a placeholder value). */\n skip?: { handler: string };\n}\n\nconst SCOPES: ReadonlySet<string> = new Set(['query', 'publish', 'team']);\n\nconst CORPUS = corpusJson as unknown as {\n schemaVersion: number;\n rules: Rule[];\n publicHexConstants?: Array<{ value: string; name: string }>;\n};\n\n/** Algorithmic detectors this file implements; a corpus entry naming any other fails to compile. */\nconst ALGORITHMS = new Set(['hex64', 'pemBlock', 'bip39', 'envDump', 'entropy', 'longVerbatim']);\n/** The algorithms `mask()` can apply. A `query` row naming any other fails to compile. */\nconst MASKABLE_ALGORITHMS: ReadonlySet<string> = new Set(['hex64', 'pemBlock', 'bip39']);\n\nconst EXCERPT_HANDLERS: Record<string, (m: RegExpExecArray) => string> = {\n googleKey: (m) => maskKeeping(m[0], m[0].startsWith('AIza') ? 4 : 7),\n dbConnectionUri: (m) => `${m[1]}://${m[2]}:[redacted]@${m[4]}`,\n bearerToken: (m) => `Authorization: Bearer [redacted ${m[1]?.length ?? 0} chars]`,\n labeledValue: (m) => `${m[1]}=[redacted ${dequote(m[2] ?? '').length} chars]`,\n localPath: localPathExcerpt,\n};\n\nconst SKIP_HANDLERS: Record<string, (m: RegExpExecArray) => boolean> = {\n exampleDbPassword: (m) => isPlaceholder(m[3] ?? '') || isExamplePassword(m[3] ?? ''),\n placeholderGroup1: (m) => isPlaceholder(m[1] ?? ''),\n nonLiteralValue: skipNonLiteralValue,\n placeholderUsername: (m) => PLACEHOLDER_USERNAME.test(m[1] ?? m[2] ?? ''),\n reservedExampleEmail: (m) => RESERVED_EXAMPLE_DOMAIN.test(m[0]),\n hashLabelled: isLabelledHash,\n};\n\ninterface LineDetector {\n check: string;\n severity: FindingSeverity;\n scopes: ReadonlySet<string>;\n /** Global regex; `lastIndex` is reset per line. */\n re: RegExp;\n /** Build the (possibly masked) excerpt from a single match. */\n excerpt: (m: RegExpExecArray) => string;\n /** Drop this match without a finding (e.g. a placeholder value). */\n skip?: (m: RegExpExecArray) => boolean;\n}\n\n/**\n * Compile the data corpus. Throws rather than degrading: a corpus entry naming a\n * handler this build does not implement is a vendoring mistake, and a scan that\n * silently drops a block-tier detector is worse than one that refuses to start.\n */\nfunction validateScopes(rule: Rule): void {\n if (!Array.isArray(rule.scopes) || rule.scopes.length === 0) {\n throw new Error(`redact-rules.json: rule ${rule.id} has no scopes`);\n }\n for (const scope of rule.scopes) {\n if (!SCOPES.has(scope))\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown scope ${scope}`);\n }\n if (rule.tier !== 'block' && rule.tier !== 'warn') {\n throw new Error(`redact-rules.json: rule ${rule.id} has unknown tier ${String(rule.tier)}`);\n }\n if (!rule.scopes.includes('publish')) {\n throw new Error(`redact-rules.json: rule ${rule.id} reports for team but not publish`);\n }\n // The block tier is reported on every shelf; the server refuses on it.\n if (rule.tier === 'block' && !rule.scopes.includes('team')) {\n throw new Error(`redact-rules.json: block rule ${rule.id} must be scoped to team as well`);\n }\n const maskable =\n rule.match.kind === 'regex' ||\n (rule.match.kind === 'algorithm' && MASKABLE_ALGORITHMS.has(rule.match.algorithm ?? ''));\n if (rule.scopes.includes('query') && !maskable) {\n throw new Error(\n `redact-rules.json: rule ${rule.id} is masked in queries but mask() cannot apply it`,\n );\n }\n}\n\nfunction compileSkip(rule: Rule): ((m: RegExpExecArray) => boolean) | undefined {\n const skip = rule.skip === undefined ? undefined : SKIP_HANDLERS[rule.skip.handler];\n if (rule.skip !== undefined && skip === undefined) {\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown skip ${rule.skip.handler}`);\n }\n return skip;\n}\n\nfunction compileRegex(rule: Rule): RegExp {\n if (rule.match.kind !== 'regex' || rule.match.pattern === undefined) {\n throw new Error(`redact-rules.json: rule ${rule.id} has unknown match kind ${rule.match.kind}`);\n }\n return new RegExp(rule.match.pattern, rule.match.flags ?? 'g');\n}\n\nfunction compileLineDetectors(rules: Rule[]): LineDetector[] {\n const out: LineDetector[] = [];\n for (const rule of rules) {\n if (rule.match.kind === 'algorithm') continue;\n out.push({\n check: rule.id,\n severity: rule.tier as FindingSeverity,\n scopes: new Set(rule.scopes),\n re: compileRegex(rule),\n excerpt: compileExcerpt(rule),\n skip: compileSkip(rule),\n });\n }\n return out;\n}\n\n/**\n * Validate every row once, whatever scope asks first. Throws rather than\n * degrading: a corpus entry naming a handler this build does not implement is\n * a vendoring mistake, and a scan that silently drops a block-tier detector is\n * worse than one that refuses to start.\n */\nfunction validateCorpus(rules: Rule[]): void {\n for (const rule of rules) {\n validateScopes(rule);\n if (rule.match.kind === 'algorithm') {\n if (!ALGORITHMS.has(rule.match.algorithm ?? '')) {\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown algorithm`);\n }\n continue;\n }\n compileRegex(rule);\n }\n // The converse: every algorithm this file implements has exactly one row,\n // because the row's scopes are what let its findings through. A deleted\n // bip39 row would otherwise turn the seed-phrase block into silence.\n for (const algorithm of ALGORITHMS) {\n const rows = rules.filter(\n (r) => r.match.kind === 'algorithm' && r.match.algorithm === algorithm,\n );\n if (rows.length !== 1) {\n throw new Error(\n `redact-rules.json: algorithm ${algorithm} has ${rows.length} rows, needs exactly one`,\n );\n }\n }\n}\n\nfunction compileExcerpt(rule: Rule): (m: RegExpExecArray) => string {\n const policy = rule.excerpt;\n switch (policy.kind) {\n case 'mask': {\n const keep = policy.keep ?? 0;\n return (m) => maskKeeping(m[0], keep);\n }\n case 'verbatim': {\n const max = policy.max;\n return (m) => (max === undefined ? m[0] : truncate(m[0], max));\n }\n case 'abbreviate': {\n const head = policy.head ?? 6;\n const tail = policy.tail ?? 4;\n return (m) => `${m[0].slice(0, head)}…${m[0].slice(-tail)}`;\n }\n case 'custom': {\n const handler = EXCERPT_HANDLERS[policy.handler ?? ''];\n if (handler === undefined) {\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown excerpt handler`);\n }\n return handler;\n }\n default:\n throw new Error(`redact-rules.json: rule ${rule.id} has unknown excerpt kind ${policy.kind}`);\n }\n}\n\nvalidateCorpus(CORPUS.rules);\nconst LINE_DETECTORS: LineDetector[] = compileLineDetectors(CORPUS.rules);\nconst MASK_DETECTORS: LineDetector[] = LINE_DETECTORS.filter((d) => d.scopes.has('query'));\n/** Which algorithm rows `mask()` applies is data on the row, like the regex rows. */\nconst MASKED_ALGORITHMS: ReadonlySet<string> = new Set(\n CORPUS.rules\n .filter((r) => r.match.kind === 'algorithm' && r.scopes.includes('query'))\n .map((r) => r.match.algorithm ?? ''),\n);\n\nfunction scanLineDetectors(lines: string[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n for (const detector of LINE_DETECTORS) {\n detector.re.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = detector.re.exec(line)) !== null) {\n if (!isSuppressedAsDocs(detector, m) && detector.skip?.(m) !== true) {\n out.push({\n check: detector.check,\n severity: detector.severity,\n line: i + 1,\n span: [m.index, m.index + m[0].length],\n excerpt: detector.excerpt(m),\n });\n }\n // Every detector pattern matches at least one character, so a global\n // exec() always advances lastIndex — no zero-width-match loop guard needed.\n }\n }\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Suppression: placeholders and reserved example values.\n// ---------------------------------------------------------------------------\n\n/**\n * A match that is documentation scaffolding, not a live value: a run of `x`\n * placeholders, an angle/brace template, or a `your…` label. It exists to cut\n * warn fatigue, because `<YOUR_KEY>`-shaped samples are what teach an operator\n * to stop reading findings.\n *\n * TIER ORDERING INVARIANT — this test is a SUBSTRING test over the whole match,\n * so it may only ever suppress a `warn`. A block finding is non-bypassable by\n * contract, and a substring rule hands the bypass to anyone whose secret merely\n * CONTAINS a placeholder shape: real passwords carry `<`, `>`, `{`, `}` and\n * letter runs, so `postgres://app:Str0ng<Pw>Value@prod-db/main` is a live\n * credential, not a docs sample. Block-tier suppression is per-detector only,\n * and is anchored to the captured secret VALUE (isPlaceholder via the\n * `exampleDbPassword` / `placeholderGroup1` handlers), never to a substring of\n * the match. Pinned by \"the block tier is non-bypassable\" in scan.test.ts.\n */\nconst DOCS_PLACEHOLDER =\n /x{6,}|<[^<>]*>|\\{\\{[^{}]*\\}\\}|\\byour[_-]?(?:key|token|secret|password)\\b/i;\n\nfunction isSuppressedAsDocs(detector: LineDetector, m: RegExpExecArray): boolean {\n return detector.severity === 'warn' && DOCS_PLACEHOLDER.test(m[0]);\n}\n\n// RFC 2606 reserved second-level domains. The reserved .example TLD is NOT\n// included: `alice@corp.example` is the shape a real internal address takes in a\n// sanitized draft, and the email detector is a warn the author should still see.\nconst RESERVED_EXAMPLE_DOMAIN = /@(?:[A-Za-z0-9-]+\\.)*example\\.(?:com|org|net)$/i;\n\n// A home-path username that is a docs placeholder, not a real machine username.\nconst PLACEHOLDER_USERNAME = /^(?:user(?:name)?|you(?:rname)?|example|foo|me|myuser|somebody)$/i;\n\n/**\n * A db-connection-uri already masks the embedded password; the email detector,\n * however, would match `password@host` and echo the password verbatim in its\n * excerpt. Drop any email finding whose span sits inside a db-connection-uri\n * span on the same line so the masking cannot be bypassed.\n */\nfunction suppressEmailsInDbUris(findings: Finding[]): Finding[] {\n const uris = findings.filter((f) => f.check === 'db-connection-uri');\n if (uris.length === 0) return findings;\n return findings.filter(\n (f) =>\n f.check !== 'email' ||\n !uris.some((u) => u.line === f.line && f.span[0] >= u.span[0] && f.span[1] <= u.span[1]),\n );\n}\n\n/**\n * Never echo more than a short, non-secret prefix. The kept prefix is a public\n * type marker (`0x`, `AKIA`, `ghp_`, …), never key material; the rest is dropped.\n */\nfunction maskKeeping(match: string, prefixLen: number): string {\n const prefix = match.slice(0, Math.min(prefixLen, match.length));\n return `${prefix}…[redacted ${match.length - prefix.length} chars]`;\n}\n\nfunction truncate(value: string, max: number): string {\n return value.length > max ? `${value.slice(0, max - 3)}…` : value;\n}\n\nfunction localPathExcerpt(m: RegExpExecArray): string {\n // Splice at the capture's own offsets (d-flag indices): a plain\n // String.replace masks the FIRST occurrence of the username, which for a\n // username that is a substring of the /Users|/home prefix mangles the prefix\n // and echoes the real username.\n const bounds = m.indices?.[1] ?? m.indices?.[2];\n const masked =\n bounds === undefined\n ? m[0]\n : `${m[0].slice(0, bounds[0] - m.index)}[user]${m[0].slice(bounds[1] - m.index)}`;\n return truncate(masked, 60);\n}\n\n// Accepted gaps (owner call, tracked): a mnemonic laid out in a numbered grid\n// (`1. abandon 2. ability` across many short lines) breaks the whitespace-only\n// word run bip39 needs and is NOT detected. An all-lowercase, digit-free literal\n// that is not a BIP-39 run (a diceware passphrase, e.g.\n// PASSWORD=correcthorsebatterystaple) still yields no finding — a dictionary-word\n// run is indistinguishable from prose. Headerless base64/DER private keys are\n// detected only for OpenSSH (its magic is base64-stable); other DER encodings are not.\n\n/**\n * Shared skip for labeled-value detectors (secret-assignment,\n * customer-identifier — one helper so the two cannot drift): drop a value that\n * is a placeholder, a structural path/URL/regex, or — when UNQUOTED only, a\n * quoted string is a literal — a code expression (config.clientSecret,\n * user.account_id, hashAndSalt(input), a bare lowercase identifier).\n */\nfunction skipNonLiteralValue(m: RegExpExecArray): boolean {\n const raw = m[2] ?? '';\n const value = dequote(raw);\n if (isPlaceholder(value) || isStructural(value)) return true;\n return raw === value && isCodeExpression(value);\n}\n\n/** Strip a single matching pair of surrounding quotes from a captured value. */\nfunction dequote(value: string): string {\n const m = /^\"([^\"]*)\"$|^'([^']*)'$/.exec(value);\n return m !== null ? (m[1] ?? m[2] ?? '') : value;\n}\n\n// Placeholder tokens must match the WHOLE value, never merely a prefix: an early\n// prefix-anchored version let real secrets through (mySecretP@ss123,\n// yourCompanyProdKey_abc123, exampleRealKey99) and, because isPlaceholder also\n// gates the block-tier bearer/db-uri detectors, that was a block bypass.\nconst PLACEHOLDER_WORD =\n /^(?:xxx+|example|example-value|placeholder|redacted|changeme|dummy|sample|todo|tbd|none|null|secret|test|\\*+|\\.{3,})$/i;\n// your-/my- style kebab or snake placeholders (your-api-key, my_secret,\n// your-key-here) — lowercase words only, so a camelCase/digit-bearing real value\n// (yourCompanyProdKey_abc123) is NOT treated as a placeholder.\nconst PLACEHOLDER_PREFIX = /^(?:your|my)[-_][a-z]+(?:[-_][a-z]+)*$/i;\n\n/** A secret-assignment value that is an obvious placeholder, not a live secret. */\nfunction isPlaceholder(value: string): boolean {\n if (/^[<${%]/.test(value)) return true; // <your-key>, ${VAR}, {{x}}, %ENV%\n return PLACEHOLDER_WORD.test(value) || PLACEHOLDER_PREFIX.test(value);\n}\n\n/**\n * A right-hand side that is code, not a literal secret: a member/property access\n * (user.password), a call (hashAndSalt(input)), or a bare lowercase/snake-case\n * identifier reference (password, db_password). Only applied to UNQUOTED values —\n * a quoted string is a literal. camelCase / digit-bearing tokens are NOT code\n * (they read as opaque secrets), so a real value still fires.\n */\nfunction isCodeExpression(value: string): boolean {\n // Trailing code punctuation the value capture drags in (process.env.KEY, ).\n const v = value.replace(/[,;]+$/, '');\n if (/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)+$/.test(v)) return true; // a.b.c\n if (/^[A-Za-z_$][\\w$.]*\\([^)]*\\)$/.test(v)) return true; // f(...)\n // A call truncated at a quoted arg by the value capture: os.environ.get(\n if (/\\($/.test(v)) return true;\n return /^[a-z_$][a-z_$]*$/.test(v); // bare lowercase identifier\n}\n\n/** A structural value (path, URL, or regex literal), not a literal secret. */\nfunction isStructural(value: string): boolean {\n return /^(?:\\.?\\.?\\/|~\\/|https?:\\/\\/|\\^)/.test(value);\n}\n\n// Well-known example/default DB passwords — a connection string using one is a\n// docs snippet, not a leaked credential.\nconst EXAMPLE_PASSWORDS = new Set([\n 'password',\n 'postgres',\n 'mysql',\n 'root',\n 'admin',\n 'changeme',\n 'example',\n 'secret',\n 'test',\n 'guest',\n 'toor',\n]);\n\n/** A db-connection-uri password that is an obvious example/default, not a secret. */\nfunction isExamplePassword(password: string): boolean {\n return EXAMPLE_PASSWORDS.has(password.toLowerCase());\n}\n\n// EVM raw private key (0x + 64 hex) vs. a 32-byte public value. On Base the two\n// are syntactically identical, and a block finding is permanently\n// non-bypassable, so a post quoting a hash, an identifier, or an event topic\n// must not be hard-blocked. A 64-hex demotes to the WARN 'hex32-value' when it\n// sits inside an http(s) URL token, when a hash/identifier label precedes it, or\n// when it is a known public constant. An unlabeled bare 64-hex stays a block\n// 'raw-private-key' (continuing the BlockRun-credited wallet-key scanner): that\n// is the floor, and demotion never silences, so a real key mislabeled `hash`\n// still surfaces for review.\n//\n// The label window is what a replay over 389 published posts (tenjin#723)\n// forced open: every block-tier hit in the live catalog was a public hex\n// constant, and each missed the old rule differently — `hash was 0x…` (a word\n// between label and value), `source_id = 0x…` (an id-class label), and the\n// ERC-20 Transfer topic0 (no label at all). Hence the wider label set, up to TWO\n// short intervening tokens, and the constants set. Two is the bound that keeps\n// the window honest: \"the hash of the private key is 0x…\" is four tokens out and\n// still blocks. The replay's last survivor was markdown: the catalog writes\n// ``hash was `0x…` ``, so the separator class carries backticks and quotes.\n//\n// Only the SEPARATOR classes are permissive. What counts as a LABEL is closed,\n// which is why `` PRIVATE_KEY=`0x…` `` still blocks: no punctuation tolerance\n// can invent a label that is not in the set.\nconst HEX64_RE = /(?<![0-9a-fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/gi;\nconst HASH_LABEL_RE =\n /(?:^|[^a-z0-9])(?:blockhash|txhash|txn|tx|hash|salt|id|topic\\d*|root|digest|commitment)(?:[\\s:=/,._'\"`‘’“”-]*[A-Za-z0-9_]{1,12}){0,2}[\\s:=/,._'\"`‘’“”-]*$/i;\n\n/** Public 64-hex values that are never key material; see redact-rules.json. */\nconst PUBLIC_HEX_CONSTANTS = new Set(\n (CORPUS.publicHexConstants ?? []).map((c) => c.value.toLowerCase()),\n);\n\nfunction scanHex64(lines: string[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n HEX64_RE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = HEX64_RE.exec(line)) !== null) {\n const hash = isHashContext(line, m.index, m[0]);\n out.push({\n check: hash ? 'hex32-value' : 'raw-private-key',\n severity: hash ? 'warn' : 'block',\n line: i + 1,\n span: [m.index, m.index + m[0].length],\n excerpt: hash ? `${m[0].slice(0, 6)}…${m[0].slice(-4)}` : maskKeeping(m[0], 2),\n });\n }\n }\n return out;\n}\n\n/**\n * How far back a label or URL scheme may sit. Bounded so the lookback is O(1)\n * per match rather than a fresh slice of the whole line: a transcript line\n * carrying hundreds of 64-hex values would otherwise be quadratic. A label is\n * relevant within ~40 characters and a scheme+host+path prefix within 256; past\n * that the value stays block, which is the fail-safe direction.\n */\nconst LABEL_LOOKBACK = 256;\n\nfunction isHashContext(line: string, matchIndex: number, match: string): boolean {\n if (PUBLIC_HEX_CONSTANTS.has(match.toLowerCase())) return true;\n const from = Math.max(0, matchIndex - LABEL_LOOKBACK);\n const before = line.slice(from, matchIndex);\n // A truncated window must not start mid-word, or `gridhash` cut to `hash`\n // reads as a label. Underscore is kept: it is the boundary `source_id` needs.\n const labelWindow = from === 0 ? before : before.replace(/^[A-Za-z0-9]+/, '');\n if (HASH_LABEL_RE.test(labelWindow)) return true;\n // The whitespace-delimited token containing the match starts with http(s)://.\n const prefix = /(\\S*)$/.exec(before)?.[1] ?? '';\n return /^https?:\\/\\//.test(line.slice(matchIndex - prefix.length));\n}\n\n/** The hash labels that keep a bare 64-hex or an 88-character base58 run as written. */\nconst BARE_HASH_LABEL_RE =\n /(?:^|[^a-z0-9])(?:tx|txn|txid|hash|sha\\d*|hmac|digest|commit|id|checksum|sig|signature)(?:[\\s:=/,._*'\"`‘’“”-]*[A-Za-z0-9_]{1,12}){0,2}[\\s:=/,._*'\"`‘’“”-]*$/i;\n\n/**\n * A bare key-shaped run that is a hash or a signature by context: a hash label\n * within two tokens before it, or an http(s) URL it sits inside. The same\n * window and URL test the 0x form's demotion uses, with the labels a bare\n * digest or a Solana signature carries.\n */\nfunction isLabelledHash(m: RegExpExecArray): boolean {\n const input = m.input;\n const from = Math.max(0, m.index - LABEL_LOOKBACK);\n const before = input.slice(from, m.index);\n const labelWindow = from === 0 ? before : before.replace(/^[A-Za-z0-9]+/, '');\n if (BARE_HASH_LABEL_RE.test(labelWindow)) return true;\n const prefix = /(\\S*)$/.exec(before)?.[1] ?? '';\n return /^https?:\\/\\//.test(input.slice(m.index - prefix.length));\n}\n\n// gitleaks private-key marker (RSA/EC/OPENSSH/PGP variants, optional BLOCK).\nconst PEM_BEGIN = /-----BEGIN[ A-Z0-9]*PRIVATE KEY(?: BLOCK)?-----/;\nconst PEM_END = /-----END[ A-Z0-9]*PRIVATE KEY(?: BLOCK)?-----/;\n\n/** A PEM private-key block is a single block finding on its BEGIN marker line. */\nfunction scanPemBlocks(lines: string[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n const m = PEM_BEGIN.exec(line);\n if (m !== null) {\n out.push({\n check: 'pem-private-key',\n severity: 'block',\n line: i + 1,\n span: [m.index, m.index + m[0].length],\n excerpt: m[0], // the header marker only — no key material follows on it\n });\n }\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// BIP-39 seed phrases — block. A wallet-adjacent CLI that catches a hex key but\n// not a mnemonic is not protecting the thing that actually loses the funds.\n// ---------------------------------------------------------------------------\n\nconst BIP39_WORDS = new Set((wordlistJson as { words: string }).words.split(' '));\n/** The shortest valid BIP-39 mnemonic. Below this a run is prose, not a phrase. */\nconst SEED_PHRASE_MIN_WORDS = 12;\n/** The longest BIP-39 mnemonic. */\nconst SEED_PHRASE_MAX_WORDS = 24;\nconst SEED_PHRASE_SIZES = [24, 21, 18, 15, 12];\nconst BIP39_INDEX = new Map(\n (wordlistJson as { words: string }).words.split(' ').map((word, index) => [word, index]),\n);\n\n/** What may sit between two words of a loosely written phrase. */\nconst LOOSE_SEPARATOR = /^[\\s,\"'`]+$/;\n\n/**\n * Recovery phrases the strict line scan does not see: any case, words joined\n * by commas, quotes or line breaks (a 6+6 paste), or a phrase inside a longer\n * wordlist run. Only a window that IS a phrase goes, 12 to 24 words whose\n * BIP-39 checksum holds, longest first; everything else stays as written, so\n * a capitalized or comma-separated list of common words is not a false hit.\n * The English wordlist is the only one this build ships.\n */\nfunction maskLooseMnemonics(text: string): string {\n const tokens = [...text.matchAll(/[A-Za-z]+/g)].map((m) => ({\n word: m[0].toLowerCase(),\n start: m.index,\n end: m.index + m[0].length,\n }));\n // A long run repeats itself (a word typed over and over), so each distinct\n // window is hashed once: the pass stays linear on a transcript-length text.\n const checked = new Map<string, boolean>();\n const valid = (window: string[]): boolean => {\n const key = window.join(' ');\n let result = checked.get(key);\n if (result === undefined) checked.set(key, (result = isMnemonic(window)));\n return result;\n };\n const parts: string[] = [];\n let cursor = 0;\n let i = 0;\n while (i < tokens.length) {\n let j = i;\n while (\n j < tokens.length &&\n BIP39_INDEX.has(tokens[j]!.word) &&\n (j === i || LOOSE_SEPARATOR.test(text.slice(tokens[j - 1]!.end, tokens[j]!.start)))\n ) {\n j++;\n }\n if (j === i) {\n i++;\n continue;\n }\n let k = i;\n while (k + SEED_PHRASE_MIN_WORDS <= j) {\n const size = SEED_PHRASE_SIZES.find(\n (n) => k + n <= j && valid(tokens.slice(k, k + n).map((t) => t.word)),\n );\n if (size === undefined) {\n k++;\n continue;\n }\n parts.push(\n text.slice(cursor, tokens[k]!.start),\n `[redacted ${size}-word BIP-39 recovery phrase]`,\n );\n cursor = tokens[k + size - 1]!.end;\n k += size;\n }\n i = j;\n }\n parts.push(text.slice(cursor));\n return parts.join('');\n}\n\n/** BIP-39: 11 bits per word, the last `n / 3` of them a SHA-256 checksum of the rest. */\nfunction isMnemonic(words: string[]): boolean {\n let bits = 0n;\n for (const word of words) bits = (bits << 11n) | BigInt(BIP39_INDEX.get(word) ?? 0);\n const checksumBits = BigInt(words.length / 3);\n const entropyBytes = (words.length * 11 - words.length / 3) / 8;\n const entropy = Buffer.from(\n (bits >> checksumBits).toString(16).padStart(entropyBytes * 2, '0'),\n 'hex',\n );\n const expected = BigInt(createHash('sha256').update(entropy).digest()[0]!) >> (8n - checksumBits);\n return (bits & ((1n << checksumBits) - 1n)) === expected;\n}\n\n/**\n * A run of >=12 consecutive wordlist words separated ONLY by whitespace or\n * quote characters. The rule is what keeps prose out: BIP-39 words are common\n * English, but twelve of them in a row with no punctuation is a phrase, not a\n * sentence. A quote is a separator so the `.env` form counts:\n * `MNEMONIC=\"abandon … about\"` (tenjin-agent#296). Tokens are walked rather\n * than matched by one regex so the span is exact and the pass stays linear on\n * a transcript-length line.\n */\nfunction scanSeedPhrases(lines: string[]): Finding[] {\n const out: Finding[] = [];\n const token = /[^\\s\"'`]+/g;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n token.lastIndex = 0;\n let runStart = -1;\n let runEnd = -1;\n let runWords = 0;\n let m: RegExpExecArray | null;\n const flush = (): void => {\n if (runWords >= SEED_PHRASE_MIN_WORDS) {\n out.push({\n check: 'bip39-seed-phrase',\n severity: 'block',\n line: i + 1,\n span: [runStart, runEnd],\n excerpt: `[redacted ${runWords}-word BIP-39 recovery phrase]`,\n });\n }\n runWords = 0;\n };\n while ((m = token.exec(line)) !== null) {\n if (BIP39_WORDS.has(m[0])) {\n if (runWords === 0) runStart = m.index;\n runEnd = m.index + m[0].length;\n runWords++;\n } else {\n flush();\n }\n }\n flush();\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// .env dump blocks — warn. One finding per run, naming the KEYS only.\n// ---------------------------------------------------------------------------\n\nconst ENV_LINE = /^\\s*(?:export\\s+)?([A-Z][A-Z0-9_]{2,})=(\\S.*)$/;\n/** Three lines is the shortest run that reads as a file rather than one example. */\nconst ENV_BLOCK_MIN_LINES = 3;\n/** A run of short values is configuration (PORT=3000); a long literal is a payload. */\nconst ENV_SUBSTANTIAL_VALUE = 12;\n\nfunction scanEnvDumpBlocks(lines: string[]): Finding[] {\n const out: Finding[] = [];\n let i = 0;\n while (i < lines.length) {\n const keys: string[] = [];\n let substantial = false;\n const start = i;\n let m: RegExpExecArray | null;\n while (i < lines.length && (m = ENV_LINE.exec(lines[i] ?? '')) !== null) {\n keys.push(m[1] ?? '');\n const value = dequote((m[2] ?? '').trim());\n if (value.length >= ENV_SUBSTANTIAL_VALUE && !isPlaceholder(value) && !isStructural(value)) {\n substantial = true;\n }\n i++;\n }\n if (keys.length >= ENV_BLOCK_MIN_LINES && substantial) {\n const shown = keys.slice(0, 3).join(', ');\n const rest = keys.length - 3;\n out.push({\n check: 'env-dump-block',\n severity: 'warn',\n line: start + 1,\n span: [0, (lines[start] ?? '').length],\n excerpt: `${keys.length} KEY=VALUE lines (${shown}${rest > 0 ? `, +${rest} more` : ''})`,\n });\n }\n if (i === start) i++;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Generic high-entropy token — warn. The catch-all behind the named shapes.\n// ---------------------------------------------------------------------------\n\n// `/` and `=` are deliberately outside the candidate class: with them in, every\n// long URL path (`com/BackTrackCo/tenjin-agent/issues/45`) and every\n// SHOUTY_KEY=value line reads as one high-entropy token, which is the warn\n// fatigue this detector is supposed to avoid causing. The cost is that a\n// standard-base64 payload is split on its `/` bytes; the credential families\n// that actually carry `/`-bearing base64 (JWT, PEM, OpenSSH) have named detectors.\nconst ENTROPY_CANDIDATE = /[A-Za-z0-9+_-]{32,}/g;\n/** Below this, base62 tokens of this length are not distinguishable from text. */\nconst MIN_ENTROPY_BITS = 3.5;\n/**\n * Random base62 almost never runs more than eight same-case letters; an\n * identifier (getUserProfileByAccountIdentifier) always does. This single test\n * is what keeps long camelCase symbols out of the findings list.\n */\nconst MAX_SAME_CASE_RUN = 8;\n\n/**\n * Long tokens whose character profile reads as key material. Suppressed when the\n * token overlaps a finding a named detector already produced, so a JWT or an AWS\n * key is reported once, by the detector that knows what it is.\n */\nfunction scanHighEntropy(lines: string[], named: Finding[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n ENTROPY_CANDIDATE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = ENTROPY_CANDIDATE.exec(line)) !== null) {\n const token = m[0];\n // Warn tier, so the substring placeholder test is allowed here.\n if (!looksRandom(token) || DOCS_PLACEHOLDER.test(token)) continue;\n const span: [number, number] = [m.index, m.index + token.length];\n if (named.some((f) => f.line === i + 1 && f.span[0] < span[1] && span[0] < f.span[1])) {\n continue;\n }\n out.push({\n check: 'high-entropy-string',\n severity: 'warn',\n line: i + 1,\n span,\n excerpt: maskKeeping(token, 4),\n });\n }\n }\n return out;\n}\n\nfunction looksRandom(token: string): boolean {\n if (!/[a-z]/.test(token) || !/[A-Z]/.test(token) || !/[0-9]/.test(token)) return false;\n if (longestSameCaseRun(token) > MAX_SAME_CASE_RUN) return false;\n return shannonBits(token) >= MIN_ENTROPY_BITS;\n}\n\nfunction longestSameCaseRun(token: string): number {\n let best = 0;\n let run = 0;\n let previous = '';\n for (const ch of token) {\n let kind = '';\n if (/[a-z]/.test(ch)) kind = 'lower';\n else if (/[A-Z]/.test(ch)) kind = 'upper';\n if (kind === '') run = 0;\n else run = kind === previous ? run + 1 : 1;\n previous = kind;\n if (run > best) best = run;\n }\n return best;\n}\n\nfunction shannonBits(token: string): number {\n const counts = new Map<string, number>();\n for (const ch of token) counts.set(ch, (counts.get(ch) ?? 0) + 1);\n let bits = 0;\n for (const n of counts.values()) {\n const p = n / token.length;\n bits -= p * Math.log2(p);\n }\n return bits;\n}\n\n/**\n * `hex32-value` is not a rule id: it is the warn form `scanHex64` demotes\n * `raw-private-key` to in hash context, so it follows that rule's scopes. A\n * team shelf keeps it because the emitting rule is scoped to team, never\n * because anything filters on `finding.check`. Exported for the fixture test\n * that pins the survivor set.\n */\nexport const EMITTED_CHECKS: Readonly<Record<string, string>> = {\n 'hex32-value': 'raw-private-key',\n};\n\n/** Every rule id `findings()` can report for a scope, emitted checks included. */\nexport function checksFor(scope: ReportScope): ReadonlySet<string> {\n const ids = new Set(CORPUS.rules.filter((r) => r.scopes.includes(scope)).map((r) => r.id));\n for (const [check, rule] of Object.entries(EMITTED_CHECKS)) if (ids.has(rule)) ids.add(check);\n return ids;\n}\n\nconst CHECKS: Record<ReportScope, ReadonlySet<string>> = {\n publish: checksFor('publish'),\n team: checksFor('team'),\n};\n\nconst FENCE = /^(\\s*)(`{3,}|~{3,})/;\n\n/**\n * Long verbatim runs — warn (a rights, not a secrets, concern). A fenced code\n * block or a contiguous `>` blockquote whose content reaches LONG_QUOTE_WORDS\n * reads as copied third-party material. Reported once on the run's first line.\n */\nfunction scanLongVerbatim(lines: string[]): Finding[] {\n const out: Finding[] = [];\n let i = 0;\n while (i < lines.length) {\n const line = lines[i] ?? '';\n const fence = FENCE.exec(line);\n if (fence !== null) {\n const marker = fence[2] ?? '```';\n const start = i;\n const body: string[] = [];\n i++;\n while (i < lines.length && !closesFence(lines[i] ?? '', marker)) {\n body.push(lines[i] ?? '');\n i++;\n }\n i++; // consume the closing fence (or run off the end)\n pushIfLong(out, body, start, line);\n continue;\n }\n if (/^\\s*>/.test(line)) {\n const start = i;\n const body: string[] = [];\n while (i < lines.length && /^\\s*>/.test(lines[i] ?? '')) {\n body.push((lines[i] ?? '').replace(/^\\s*>\\s?/, ''));\n i++;\n }\n pushIfLong(out, body, start, lines[start] ?? '');\n continue;\n }\n i++;\n }\n return out;\n}\n\nfunction closesFence(line: string, marker: string): boolean {\n const m = FENCE.exec(line);\n return m !== null && (m[2] ?? '').startsWith(marker);\n}\n\nfunction pushIfLong(out: Finding[], body: string[], startLine: number, firstLine: string): void {\n const text = body.join(' ').trim();\n const words = text.length === 0 ? 0 : text.split(/\\s+/).length;\n if (words < LONG_QUOTE_WORDS) return;\n out.push({\n check: 'long-verbatim-quote',\n severity: 'warn',\n line: startLine + 1,\n span: [0, firstLine.length],\n excerpt: truncate(text, 60),\n });\n}\n\n/**\n * Deterministic order: line, then start column, then check name. Exact duplicate\n * spans of the same check (e.g. two detectors on the same offset) collapse to one.\n */\nfunction dedupeAndSort(findings: Finding[]): Finding[] {\n const seen = new Set<string>();\n const unique = findings.filter((f) => {\n const key = `${f.check}:${f.line}:${f.span[0]}:${f.span[1]}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n return unique.sort(\n (a, b) => a.line - b.line || a.span[0] - b.span[0] || a.check.localeCompare(b.check),\n );\n}\n","{\n \"schemaVersion\": 1,\n \"note\": \"One rule table for every redaction surface in the CLI (src/lib/redact.ts), kept as data so the tenjin server-side ingest gate can vendor it verbatim. Every row is one detector: `id` is the stable finding `check`, `tier` is the finding severity, `match` is a JS regex or the name of an algorithmic detector a consumer must implement, `excerpt` is the masked-excerpt policy (never the secret), `skip` names a suppression predicate. `scopes` says where the row applies: `publish` (reported on the public marketplace), `team` (reported on a team shelf), `query` (its matches are replaced by the excerpt in hook queries and router packets by `mask()`; regex rows, plus the `hex64`, `pemBlock` and `bip39` algorithm rows). Precision first, as gitleaks and GitHub push protection do: a block row fires on a vendor prefix or an unambiguous shape, the generic `secret-assignment` row needs a secret-named word plus `=` or `:`, and entropy is never a trigger for a query. Table order is mask() order (the assignment row runs first, see its description). Several entries may share an `id`; they are one detector expressed as more than one pattern. Patterns adapted from gitleaks are MIT and attributed in NOTICE.md.\",\n \"publicHexConstants\": [\n {\n \"value\": \"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\n \"name\": \"topic0 ERC-20 / ERC-721 Transfer\"\n },\n {\n \"value\": \"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925\",\n \"name\": \"topic0 ERC-20 / ERC-721 Approval\"\n },\n {\n \"value\": \"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31\",\n \"name\": \"topic0 ERC-721 / ERC-1155 ApprovalForAll\"\n },\n {\n \"value\": \"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62\",\n \"name\": \"topic0 ERC-1155 TransferSingle\"\n },\n {\n \"value\": \"0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb\",\n \"name\": \"topic0 ERC-1155 TransferBatch\"\n },\n {\n \"value\": \"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0\",\n \"name\": \"topic0 Ownable OwnershipTransferred\"\n },\n {\n \"value\": \"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c\",\n \"name\": \"topic0 WETH Deposit\"\n },\n {\n \"value\": \"0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65\",\n \"name\": \"topic0 WETH Withdrawal\"\n },\n {\n \"value\": \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"name\": \"EIP-1967 implementation storage slot\"\n },\n {\n \"value\": \"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\",\n \"name\": \"EIP-1967 admin storage slot\"\n },\n {\n \"value\": \"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\",\n \"name\": \"keccak256 of the empty string\"\n },\n {\n \"value\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"name\": \"the zero hash\"\n }\n ],\n \"excerptPolicies\": {\n \"mask\": \"Keep the first `keep` characters (a public type marker) and replace the rest with a redaction count.\",\n \"verbatim\": \"Echo the match, truncated to `max` characters when set. Only for non-secret matches.\",\n \"abbreviate\": \"Keep `head` leading and `tail` trailing characters joined by an ellipsis.\",\n \"custom\": \"Consumer-implemented builder named by `handler`.\"\n },\n \"rules\": [\n {\n \"id\": \"secret-assignment\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Secret-named assignment (API_KEY=, password:, token=) with a literal value. The JSON-quoted form (\\\"password\\\": \\\"...\\\") is the third row, not a quote read here: reading a quote after this name turned ordinary config keys into findings ({\\\"credentials\\\": \\\"include\\\"}, {\\\"max_tokens\\\": 128000}, {\\\"tokenizer\\\": \\\"cl100k_base\\\"}, review round 6). The separator class is [ \\\\t] rather than \\\\s so a heading line (`## Token:`) never swallows the next line when mask() runs over whole text. FIRST IN THE TABLE ON PURPOSE: mask() applies rows in table order, and a value that is itself a vendor token (`OPENAI_API_KEY=sk-...`) must be taken whole by this row, name kept, before a vendor row could leave a stub for this row to re-match.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b([A-Za-z0-9_]*(?:API[_-]?KEY|SECRET|ACCESS[_-]?KEY|SUBSCRIPTION[_-]?KEY|PRIVATE[_-]?KEY|PASSW(?:OR)?D|TOKEN|CREDENTIALS?|AUTH[_-]?TOKEN)[A-Za-z0-9_]*)[ \\\\t]*[:=][ \\\\t]*(\\\"[^\\\"]{6,}\\\"|'[^']{6,}'|[^\\\\s\\\"']{6,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"secret-assignment\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Secret-named command-line flag with a SPACE-separated literal value (--api-key <v>, --token <v>): the one credential position the assignment form above cannot see, since it needs `=` or `:` after the name. `X-Api-Key: <v>` and `--api-key=<v>` already match above (Api-Key, api-key) and are deliberately not repeated here, so one value yields one finding. For the shapes a recorded command line takes (tenjin-agent#281): a hex-only key has no vendor prefix, and bare hex is deliberately never reported so a commit SHA still syncs, so the credential POSITION is the signal.\",\n \"source\": \"tenjin (closes tenjin-agent#281)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(--(?:[a-z0-9]+-)*(?:api[_-]?key|api[_-]?token|access[_-]?key|access[_-]?token|auth[_-]?token|secret[_-]?key|private[_-]?key|subscription[_-]?key|credentials?|secret|token|password|passwd))[ \\\\t]+(\\\"[^\\\"]{6,}\\\"|'[^']{6,}'|[^\\\\s\\\"']{6,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"secret-assignment\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Quoted secret name before `:` or `=` with a quoted value (\\\"password\\\": \\\"...\\\", 'api_key' = '...'), the JSON and YAML form of the first row (tenjin-agent#296). Narrower than the first row on purpose, so the review-round-6 config keys stay clean: the name must END in the secret word (no `max_tokens`, `tokenizer`, `passwordHash`), and the value must be quoted and carry a letter and a digit (no `128000`, no `\\\"include\\\"`). A letters-only quoted password is an accepted miss.\",\n \"source\": \"tenjin (tenjin-agent#296)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<=[\\\"'])([A-Za-z0-9_-]*(?:API[_-]?KEY|SECRET|ACCESS[_-]?KEY|SUBSCRIPTION[_-]?KEY|PRIVATE[_-]?KEY|PASSW(?:OR)?D|TOKEN|CREDENTIALS?|AUTH[_-]?TOKEN))[\\\"'][ \\\\t]*[:=][ \\\\t]*(\\\"(?=[^\\\"]*\\\\d)(?=[^\\\"]*[A-Za-z])[^\\\"]{6,}\\\"|'(?=[^']*\\\\d)(?=[^']*[A-Za-z])[^']{6,}')\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"aws-access-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"AWS access key id (AKIA/ASIA/ABIA/ACCA/A3T prefixes).\",\n \"source\": \"gitleaks:aws-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[0-9A-Z]{16}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"jwt\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"JSON Web Token: three base64url segments whose header starts eyJ.\",\n \"source\": \"gitleaks:jwt\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\beyJ[A-Za-z0-9_-]{5,}\\\\.eyJ[A-Za-z0-9_-]{5,}\\\\.[A-Za-z0-9_-]{5,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"github-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"GitHub classic PAT/OAuth/app/refresh token or fine-grained PAT (github_pat_).\",\n \"source\": \"gitleaks:github-pat + github-fine-grained-pat\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:gh[posru]_[0-9A-Za-z]{36}|github_pat_[0-9A-Za-z_]{82})\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"slack-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Slack bot/user/app/refresh/legacy token.\",\n \"source\": \"gitleaks:slack-*-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bxox[baprs]-[0-9A-Za-z-]{10,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 5\n }\n },\n {\n \"id\": \"stripe-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Stripe live or test secret/restricted key.\",\n \"source\": \"gitleaks:stripe-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b[sr]k_(?:live|test)_[0-9A-Za-z]{10,99}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 8\n }\n },\n {\n \"id\": \"anthropic-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Anthropic API key (sk-ant-).\",\n \"source\": \"gitleaks:anthropic-api-key\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bsk-ant-[0-9A-Za-z_-]{20,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 7\n }\n },\n {\n \"id\": \"openai-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"OpenAI key: classic sk- plus sk-proj-/sk-svcacct-/sk-admin-. The body must carry a digit so sk- kebab identifiers do not hard-block. Project, service-account and admin keys carry `_` and `-` throughout the body, so the prefixed branch takes the wider class and its own trailing guard; the bare branch keeps the digit requirement and its own guard. The guards live INSIDE each branch: a shared guard outside the alternation made a classic key followed by `-old` fail outright (review round 6).\",\n \"source\": \"gitleaks:openai-api-key\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bsk-(?!ant-)(?:(?:proj|svcacct|admin)-[0-9A-Za-z_-]{20,}(?![0-9A-Za-z_-])|(?=[0-9A-Za-z]*[0-9])[0-9A-Za-z]{20,}(?![0-9A-Za-z]))\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"google-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Google API key (AIza) or OAuth client secret (GOCSPX-).\",\n \"source\": \"gitleaks:gcp-api-key + gcp-oauth-client-secret\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:AIza[0-9A-Za-z_-]{35}|GOCSPX-[0-9A-Za-z_-]{20,})\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"googleKey\"\n }\n },\n {\n \"id\": \"npm-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"npm access token.\",\n \"source\": \"gitleaks:npm-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bnpm_[0-9A-Za-z]{36}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"supabase-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Supabase personal access token (sbp_) or secret/publishable API key (sb_*_).\",\n \"source\": \"gitleaks:supabase-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bsbp_[0-9a-f]{40}\\\\b|\\\\bsb_(?:secret|publishable)_[0-9A-Za-z_-]{20,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"twilio-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Twilio API key SID (SK + 32 lowercase hex).\",\n \"source\": \"gitleaks:twilio-api-key\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bSK[0-9a-f]{32}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 2\n }\n },\n {\n \"id\": \"sendgrid-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"SendGrid API key (SG.<id>.<secret>).\",\n \"source\": \"gitleaks:sendgrid-api-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bSG\\\\.[0-9A-Za-z_-]{16,32}\\\\.[0-9A-Za-z_-]{16,64}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"huggingface-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Hugging Face user access token (hf_).\",\n \"source\": \"gitleaks:huggingface-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bhf_[0-9A-Za-z]{30,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"vercel-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Vercel Blob read/write store token.\",\n \"source\": \"tenjin (shape from the Vercel Blob docs)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bvercel_blob_[a-z]{2}_[0-9A-Za-z_]{24,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 12\n }\n },\n {\n \"id\": \"vercel-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Vercel platform token (vcp_/vci_/vca_/vcr_/vck_ prefixes).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-vercel\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:vcp|vci|vca|vcr|vck)_[0-9A-Za-z]{20,60}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"notion-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Notion integration token (ntn_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-notion\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bntn_[0-9]{11}[0-9A-Za-z]{35}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"linear-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Linear API key (lin_api_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-linear\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\blin_api_[0-9A-Za-z_]{32,128}(?![0-9A-Za-z_])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 8\n }\n },\n {\n \"id\": \"figma-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Figma personal access token (figd_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-figma\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bfigd_[0-9A-Za-z_-]{40,200}(?![0-9A-Za-z_-])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 5\n }\n },\n {\n \"id\": \"gitlab-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"GitLab personal access token (glpat-).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-gitlab\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bglpat-[0-9A-Za-z_-]{20,128}(?![0-9A-Za-z_-])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 6\n }\n },\n {\n \"id\": \"docker-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Docker Hub personal access token (dckr_pat_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-docker\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bdckr_pat_[0-9A-Za-z_-]{27}(?![0-9A-Za-z_-])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 9\n }\n },\n {\n \"id\": \"cloudflare-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Cloudflare API key or account/user token (cfk_/cfut_/cfat_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-cloudflare\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:cfk|cfut|cfat)_[0-9A-Za-z]{40}[0-9a-f]{8}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"databricks-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Databricks personal access token (dapi).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-databricks\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bdapi[0-9A-Fa-f]{32}(?:-[0-9])?(?![0-9A-Fa-f])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"openssh-private-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"OpenSSH private key body pasted without its PEM framing (base64 of the openssh-key-v1 magic).\",\n \"source\": \"gitleaks:private-key (framing-free variant)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bb3BlbnNzaC1rZXktdjEA[0-9A-Za-z+/=]{20,}\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 8\n }\n },\n {\n \"id\": \"totp-uri\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"otpauth:// TOTP/HOTP provisioning URI; its secret= parameter is a live second factor.\",\n \"source\": \"tenjin (RFC-style otpauth key URI)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\botpauth:\\\\/\\\\/[ht]otp\\\\/[^\\\\s\\\"'`<>)\\\\]]+\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 15\n }\n },\n {\n \"id\": \"db-connection-uri\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Basic-auth style URI with an embedded password (scheme://user:pass@host), including database connection strings. The scheme run is length-bounded: unbounded, it backtracks quadratically across a transcript-length dotted-token line that never reaches ://. The user may be empty: `redis://:password@host` is the standard Redis form.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b([a-z][a-z0-9+.-]{0,31}):\\\\/\\\\/([^\\\\s:@/]*):([^\\\\s@/]+)@([^\\\\s/:]+)\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"dbConnectionUri\"\n },\n \"skip\": {\n \"handler\": \"exampleDbPassword\"\n }\n },\n {\n \"id\": \"bearer-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Authorization: Bearer header carrying a live token.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bAuthorization:\\\\s*Bearer\\\\s+(\\\\S{8,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"bearerToken\"\n },\n \"skip\": {\n \"handler\": \"placeholderGroup1\"\n }\n },\n {\n \"id\": \"basic-auth-header\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"Authorization: Basic header: the base64 of user:password, under the entropy floor and on no vendor prefix (tenjin-agent#296). The header name is a bounded lookbehind behind a shape lookahead, so the mask keeps it, replaces the credential alone, and a whitespace run stays linear.\",\n \"source\": \"tenjin (tenjin-agent#296)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?=[A-Za-z0-9+/]{8})(?<=\\\\bAuthorization:[ \\\\t]{0,16}Basic[ \\\\t]{1,16})[A-Za-z0-9+/]{8,}={0,2}(?![A-Za-z0-9+/=])\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n }\n },\n {\n \"id\": \"curl-user-credential\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"curl -u / --user user:password on one command (tenjin-agent#296): the password is masked and the command and user kept. Anchored on `curl` within 200 characters of the flag on the same pipeline segment, so `docker run -u 1000:1000` never matches. A `$VAR`, a placeholder or a bare lowercase word is skipped as the assignment row skips it.\",\n \"source\": \"tenjin (tenjin-agent#296)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(\\\\bcurl\\\\b[^\\\\n|;&]{0,200}?[ \\\\t](?:-u|--user)(?:[ \\\\t]+|=)[\\\"']?[^\\\\s:\\\"']{1,64}):([^\\\\s\\\"']+)\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"url-query-credential\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"Credential-named query parameter on a URL (?key=, &api_key=, ?token=, ?sig=, ?password=): the value is masked and the name kept. The value class stops at `&`, `#`, whitespace, quotes and brackets, so a value another row already replaced with `[redacted …]` is not masked twice.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"([?&](?:key|apikey|api_key|api-key|token|access_token|auth|secret|client_secret|sig|signature|password|pwd))=([^&#\\\\s\\\"'<>\\\\[\\\\]]+)\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n }\n },\n {\n \"id\": \"url-path-credential\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"A path segment of 24 or more [A-Za-z0-9_-] characters that mixes letters and digits, on an http(s) URL: the shape a webhook secret or a signed-link token takes. A CDN hash or a content id in a path masks too; in a query that costs one routing offer. Four exclusions, each from a measured miss: a segment with two hyphenated words (an article slug), a 40-hex git commit after a git path marker (/commit/, /commits/, /blob/, /tree/, /raw/, /compare/) or on a git host (github.com, gitlab.com, bitbucket.org, codeberg.org), since elsewhere a 40-hex segment is a node key (https://<name>.quiknode.pro/<40 hex>/), a 0x-prefixed 64-hex (the hex64 row already calls a 64-hex inside a URL a hash), a UUID, and a URL character class that stops at quotes, brackets and commas, so one match never spans two URLs in a JSON string. The segment must be whole (a `.` or `%` inside it is a filename or an encoded slug, not a token). The shape lookahead runs before the scheme lookbehind, and the lookbehind is bounded, so a line of short segments stays linear.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\/(?=[\\\\w-]{24})(?<=\\\\bhttps?:\\\\/\\\\/[^\\\\s?#\\\"'`<>()\\\\[\\\\]{},]{1,2048}\\\\/)(?=[\\\\w-]*[A-Za-z])(?=[\\\\w-]*\\\\d)(?![\\\\w-]*?(?<![A-Za-z])[A-Za-z]{3,}-[A-Za-z]{3})(?!(?:0x[0-9a-f]{64}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?![\\\\w-]))(?!(?=[0-9a-f]{40}(?![\\\\w-]))(?<=\\\\/(?:commit|commits|blob|tree|raw|compare)\\\\/|\\\\bhttps?:\\\\/\\\\/(?:www\\\\.)?(?:github\\\\.com|gitlab\\\\.com|bitbucket\\\\.org|codeberg\\\\.org)\\\\/[^\\\\s?#\\\"'`<>()\\\\[\\\\]{},]{0,2048}))[\\\\w-]{24,}(?=[.;:!]*(?:[\\\\/?#\\\\s\\\"'<>(),\\\\[\\\\]{}`]|$))\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 1\n }\n },\n {\n \"id\": \"bare-hex-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"64 hex with no 0x, the shape a private key takes when a tool exports it bare (tenjin-agent#388). A hash label within two tokens before it (tx, txn, txid, hash, sha, sha256, hmac, digest, commit, id, checksum, sig, signature, across markdown emphasis) or an http(s) URL around it makes it a hash and it is kept, the same downgrade the 0x form has. A 128-hex run (sha512) is not a 64-hex run and never matches.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![0-9A-Za-z])[0-9a-fA-F]{64}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n },\n \"skip\": {\n \"handler\": \"hashLabelled\"\n }\n },\n {\n \"id\": \"bare-hex-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"A 64-hex key split into two 32-hex halves by one space or one newline, with an optional 0x on the first half. Bounded to exactly two adjacent halves: a third 32-hex run before or after (a list of MD5 sums) keeps the whole list as written, and a hash label keeps it as for the row above.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![0-9A-Za-z])(?<![0-9a-fA-F]{32}[ \\\\n])(?:0x)?[0-9a-fA-F]{32}[ \\\\n][0-9a-fA-F]{32}(?![0-9A-Za-z])(?![ \\\\n][0-9a-fA-F]{32})\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n },\n \"skip\": {\n \"handler\": \"hashLabelled\"\n }\n },\n {\n \"id\": \"solana-secret-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"An 87 or 88 character base58 run: a Solana keypair's 64-byte secret key as a wallet exports it (tenjin-agent#388). A transaction signature has the same shape, so a tx or sig label before it or an http(s) URL around it keeps it, as for bare-hex-key. A 32-byte public key is 43 or 44 characters and never matches.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![1-9A-HJ-NP-Za-km-z])[1-9A-HJ-NP-Za-km-z]{87,88}(?![1-9A-HJ-NP-Za-km-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n },\n \"skip\": {\n \"handler\": \"hashLabelled\"\n }\n },\n {\n \"id\": \"solana-secret-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"A JSON array of exactly 64 integers from 0 to 255: the solana-keygen keypair file.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\[\\\\s*(?:(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\s*,\\\\s*){63}(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\s*\\\\]\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 1\n }\n },\n {\n \"id\": \"wallet-address\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"EVM account/contract address (0x + 40 hex).\",\n \"source\": \"blockrun-mcp (wallet-key leak scanner)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![0-9a-fx])0x[0-9a-fA-F]{40}(?![0-9a-fA-F])\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"abbreviate\",\n \"head\": 6,\n \"tail\": 4\n }\n },\n {\n \"id\": \"confidential-marker\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Document classification legend (CONFIDENTIAL stamp, INTERNAL USE ONLY, DO NOT DISTRIBUTE). Case-sensitive: marker-shaped, not word-in-phrase.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:STRICTLY|COMPANY|HIGHLY)\\\\s+CONFIDENTIAL\\\\b|(?<![A-Z]{2,}[ \\\\t]+)\\\\bCONFIDENTIAL\\\\b|\\\\bCONFIDENTIAL\\\\b(?![ \\\\t]+[A-Z]{2,})|\\\\bConfidential(?=\\\\s*(?:[-:.,;–—]|$))|\\\\b(?:INTERNAL|Internal)(?:\\\\s+(?:USE|Use))?\\\\s+(?:ONLY|Only)\\\\b|\\\\b(?:DO\\\\s+NOT\\\\s+DISTRIBUTE|Do\\\\s+Not\\\\s+Distribute)\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"internal-hostname\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Hostname on a private-use suffix (.internal, .corp, .local, .lan, .intranet). Label count and label length are bounded: an unbounded (label\\\\.)+ run is quadratic on a transcript-length line of dotted digits.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:[a-z0-9-]{1,63}\\\\.){1,6}(?:internal|corp|local|lan|intranet)\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"private-network-endpoint\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"RFC1918 / link-local IPv4 endpoint (10/8, 172.16/12, 192.168/16, 169.254/16).\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![\\\\d.])(?:10\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)|172\\\\.(?:1[6-9]|2\\\\d|3[01])\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)|192\\\\.168\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)|169\\\\.254\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d))(?::\\\\d{2,5})?(?!\\\\.?\\\\d)\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"private-network-endpoint\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Loopback / wildcard-bind development endpoint. Scheme or port required so prose about localhost does not warn.\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"https?:\\\\/\\\\/(?:localhost|127\\\\.0\\\\.0\\\\.1|0\\\\.0\\\\.0\\\\.0|\\\\[::1\\\\])(?::\\\\d{2,5})?(?:\\\\/[^\\\\s\\\"'`<>?&)\\\\]]*)?|\\\\b(?:localhost|127\\\\.0\\\\.0\\\\.1|0\\\\.0\\\\.0\\\\.0):\\\\d{2,5}\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"collaboration-url\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Link into a collaboration workspace (Google Docs/Drive, Notion, Figma, Slack archives, Linear, Jira/Confluence): the target is usually access-controlled.\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"https?:\\\\/\\\\/(?:docs\\\\.google\\\\.com|drive\\\\.google\\\\.com|(?:[a-z0-9-]+\\\\.)?notion\\\\.(?:so|site)|(?:www\\\\.)?figma\\\\.com|(?:[a-z0-9-]+\\\\.)?slack\\\\.com\\\\/archives|linear\\\\.app|[a-z0-9-]+\\\\.atlassian\\\\.net)(?:\\\\/[^\\\\s\\\"'`<>?&)\\\\]]*)?\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"AWS ARN: names an account, region, and resource.\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\barn:aws[0-9a-z-]*:[0-9a-z-]+:[0-9a-z-]*:\\\\d{0,12}:[^\\\\s\\\"'`<>,)\\\\]]+\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"GCP fully-qualified resource name (projects/<id>/<collection>/<name>).\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bprojects\\\\/[a-z][a-z0-9-]{4,28}[a-z0-9]\\\\/(?:locations|topics|subscriptions|secrets|instances|serviceAccounts|datasets|buckets|zones|keyRings|clusters|jobs|models)\\\\/[^\\\\s\\\"'`<>,)\\\\]]+\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Azure resource id: /subscriptions/<guid>/resourceGroups/<name>/...\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\/subscriptions\\\\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\\\/resourceGroups\\\\/[^\\\\s\\\"'`<>,)\\\\]/]+(?:\\\\/[^\\\\s\\\"'`<>,)\\\\]]*)?\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Cloud object-storage location (s3://, gs://, or an S3/Azure Blob/GCS bucket hostname).\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:s3|gs):\\\\/\\\\/[a-z0-9][a-z0-9._-]{2,62}(?:\\\\/[^\\\\s\\\"'`<>,?&)\\\\]]*)?|\\\\b[a-z0-9][a-z0-9.-]{1,62}\\\\.(?:s3(?:[.-][a-z0-9-]+)?\\\\.amazonaws\\\\.com|blob\\\\.core\\\\.windows\\\\.net|storage\\\\.googleapis\\\\.com)\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"local-path\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Home-anchored local filesystem path: leaks the machine username and private project layout.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?:(?<![\\\\w.-])\\\\/(?:Users|home)\\\\/([A-Za-z0-9._-]+)(?:\\\\/[^\\\\s\\\"'`)\\\\]}>:,;?&/]+)+|\\\\b[A-Za-z]:\\\\\\\\[Uu]sers\\\\\\\\([^\\\\\\\\\\\\s\\\"']+)(?:\\\\\\\\[^\\\\\\\\\\\\s\\\"']+)+)\",\n \"flags\": \"dg\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"localPath\"\n },\n \"skip\": {\n \"handler\": \"placeholderUsername\"\n }\n },\n {\n \"id\": \"customer-identifier\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Labeled customer/account/tenant identifier with a literal value.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b((?:customer|client|account|tenant|subscriber)[ _-]?(?:id|number|no))\\\\b\\\\s*[:=#]\\\\s*(\\\"[^\\\"]{2,}\\\"|'[^']{2,}'|[A-Za-z0-9][A-Za-z0-9._-]{2,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"paid-content-marker\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Third-party rights legend suggesting copied licensed material. Legend shapes only: bare paywall vocabulary is this marketplace’s own subject matter.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\ball rights reserved\\\\b|\\\\b(?:reprinted|reproduced|used) with permission\\\\b|\\\\bnot for (?:redistribution|republication)\\\\b|\\\\bdo not (?:redistribute|republish)\\\\b|(?:©|\\\\(c\\\\)|copyright)\\\\s*(?:19|20)\\\\d{2}\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"embedded-instruction\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Injection-shaped imperative captured from a prompt or tool output.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:ignore|disregard|forget)\\\\s+(?:all\\\\s+|any\\\\s+)?(?:previous|prior|above|earlier|preceding)\\\\s+(?:instructions?|prompts?|context|messages?)\\\\b|\\\\bdo not (?:reveal|disclose|mention) (?:this|these|the above)\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"embedded-instruction\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Hidden-prompt document header. Case-sensitive: the all-caps header form is the injection-typed one.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bBEGIN (?:SYSTEM|HIDDEN) (?:PROMPT|INSTRUCTIONS)\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"email\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Email address (PII), subsuming corporate-domain addresses. Lengths follow the RFC limits so the local part and the domain cannot backtrack against each other: unbounded, the pair is quadratic on a transcript-length line.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b[A-Za-z0-9._%+-]{1,64}@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\\\.){1,8}[A-Za-z]{2,24}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n },\n \"skip\": {\n \"handler\": \"reservedExampleEmail\"\n }\n },\n {\n \"id\": \"phone\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Telephone number (PII).\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<!\\\\d)(?:\\\\+?\\\\d{1,2}[\\\\s.-]?)?(?:\\\\(\\\\d{3}\\\\)|\\\\d{3})[\\\\s.-]\\\\d{3}[\\\\s.-]\\\\d{4}(?!\\\\d)\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"raw-private-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"0x + 64 hex with no hash context. Demoted to the warn detector hex32-value when a hash/identifier label precedes it (within two intervening tokens, across markdown and quote punctuation), when it sits inside an http(s) URL, or when it is one of the publicHexConstants below. An unlabeled bare 64-hex stays block: that is the floor.\",\n \"source\": \"blockrun-mcp (wallet-key leak scanner)\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"hex64\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"hex64\"\n }\n },\n {\n \"id\": \"pem-private-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"PEM private-key armor (-----BEGIN ... PRIVATE KEY-----), RSA/EC/OPENSSH/PGP variants.\",\n \"source\": \"gitleaks:private-key\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"pemBlock\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"pemBlock\"\n }\n },\n {\n \"id\": \"bip39-seed-phrase\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Twelve or more consecutive BIP-39 English wordlist words separated only by whitespace or quote characters, so a quoted `.env` value (MNEMONIC=\\\"abandon ... about\\\") counts (tenjin-agent#296): a wallet recovery phrase.\",\n \"source\": \"tenjin; wordlist from BIP-0039 (see NOTICE.md)\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"bip39\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"bip39\"\n }\n },\n {\n \"id\": \"env-dump-block\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Three or more consecutive SHOUTY_KEY=value lines carrying at least one substantial literal: a pasted .env file.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"envDump\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"envDump\"\n }\n },\n {\n \"id\": \"high-entropy-string\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Catch-all for unknown credential formats: a long mixed-case alphanumeric token whose Shannon entropy and case-run profile match random key material rather than an identifier.\",\n \"source\": \"tenjin (entropy heuristic in the spirit of gitleaks entropy gating)\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"entropy\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"entropy\"\n }\n },\n {\n \"id\": \"long-verbatim-quote\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Fenced block or blockquote run long enough to read as copied third-party material.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"longVerbatim\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"longVerbatim\"\n }\n }\n ]\n}\n","{\n \"source\": \"BIP-0039 English wordlist (bitcoin/bips), as distributed by @scure/bip39 (MIT). Vendored as data, not as a dependency: see NOTICE.md.\",\n \"count\": 2048,\n \"words\": \"abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt add addict address adjust admit adult advance advice aerobic affair afford afraid again age agent agree ahead aim air airport aisle alarm album alcohol alert alien all alley allow almost alone alpha already also alter always amateur amazing among amount amused analyst anchor ancient anger angle angry animal ankle announce annual another answer antenna antique anxiety any apart apology appear apple approve april arch arctic area arena argue arm armed armor army around arrange arrest arrive arrow art artefact artist artwork ask aspect assault asset assist assume asthma athlete atom attack attend attitude attract auction audit august aunt author auto autumn average avocado avoid awake aware away awesome awful awkward axis baby bachelor bacon badge bag balance balcony ball bamboo banana banner bar barely bargain barrel base basic basket battle beach bean beauty because become beef before begin behave behind believe below belt bench benefit best betray better between beyond bicycle bid bike bind biology bird birth bitter black blade blame blanket blast bleak bless blind blood blossom blouse blue blur blush board boat body boil bomb bone bonus book boost border boring borrow boss bottom bounce box boy bracket brain brand brass brave bread breeze brick bridge brief bright bring brisk broccoli broken bronze broom brother brown brush bubble buddy budget buffalo build bulb bulk bullet bundle bunker burden burger burst bus business busy butter buyer buzz cabbage cabin cable cactus cage cake call calm camera camp can canal cancel candy cannon canoe canvas canyon capable capital captain car carbon card cargo carpet carry cart case cash casino castle casual cat catalog catch category cattle caught cause caution cave ceiling celery cement census century cereal certain chair chalk champion change chaos chapter charge chase chat cheap check cheese chef cherry chest chicken chief child chimney choice choose chronic chuckle chunk churn cigar cinnamon circle citizen city civil claim clap clarify claw clay clean clerk clever click client cliff climb clinic clip clock clog close cloth cloud clown club clump cluster clutch coach coast coconut code coffee coil coin collect color column combine come comfort comic common company concert conduct confirm congress connect consider control convince cook cool copper copy coral core corn correct cost cotton couch country couple course cousin cover coyote crack cradle craft cram crane crash crater crawl crazy cream credit creek crew cricket crime crisp critic crop cross crouch crowd crucial cruel cruise crumble crunch crush cry crystal cube culture cup cupboard curious current curtain curve cushion custom cute cycle dad damage damp dance danger daring dash daughter dawn day deal debate debris decade december decide decline decorate decrease deer defense define defy degree delay deliver demand demise denial dentist deny depart depend deposit depth deputy derive describe desert design desk despair destroy detail detect develop device devote diagram dial diamond diary dice diesel diet differ digital dignity dilemma dinner dinosaur direct dirt disagree discover disease dish dismiss disorder display distance divert divide divorce dizzy doctor document dog doll dolphin domain donate donkey donor door dose double dove draft dragon drama drastic draw dream dress drift drill drink drip drive drop drum dry duck dumb dune during dust dutch duty dwarf dynamic eager eagle early earn earth easily east easy echo ecology economy edge edit educate effort egg eight either elbow elder electric elegant element elephant elevator elite else embark embody embrace emerge emotion employ empower empty enable enact end endless endorse enemy energy enforce engage engine enhance enjoy enlist enough enrich enroll ensure enter entire entry envelope episode equal equip era erase erode erosion error erupt escape essay essence estate eternal ethics evidence evil evoke evolve exact example excess exchange excite exclude excuse execute exercise exhaust exhibit exile exist exit exotic expand expect expire explain expose express extend extra eye eyebrow fabric face faculty fade faint faith fall false fame family famous fan fancy fantasy farm fashion fat fatal father fatigue fault favorite feature february federal fee feed feel female fence festival fetch fever few fiber fiction field figure file film filter final find fine finger finish fire firm first fiscal fish fit fitness fix flag flame flash flat flavor flee flight flip float flock floor flower fluid flush fly foam focus fog foil fold follow food foot force forest forget fork fortune forum forward fossil foster found fox fragile frame frequent fresh friend fringe frog front frost frown frozen fruit fuel fun funny furnace fury future gadget gain galaxy gallery game gap garage garbage garden garlic garment gas gasp gate gather gauge gaze general genius genre gentle genuine gesture ghost giant gift giggle ginger giraffe girl give glad glance glare glass glide glimpse globe gloom glory glove glow glue goat goddess gold good goose gorilla gospel gossip govern gown grab grace grain grant grape grass gravity great green grid grief grit grocery group grow grunt guard guess guide guilt guitar gun gym habit hair half hammer hamster hand happy harbor hard harsh harvest hat have hawk hazard head health heart heavy hedgehog height hello helmet help hen hero hidden high hill hint hip hire history hobby hockey hold hole holiday hollow home honey hood hope horn horror horse hospital host hotel hour hover hub huge human humble humor hundred hungry hunt hurdle hurry hurt husband hybrid ice icon idea identify idle ignore ill illegal illness image imitate immense immune impact impose improve impulse inch include income increase index indicate indoor industry infant inflict inform inhale inherit initial inject injury inmate inner innocent input inquiry insane insect inside inspire install intact interest into invest invite involve iron island isolate issue item ivory jacket jaguar jar jazz jealous jeans jelly jewel job join joke journey joy judge juice jump jungle junior junk just kangaroo keen keep ketchup key kick kid kidney kind kingdom kiss kit kitchen kite kitten kiwi knee knife knock know lab label labor ladder lady lake lamp language laptop large later latin laugh laundry lava law lawn lawsuit layer lazy leader leaf learn leave lecture left leg legal legend leisure lemon lend length lens leopard lesson letter level liar liberty library license life lift light like limb limit link lion liquid list little live lizard load loan lobster local lock logic lonely long loop lottery loud lounge love loyal lucky luggage lumber lunar lunch luxury lyrics machine mad magic magnet maid mail main major make mammal man manage mandate mango mansion manual maple marble march margin marine market marriage mask mass master match material math matrix matter maximum maze meadow mean measure meat mechanic medal media melody melt member memory mention menu mercy merge merit merry mesh message metal method middle midnight milk million mimic mind minimum minor minute miracle mirror misery miss mistake mix mixed mixture mobile model modify mom moment monitor monkey monster month moon moral more morning mosquito mother motion motor mountain mouse move movie much muffin mule multiply muscle museum mushroom music must mutual myself mystery myth naive name napkin narrow nasty nation nature near neck need negative neglect neither nephew nerve nest net network neutral never news next nice night noble noise nominee noodle normal north nose notable note nothing notice novel now nuclear number nurse nut oak obey object oblige obscure observe obtain obvious occur ocean october odor off offer office often oil okay old olive olympic omit once one onion online only open opera opinion oppose option orange orbit orchard order ordinary organ orient original orphan ostrich other outdoor outer output outside oval oven over own owner oxygen oyster ozone pact paddle page pair palace palm panda panel panic panther paper parade parent park parrot party pass patch path patient patrol pattern pause pave payment peace peanut pear peasant pelican pen penalty pencil people pepper perfect permit person pet phone photo phrase physical piano picnic picture piece pig pigeon pill pilot pink pioneer pipe pistol pitch pizza place planet plastic plate play please pledge pluck plug plunge poem poet point polar pole police pond pony pool popular portion position possible post potato pottery poverty powder power practice praise predict prefer prepare present pretty prevent price pride primary print priority prison private prize problem process produce profit program project promote proof property prosper protect proud provide public pudding pull pulp pulse pumpkin punch pupil puppy purchase purity purpose purse push put puzzle pyramid quality quantum quarter question quick quit quiz quote rabbit raccoon race rack radar radio rail rain raise rally ramp ranch random range rapid rare rate rather raven raw razor ready real reason rebel rebuild recall receive recipe record recycle reduce reflect reform refuse region regret regular reject relax release relief rely remain remember remind remove render renew rent reopen repair repeat replace report require rescue resemble resist resource response result retire retreat return reunion reveal review reward rhythm rib ribbon rice rich ride ridge rifle right rigid ring riot ripple risk ritual rival river road roast robot robust rocket romance roof rookie room rose rotate rough round route royal rubber rude rug rule run runway rural sad saddle sadness safe sail salad salmon salon salt salute same sample sand satisfy satoshi sauce sausage save say scale scan scare scatter scene scheme school science scissors scorpion scout scrap screen script scrub sea search season seat second secret section security seed seek segment select sell seminar senior sense sentence series service session settle setup seven shadow shaft shallow share shed shell sheriff shield shift shine ship shiver shock shoe shoot shop short shoulder shove shrimp shrug shuffle shy sibling sick side siege sight sign silent silk silly silver similar simple since sing siren sister situate six size skate sketch ski skill skin skirt skull slab slam sleep slender slice slide slight slim slogan slot slow slush small smart smile smoke smooth snack snake snap sniff snow soap soccer social sock soda soft solar soldier solid solution solve someone song soon sorry sort soul sound soup source south space spare spatial spawn speak special speed spell spend sphere spice spider spike spin spirit split spoil sponsor spoon sport spot spray spread spring spy square squeeze squirrel stable stadium staff stage stairs stamp stand start state stay steak steel stem step stereo stick still sting stock stomach stone stool story stove strategy street strike strong struggle student stuff stumble style subject submit subway success such sudden suffer sugar suggest suit summer sun sunny sunset super supply supreme sure surface surge surprise surround survey suspect sustain swallow swamp swap swarm swear sweet swift swim swing switch sword symbol symptom syrup system table tackle tag tail talent talk tank tape target task taste tattoo taxi teach team tell ten tenant tennis tent term test text thank that theme then theory there they thing this thought three thrive throw thumb thunder ticket tide tiger tilt timber time tiny tip tired tissue title toast tobacco today toddler toe together toilet token tomato tomorrow tone tongue tonight tool tooth top topic topple torch tornado tortoise toss total tourist toward tower town toy track trade traffic tragic train transfer trap trash travel tray treat tree trend trial tribe trick trigger trim trip trophy trouble truck true truly trumpet trust truth try tube tuition tumble tuna tunnel turkey turn turtle twelve twenty twice twin twist two type typical ugly umbrella unable unaware uncle uncover under undo unfair unfold unhappy uniform unique unit universe unknown unlock until unusual unveil update upgrade uphold upon upper upset urban urge usage use used useful useless usual utility vacant vacuum vague valid valley valve van vanish vapor various vast vault vehicle velvet vendor venture venue verb verify version very vessel veteran viable vibrant vicious victory video view village vintage violin virtual virus visa visit visual vital vivid vocal voice void volcano volume vote voyage wage wagon wait walk wall walnut want warfare warm warrior wash wasp waste water wave way wealth weapon wear weasel weather web wedding weekend weird welcome west wet whale what wheat wheel when where whip whisper wide width wife wild will win window wine wing wink winner winter wire wisdom wise wish witness wolf woman wonder wood wool word work world worry worth wrap wreck wrestle wrist write wrong yard year yellow you young youth zebra zero zone zoo\"\n}\n"],"mappings":";;;AAiDA,SAAS,kBAAkB;;;ACjD3B;AAAA,EACE,eAAiB;AAAA,EACjB,MAAQ;AAAA,EACR,oBAAsB;AAAA,IACpB;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,EACF;AAAA,EACA,iBAAmB;AAAA,IACjB,MAAQ;AAAA,IACR,UAAY;AAAA,IACZ,YAAc;AAAA,IACd,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mB,WAAyB;AAC9F,QAAM,OAAO,KAAK,KAAK,GAAG,EAAE,KAAK;AACjC,QAAM,QAAQ,KAAK,WAAW,IAAI,IAAI,KAAK,MAAM,KAAK,EAAE;AACxD,MAAI,QAAQ,iBAAkB;AAC9B,MAAI,KAAK;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM,YAAY;AAAA,IAClB,MAAM,CAAC,GAAG,UAAU,MAAM;AAAA,IAC1B,SAAS,SAAS,MAAM,EAAE;AAAA,EAC5B,CAAC;AACH;AAMA,SAAS,cAAcA,WAAgC;AACrD,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,SAASA,UAAS,OAAO,CAAC,MAAM;AACpC,UAAM,MAAM,GAAG,EAAE,KAAK,IAAI,EAAE,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1D,QAAI,KAAK,IAAI,GAAG,EAAG,QAAO;AAC1B,SAAK,IAAI,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACD,SAAO,OAAO;AAAA,IACZ,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,cAAc,EAAE,KAAK;AAAA,EACrF;AACF;","names":["findings"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/lib/permissions.ts
|
|
4
|
+
var PUBLISH_MODE_ALLOWLIST = [
|
|
5
|
+
{
|
|
6
|
+
rule: "Bash(tenjin publish:*)",
|
|
7
|
+
command: "tenjin publish",
|
|
8
|
+
note: "PUBLISHES PUBLICLY under your identity, and is cleared only while publish.mode is auto or full-auto: the mode is the consent, and the harness prompt would ask for it twice. Three things it clears that the free tier never did. It OPENS THE KEYSTORE: publish always resolves a signer, and with no usable session it mints one at read+write scope, which is strictly broader than the read-only key `tenjin read` mints to recover an owned piece. It publishes the contents of ANY REGULAR LOCAL FILE the agent can read, gated only by the heuristic scan. And it is a PREFIX rule, so it pins the verb and not the flags: `--base-url` rides it (see the flag caveat), and `--yes` is an ordinary flag on the same verb that clears exactly the WARN findings auto stopped on, so a re-run collapses auto into full-auto with nobody asked. The local scan is warn-only now and every finding routes through the same consent flow this mode already governs; what still refuses a publish outright is the SERVER\u2019s ingest gate (vendor tokens, private keys, seed phrases, DB passwords, bearer headers), which no mode and no flag clears. The skills hold the rest of that line. Set publish.mode back to review and the rule is retracted."
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
rule: "Bash(tenjin edit:*)",
|
|
12
|
+
command: "tenjin edit",
|
|
13
|
+
note: "Updates posts your wallet ALREADY OWNS: reprices, refreshes an as-of date, repairs an answer card, and flips status both ways, so it CAN PROMOTE A DRAFT TO PUBLISHED under this same gate (promotion re-runs the block-tier secret scan over the stored body). Owner-scoped on both legs (GET and PUT /api/posts/<id> are signed and owner-only), spends nothing, moves no keys, and mints no new posts: a narrower blast radius than the publish rule beside it, though promotion means existing drafts can go public. It rides the same mode for the same reason: edit runs the identical publish.mode consent gate in the CLI (lib/consent.ts needsConfirmation), so a mode that publishes unattended and then cannot fix its own post\u2019s price is the asymmetry the mode exists to remove. It opens the keystore on the same terms as the publish rule beside it, and takes the same prefix-rule caveats. Removed by the same return to review."
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
function modeGatedAllowlist(mode) {
|
|
17
|
+
return mode === "review" ? [] : PUBLISH_MODE_ALLOWLIST.map((e) => ({ ...e }));
|
|
18
|
+
}
|
|
19
|
+
var PERMISSIONS_DOC_URL = "https://github.com/BackTrackCo/tenjin-agent/blob/main/docs/agent-permissions.md";
|
|
20
|
+
function modeGatedPointer(mode, missing, remedy = "tenjin install") {
|
|
21
|
+
if (modeGatedAllowlist(mode).length === 0 || missing.length === 0) return null;
|
|
22
|
+
return `publish.mode=${mode} also needs ${missing.join(" and ")} in your harness allowlist, or it will prompt anyway; \`${remedy}\` writes them.`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
PERMISSIONS_DOC_URL,
|
|
27
|
+
modeGatedPointer
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-A36LQPHV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/permissions.ts"],"sourcesContent":["/**\n * The recommended HARNESS permission allowlist: the exact rule lines an operator\n * pastes into Claude Code (or an equivalent harness) so auto mode stops denying\n * the free Tenjin verbs, and so the one paying verb is cleared deliberately\n * rather than by accident.\n *\n * This is a HARNESS-side allowlist (which shell commands the agent may run at\n * all). It is NOT the CLI's spend policy and shares nothing with it: the shipped\n * `allowlistCreators` config key gates WHO you may pay, this file gates WHICH\n * COMMANDS the harness will run without a prompt. The two are deliberately kept\n * apart in name and in code — clearing `Bash(tenjin buy:*)` here never raises a\n * spend cap. That is a claim about this file, NOT a claim that the spend policy\n * stops an allowlisted `buy`: `--yes` is an ordinary flag on an allowlisted verb\n * and `confirmSpend` returns true on it before any TTY check\n * (src/commands/buy.ts), so under CONFIG_DEFAULTS nothing denies. See\n * OPT_IN_ALLOWLIST's note for the walk-through.\n *\n * These are static, shipped constants on purpose: there is NO config key for\n * them. An operator-editable \"which commands may run\" list stored next to the\n * spend policy would be a second, weaker copy of a control the harness already\n * owns, and a CLI that could widen its own permission grant is exactly the shape\n * this file exists to avoid.\n *\n * Scope: `tenjin mcp` exposes the same command cores over MCP, where the harness\n * gates TOOLS, not Bash lines. These rules say nothing about that surface, which\n * is why `tenjin mcp` is itself never recommended here: clearing it would route\n * around every rule below. MCP_CAVEAT names the tools to leave gated for an\n * operator who runs the server anyway.\n *\n * LIMIT OF A PREFIX RULE, read this before adding an entry: the rule constrains\n * the VERB and nothing else. `addGlobalFlags` (src/cli.ts) puts `--json`,\n * `--timeout`, and `--base-url` on every leaf command, so every rule below also\n * clears `--base-url <url>` in trailing position. `--base-url` is validated as a\n * URL and nothing more, and it wins settings precedence, so it re-points the\n * trust boundary itself: the `search` question goes to that host, `doctor` probes\n * it, and `assertOnBaseOrigin` only checks that a resource URL shares an origin\n * with the CONFIGURED base, so an attacker-controlled pair satisfies the pin. No\n * prefix syntax expresses \"this verb but not that flag\", so the mitigation is\n * disclosure rather than a narrower rule: FLAG_CAVEAT rides the `--json` payload\n * and docs/agent-permissions.md, every human surface points at that page, and the\n * skills tell the agent never to pass `--base-url` on an allowlisted verb. Pinning\n * the paying path to a constant origin instead is the real fix and is an\n * x402/payments-semantics change, tracked separately.\n */\n\nimport type { PublishMode } from './config';\n\n/** One pasteable allowlist rule plus why it is safe (or what it costs). */\nexport interface AllowlistEntry {\n /** The exact line to add to the harness permission allowlist. */\n rule: string;\n /** The verb it clears. */\n command: string;\n /** Why it is safe to pre-clear, or what the operator is opting into. */\n note: string;\n}\n\n/** A verb deliberately kept OUT of the recommended allowlist, and why. */\nexport interface ExcludedVerb {\n command: string;\n reason: string;\n}\n\n/**\n * FREE verbs: they CANNOT SPEND. That is the whole definition of this tier, and\n * it is deliberately narrower than the older \"no wallet, no signing, no\n * payment\" — which stopped being true the moment `read` gained the ability to\n * recover an owned piece. `read` signs, with a P-256 delegation, and mints one\n * with a wallet signature when none is live; what it cannot do is produce the\n * secp256k1/EIP-712 signature a payment authorization needs (wrong curve), which\n * is test-pinned by its import graph never reaching the payment module. Money\n * stays out of reach; a signature, and the keystore access behind minting one,\n * no longer do, so the tier says what it means. `doctor` decrypts locally to\n * check the wallet still opens.\n *\n * What the tier does NOT claim, because it is not true: that the read scope\n * limits what a leaked delegation is worth. Scope is enforced only on the request\n * shape that carries both a session signature and the delegation header; the same\n * delegation replayed as a plain `SIGN-IN-WITH-X` takes a different server path\n * where no scope logic runs. So a session file is a wallet-derived credential\n * with the authority of the wallet behind it, and the mitigations that actually\n * hold are the ones in this repo: it is 0600, short-lived (≤24h, server-clamped),\n * bound to the origin it was minted for, and never presented off that origin.\n * Treat \"read is allowlisted\" as \"read may transmit that credential to the\n * configured origin\", and see FLAG_CAVEAT for why the configured origin is not\n * automatically the one you configured.\n *\n * Not all of them are read-only, and the difference is disclosed rather than\n * papered over — `search` POSTs the (generalized, anonymous) question off-machine\n * and records it locally, `outcome` POSTs a report that moves the marketplace's\n * reuse signal (both unauthenticated remote writes), and `read` writes locally,\n * saving a delivered piece to the library, and `doctor` decrypts the keystore\n * locally to check it opens. Pre-clearing them is defensible because they cost\n * nothing and none of it leaves the machine; calling them read-only to justify it\n * would not be.\n *\n * Rules are PREFIX rules: `Bash(tenjin search:*)` clears commands that start with\n * `tenjin search` and nothing else. The narrow `wallet show` / `wallet balance` /\n * The `config get` form is deliberate: a `Bash(tenjin wallet:*)`\n * or `Bash(tenjin config:*)` rule would silently swallow `wallet create` and\n * `config set`, and `config set` can raise the spend caps.\n *\n * Two known gaps, both fail-closed (denied, never wrongly allowed):\n * - Bare `tenjin config` (runConfigList) is as read-only as `config get`, but no\n * prefix rule reaches it without also covering `config set`, so it stays out.\n * Use `tenjin config get <key>`, which is a different supported command rather\n * than a reworded one.\n * - Group-level flag forms like `tenjin wallet --json show` are not covered.\n * Put global flags AFTER the leaf verb (`tenjin wallet show --json`); the\n * CLI parses either, and only the trailing form matches these rules.\n */\nexport const ALWAYS_SAFE_ALLOWLIST: readonly AllowlistEntry[] = [\n {\n rule: 'Bash(tenjin search:*)',\n command: 'tenjin search',\n note:\n 'Free anonymous marketplace search. No wallet, no signing, no payment. ' +\n 'Not read-only: it POSTs the generalized question off-machine and records ' +\n 'the search locally.',\n },\n {\n rule: 'Bash(tenjin wallet fund:*)',\n command: 'tenjin wallet fund',\n note:\n 'Owner call (2026-08-12): free on both surfaces, because the command just opens the ' +\n 'fund modal. Minting moves no money: the destination is server-pinned to the wallet ' +\n 'that signed, the CLI refuses any checkout host but pay.coinbase.com, and payment ' +\n 'happens behind Coinbase\\u2019s own human gate. The usual --base-url caveat does not ' +\n 'apply: fund is pinned to the production origin and takes no override from flag, ' +\n 'env, or config.',\n },\n {\n rule: 'Bash(tenjin inspect:*)',\n command: 'tenjin inspect',\n note: 'Free pre-purchase card and preview. Never signs, never pays, never saves.',\n },\n {\n rule: 'Bash(tenjin read:*)',\n command: 'tenjin read',\n note:\n 'Free-only delivery: free pieces, local-library re-reads, and pieces this ' +\n 'wallet already owns. Cannot spend: the payment module is absent from its ' +\n 'import graph, and the key it signs with is a P-256 delegation, the wrong ' +\n 'curve to authorize a payment. OPENS THE KEYSTORE (one wallet signature) ' +\n 'when an owned piece is not on this machine and no session key is live, ' +\n 'minting the same ≤24h read-scoped delegation `publish` and `edit` mint; ' +\n 'every later owned read reuses it and asks for nothing. TRANSMITS A ' +\n 'CREDENTIAL: that wallet-derived delegation goes to the server on a cold ' +\n '402. It is minted and presented only for the origin of the piece being ' +\n 'read, and never for a second origin while one for another is cached, ' +\n 'which is what bounds a stray `--base-url`; no scope on it limits what a ' +\n 'holder could do with it. Not read-only: a freshly delivered piece is ' +\n 'saved to the library.',\n },\n {\n rule: 'Bash(tenjin outcome:*)',\n command: 'tenjin outcome',\n note:\n 'Free honest outcome report on a past search. No wallet, no payment. ' +\n 'Not read-only: it POSTs a report that moves the marketplace reuse signal.',\n },\n {\n rule: 'Bash(tenjin doctor:*)',\n command: 'tenjin doctor',\n note:\n 'Local environment and API reachability diagnostics. Decrypts the wallet ' +\n 'locally to check it still opens; signs nothing and sends nothing.',\n },\n {\n rule: 'Bash(tenjin wallet show:*)',\n command: 'tenjin wallet show',\n note: 'Prints the wallet address and key source. Never prints the key.',\n },\n {\n rule: 'Bash(tenjin wallet balance:*)',\n command: 'tenjin wallet balance',\n note: 'Read-only USDC balance query on Base.',\n },\n {\n rule: 'Bash(tenjin config get:*)',\n command: 'tenjin config get',\n note:\n 'Reads one effective config value. `config set` is excluded on purpose. ' +\n 'Note `config get rpcUrl` returns your RPC URL, which commonly embeds a ' +\n 'provider API key: no wallet secret, but a credential-adjacent read.',\n },\n];\n\n/**\n * The verbs offered as EXPLICIT opt-in lines rather than shipped in the safe set:\n * the one that spends, and the one that opens the keystore.\n *\n * Read the buy note carefully before pasting the line: on the DEFAULT config this\n * rule authorizes unattended spending up to the wallet balance. Walking\n * `--yes` clears confirmation only. Zero daily budget refuses positive payments,\n * finite budgets cap cumulative exposure, and `none` explicitly removes that cap.\n */\nexport const OPT_IN_ALLOWLIST: readonly AllowlistEntry[] = [\n {\n rule: 'Bash(tenjin buy:*)',\n command: 'tenjin buy',\n note:\n 'SPENDS USDC on Base, unrefundably. This authorizes UNATTENDED purchases: ' +\n '`--yes` is an ordinary flag on the same allowlisted verb and it clears the ' +\n 'confirm gate only. Manual purchases do not obey maxAutoSpend or sessionBudget; those limits apply only to automatic router spending. ' +\n 'This permission never raises a spend cap, but those automatic caps do not bound this verb. Use --max-price for an explicit per-purchase ceiling and require consent for the quoted purchase.',\n },\n {\n rule: 'Bash(tenjin pay:*)',\n command: 'tenjin pay',\n note:\n 'SPENDS USDC on Base, unrefundably. Only for explicit user-requested payments with consent for the live quote; never an autonomous router-refusal workaround. Automatic router limits do not apply. Registry lookup failures or listed-term mismatches require --ignore-warnings ' +\n 'for that invocation, and --yes confirms payment only. Both still obey an explicit --max-price, ' +\n 'balance and destination checks. maxAutoSpend and sessionBudget apply only to automatic router spending. Every paid call can spend again.',\n },\n];\n\n/**\n * The one rule that is neither always-safe nor a standing opt-in: it exists only\n * while `publish.mode` is `auto` or `full-auto`.\n *\n * The mode IS the consent. An operator who set auto has already said a clean\n * publish should proceed without asking; leaving the harness prompt in front of\n * it asks the same question a second time, in a place the mode cannot answer,\n * and the agent that hits it does the only safe thing and stops. That was the\n * observed failure: a session ran `tenjin config get publish.mode` mid-publish to\n * discover it had permission it had already been given (#161).\n *\n * NOT part of {@link recommendedRules}, and not a tier an operator picks from.\n * There is no line to paste and no flag that adds it: `install` writes it when\n * the mode it just settled is auto or full-auto, takes it back when the mode is\n * review, and `uninstall` reclaims it like every other rule this CLI wrote.\n */\nexport const PUBLISH_MODE_ALLOWLIST: readonly AllowlistEntry[] = [\n {\n rule: 'Bash(tenjin publish:*)',\n command: 'tenjin publish',\n note:\n 'PUBLISHES PUBLICLY under your identity, and is cleared only while publish.mode is ' +\n 'auto or full-auto: the mode is the consent, and the harness prompt would ask for it ' +\n 'twice. Three things it clears that the free tier never did. It OPENS THE KEYSTORE: ' +\n 'publish always resolves a signer, and with no usable session it mints one at ' +\n 'read+write scope, which is strictly broader than the read-only key `tenjin read` ' +\n 'mints to recover an owned piece. It publishes the contents ' +\n 'of ANY REGULAR LOCAL FILE the agent can read, gated only by the heuristic scan. And it is a ' +\n 'PREFIX rule, so it pins the verb and not the flags: `--base-url` rides it (see the ' +\n 'flag caveat), and `--yes` is an ordinary flag on the same verb that clears exactly ' +\n 'the WARN findings auto stopped on, so a re-run collapses auto into full-auto with ' +\n 'nobody asked. The local scan is warn-only now and every finding routes through the ' +\n 'same consent flow this mode already governs; what still refuses a publish outright is ' +\n 'the SERVER’s ingest gate (vendor tokens, private keys, seed phrases, DB passwords, ' +\n 'bearer headers), which no mode and no flag clears. The skills hold the rest of that ' +\n 'line. Set publish.mode back to review and the rule is retracted.',\n },\n {\n rule: 'Bash(tenjin edit:*)',\n command: 'tenjin edit',\n note:\n 'Updates posts your wallet ALREADY OWNS: reprices, refreshes an as-of date, repairs an ' +\n 'answer card, and flips status both ways, so it CAN PROMOTE A DRAFT TO PUBLISHED under ' +\n 'this same gate (promotion re-runs the block-tier secret scan over the stored body). ' +\n 'Owner-scoped on both legs (GET and PUT /api/posts/<id> are signed and owner-only), ' +\n 'spends nothing, moves no keys, and mints no new posts: a narrower blast radius than ' +\n 'the publish rule beside it, though promotion means existing drafts can go public. It ' +\n 'rides the same mode for the same reason: edit runs the identical publish.mode consent ' +\n 'gate in the CLI (lib/consent.ts needsConfirmation), so a mode that publishes ' +\n 'unattended and then cannot fix its own post\\u2019s price is the asymmetry the mode ' +\n 'exists to remove. It opens the keystore on the same terms as the publish rule beside ' +\n 'it, and takes the same prefix-rule caveats. Removed by the same return to review.',\n },\n];\n\n/** The mode-gated rules in effect for `mode`; empty on review. */\nexport function modeGatedAllowlist(mode: PublishMode): AllowlistEntry[] {\n return mode === 'review' ? [] : PUBLISH_MODE_ALLOWLIST.map((e) => ({ ...e }));\n}\n\n/**\n * Verbs that must NEVER appear in the recommended allowlist, with the reason each\n * one is a human decision. `tenjin wallet send` is the wallet escape hatch\n * (tenjin-agent #40) and heads this list: it moves USDC to an arbitrary address,\n * outside the spend policy that bounds `buy`. Naming it here is load-bearing even\n * in versions where the verb does not exist yet — the exclusion ships before the\n * verb does.\n *\n * `tenjin publish` stays on this list under its own terms: nothing RECOMMENDS it,\n * and no line here or on the doc page adds it. {@link PUBLISH_MODE_ALLOWLIST} is\n * not a recommendation — it is what one specific operator choice already means.\n */\nexport const NEVER_ALLOWLISTED: readonly ExcludedVerb[] = [\n {\n command: 'tenjin wallet send',\n reason:\n 'Moves USDC out of the wallet to an arbitrary address (the escape hatch, #40). ' +\n 'Irreversible and not bounded by the buy spend policy. Always a human decision.',\n },\n {\n command: 'tenjin publish',\n reason:\n 'Puts your content on a public marketplace under your identity. Never pre-cleared by the ' +\n 'free tier or an opt-in line: the only thing that clears it is `publish.mode` auto or ' +\n 'full-auto, which is the same human decision said once instead of twice (see ' +\n 'PUBLISH_MODE_ALLOWLIST). Back on review, `install` takes the rule away again.',\n },\n {\n command: 'tenjin edit',\n reason:\n 'Write-capable despite the no-flag form reading as a pure show: it edits live posts ' +\n 'and answer cards under your identity, and moves prices. A prefix rule pins the verb, ' +\n 'not the flags, so no rule can clear the read half without clearing the write half. ' +\n 'Never pre-cleared as a recommendation: like `tenjin publish`, the only thing that ' +\n 'clears it is `publish.mode` auto or full-auto, whose consent gate it already shares ' +\n '(see PUBLISH_MODE_ALLOWLIST). Back on review, `install` takes the rule away again.',\n },\n {\n command: 'tenjin delete',\n reason:\n 'Destroys a published piece. It is the one write verb `publish.mode` deliberately does NOT ' +\n 'carry: the mode is consent to publish, and reading it as consent to destroy would let one ' +\n 'decision authorize a different, irreversible one. So no mode ever clears this rule, and ' +\n 'the CLI confirms on every run regardless — a prefix rule here would only remove the ' +\n 'harness prompt in front of a command that asks its own question anyway. Reach for ' +\n '`tenjin edit --status draft` when the piece should come down reversibly.',\n },\n {\n command: 'tenjin wallet create',\n reason: 'Creates the payment credential; a stray run is a wallet you did not mean to have.',\n },\n {\n command: 'tenjin config set',\n reason:\n 'Can raise maxAutoSpend / sessionBudget, i.e. widen the agent’s own spend policy — ' +\n 'and, through shelfBypassSecret + baseUrl, put the machine in team mode, where a publish ' +\n 'skips the scan’s warn tier (except secret-assignment, and hex32-value, the warn form a ' +\n 'block-tier check demotes to) and prices at 0. It also writes ' +\n 'publish.ackServerWarnings on, the most direct consent-loosening write on this verb: ' +\n 'it lets one --yes cover the marketplace’s own scan findings, which no payload had ' +\n 'rendered when that yes was given.',\n },\n {\n command: 'tenjin install',\n reason: 'Writes into harness config and skills directories.',\n },\n {\n command: 'tenjin mcp',\n reason:\n 'Long-running server that re-exposes every command core over stdio; ' +\n 'clearing it would indirectly clear everything above.',\n },\n {\n command: 'tenjin update',\n reason:\n 'Replaces the tenjin binary the agent then runs, with whatever npm serves ' +\n 'next. Which build an agent executes is an operator decision, not something ' +\n 'a rule pre-clears. `--check` only reports, but a prefix rule pins the verb, ' +\n 'not the flags.',\n },\n];\n\n/**\n * The flag-surface caveat. A prefix rule pins the verb, never the flags, and the\n * flag that matters is `--base-url`: it is accepted on every leaf, validated only\n * as a URL, and it wins settings precedence, so it moves the destination of every\n * allowlisted verb. Printed with the rules everywhere they are printed, because\n * an operator who only reads the verb list would never learn it.\n */\nexport const FLAG_CAVEAT: readonly string[] = [\n 'Caveat: a prefix rule pins the VERB, not the flags. Every line above also clears',\n '`--base-url <url>` on that verb, which re-points where the question, the probe, the',\n 'session key `read` mints and presents, and (for buy) the signature and payment go.',\n 'Signed and credential-bearing traffic is NOT confined to the paying verb: `read` is in',\n 'the safe tier and both mints a wallet-derived delegation and transmits it, which is why',\n 'that delegation is bound to the origin it was minted for and refused elsewhere.',\n 'Allowlist these verbs only if you are content for the agent to choose the destination',\n 'host, and set the base URL in config instead of letting it be an argument. The skills',\n 'tell agents never to pass --base-url on an allowlisted verb, but that is a convention,',\n 'not an enforced boundary.',\n 'This covers the two rules your publish.mode carries as well, and bites hardest there:',\n '`tenjin publish --base-url <host>` is cleared by default on auto, and it signs against',\n 'the host it is given.',\n];\n\n/**\n * The MCP caveat. `tenjin mcp` is never recommended as a Bash rule, but an\n * operator who registers the server anyway is on a different permission surface\n * (tools, not command strings) where three excluded verbs come back.\n */\nexport const MCP_CAVEAT: readonly string[] = [\n 'Note the asymmetry: publish.mode writes the Bash rules for `publish` and `edit`, and',\n 'deliberately does not touch the MCP tool grants below. The mode is a CLI-side consent',\n 'gate, and nothing reads it on the MCP surface, so clearing those tools would hand out',\n 'the same authority with none of the same gate. Aligning the two is tracked separately.',\n 'Running the local MCP server (`tenjin mcp`) instead? That is a different permission',\n 'surface: the harness gates TOOLS there, and these Bash rules do not apply. Leave',\n '`mcp__tenjin__tenjin_publish`, `mcp__tenjin__tenjin_edit`,',\n '`mcp__tenjin__tenjin_delete`, and `mcp__tenjin__tenjin_wallet` gated. `tenjin_buy` is',\n 'the same opt-in decision as the buy line above. `tenjin_delete` is the one whose own',\n 'core still confirms even if you clear it: it never reads publish.mode.',\n];\n\n/** The machine shape emitted by `tenjin doctor --json` and `tenjin install --json`. */\nexport interface RecommendedPermissions {\n alwaysSafe: AllowlistEntry[];\n optIn: AllowlistEntry[];\n neverAllowlisted: ExcludedVerb[];\n /**\n * Rules the CURRENT publish.mode carries, empty on review. Separate from the\n * three tiers above because it is not a recommendation to weigh: it is what\n * this machine's mode already means, so a consumer that renders it beside the\n * others would be offering a choice that has been made.\n */\n modeGated: AllowlistEntry[];\n /**\n * Whether any harness on THIS machine can carry the rules above. They are\n * `Bash(...)` lines, Claude Code's grammar; a reader that took this payload\n * for a description of a Codex-only machine concluded `publish.mode=auto`\n * was in force while Codex was rejecting `tenjin publish` before the CLI ran\n * (tenjin-agent#342). The document still ships for a harness you have not\n * installed yet, so check this before treating any rule below as granted.\n */\n effective: boolean;\n /** Caveats that qualify the rules above; never omit them when rendering. */\n caveats: { flags: string[]; mcp: string[] };\n}\n\n/**\n * `mode` defaults to the shipped `review`, i.e. no mode-gated rules.\n * `effective` defaults to FALSE, so a caller that has not established such a\n * harness cannot have the payload claim one by omission.\n */\nexport function recommendedPermissions(\n mode: PublishMode = 'review',\n effective = false,\n): RecommendedPermissions {\n return {\n alwaysSafe: ALWAYS_SAFE_ALLOWLIST.map((e) => ({ ...e })),\n optIn: OPT_IN_ALLOWLIST.map((e) => ({ ...e })),\n neverAllowlisted: NEVER_ALLOWLISTED.map((e) => ({ ...e })),\n modeGated: modeGatedAllowlist(mode),\n effective,\n caveats: { flags: [...FLAG_CAVEAT], mcp: [...MCP_CAVEAT] },\n };\n}\n\n/** Every rule this module recommends adding (safe + opt-in). */\nexport function recommendedRules(): string[] {\n return [...ALWAYS_SAFE_ALLOWLIST, ...OPT_IN_ALLOWLIST].map((e) => e.rule);\n}\n\n/**\n * The permission caveats' one home. `doctor` used to print the whole thing —\n * nine rules, both opt-in notes, every exclusion, the flag caveat and the MCP\n * caveat, ~60 lines ahead of the check list it was actually run for. No doctor\n * command in the wider ecosystem carries security prose, and an operator reading\n * a wall of it in a terminal cannot paste from it, search it, or link a colleague\n * to a section. The page can do all three, so it is where the caveats live and\n * where every human surface points; `--json` still carries them as data\n * (`recommendedPermissions`), which is what an agent reads.\n */\nexport const PERMISSIONS_DOC_URL =\n 'https://github.com/BackTrackCo/tenjin-agent/blob/main/docs/agent-permissions.md';\n\n/**\n * The rules the current mode is missing, or null when it needs none. This one\n * DOES name them: they are not a tier to weigh and paste, they\n * are lines that should already be in the operator's settings file, and an\n * operator whose agent is being prompted for work the mode said not to ask about\n * needs to see exactly which rules are missing.\n *\n * CONSULTS THE MACHINE. Rendering from the mode alone told operators to add\n * rules their settings file already had, and named a remedy that in one case\n * would not have written anything — a nag that is wrong twice over on a line\n * whose whole job is to prevent an agent stalling on a prompt (#161).\n */\nexport function modeGatedPointer(\n mode: PublishMode,\n /** The mode-gated rules this machine is actually MISSING. Empty renders nothing. */\n missing: readonly string[],\n /**\n * The command that would fix it. `tenjin install` for the ordinary case; a\n * mode coming from TENJIN_PUBLISH_MODE needs `config set` instead, because\n * install resolves the mode from the global file and would write nothing.\n */\n remedy = 'tenjin install',\n): string | null {\n if (modeGatedAllowlist(mode).length === 0 || missing.length === 0) return null;\n return `publish.mode=${mode} also needs ${missing.join(' and ')} in your harness allowlist, or it will prompt anyway; \\`${remedy}\\` writes them.`;\n}\n"],"mappings":";;;AAyOO,IAAM,yBAAoD;AAAA,EAC/D;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MACE;AAAA,EAeJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MACE;AAAA,EAWJ;AACF;AAGO,SAAS,mBAAmB,MAAqC;AACtE,SAAO,SAAS,WAAW,CAAC,IAAI,uBAAuB,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;AAC9E;AAwLO,IAAM,sBACX;AAcK,SAAS,iBACd,MAEA,SAMA,SAAS,kBACM;AACf,MAAI,mBAAmB,IAAI,EAAE,WAAW,KAAK,QAAQ,WAAW,EAAG,QAAO;AAC1E,SAAO,gBAAgB,IAAI,eAAe,QAAQ,KAAK,OAAO,CAAC,2DAA2D,MAAM;AAClI;","names":[]}
|
|
@@ -17,19 +17,17 @@ import {
|
|
|
17
17
|
hashTypedData,
|
|
18
18
|
keccak256 as keccak2562,
|
|
19
19
|
publicKeyToAddress,
|
|
20
|
+
ripemd160,
|
|
20
21
|
serializeSignature,
|
|
21
22
|
serializeTransaction,
|
|
22
23
|
serializeTypedData,
|
|
23
24
|
toBlobSidecars,
|
|
24
25
|
toRlp,
|
|
25
26
|
validateTypedData
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import {
|
|
28
|
-
ripemd160
|
|
29
|
-
} from "./chunk-RY4XKNV3.js";
|
|
27
|
+
} from "./chunk-N35E6CM2.js";
|
|
30
28
|
import {
|
|
31
29
|
secp256k1
|
|
32
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JRGFKVAZ.js";
|
|
33
31
|
import {
|
|
34
32
|
AtomicReadyWalletRejectedUpgradeError,
|
|
35
33
|
AtomicityNotSupportedError,
|
|
@@ -110,7 +108,7 @@ import {
|
|
|
110
108
|
universalResolverResolveAbi,
|
|
111
109
|
universalResolverReverseAbi,
|
|
112
110
|
withResolvers
|
|
113
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-5IEP5EGE.js";
|
|
114
112
|
import {
|
|
115
113
|
AbiConstructorNotFoundError,
|
|
116
114
|
AbiConstructorParamsNotFoundError,
|
|
@@ -210,7 +208,7 @@ import {
|
|
|
210
208
|
trimLeft2,
|
|
211
209
|
validate,
|
|
212
210
|
validate2
|
|
213
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-EGELTSPU.js";
|
|
214
212
|
import {
|
|
215
213
|
__export
|
|
216
214
|
} from "./chunk-ZXTAQYNA.js";
|
|
@@ -350,7 +348,7 @@ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath4,
|
|
|
350
348
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
|
|
351
349
|
async function recoverPublicKey({ hash: hash2, signature }) {
|
|
352
350
|
const hashHex = isHex(hash2) ? hash2 : toHex(hash2);
|
|
353
|
-
const { secp256k1: secp256k12 } = await import("./secp256k1-
|
|
351
|
+
const { secp256k1: secp256k12 } = await import("./secp256k1-ZZZT2CAX.js");
|
|
354
352
|
const signature_ = (() => {
|
|
355
353
|
if (typeof signature === "object" && "r" in signature && "s" in signature) {
|
|
356
354
|
const { r, s, v, yParity } = signature;
|
|
@@ -10302,4 +10300,4 @@ export {
|
|
|
10302
10300
|
serializeCompactSignature,
|
|
10303
10301
|
signatureToCompactSignature
|
|
10304
10302
|
};
|
|
10305
|
-
//# sourceMappingURL=chunk-
|
|
10303
|
+
//# sourceMappingURL=chunk-AWQPGIR6.js.map
|