Skip to content

fix(policy): hold gopass reads of a stored secret (TK-A021) - #878

Merged
LoopGlitch26 merged 4 commits into
Cygnux-Labs:mainfrom
Seyamalam:fix-gopass-credential-read
Nov 16, 2026
Merged

LoopGlitch26 merged 4 commits into
Cygnux-Labs:mainfrom
Seyamalam:fix-gopass-credential-read

Conversation

@Seyamalam

Copy link
Copy Markdown
Contributor

Refs #737 (claimed there with this case).

What and why

An agent that can run gopass show <entry> — or bare gopass <entry>, gopass cat, otp, edit, env or jsonapi — gets a stored password out with no hold, though TK-A021 already holds the same call in pass (a live credential it can use or send anywhere). gopass is the pass-compatible rewrite of the same tool, reading the same stores; the pack knew it only for TK-D020's whole-store gopass grep, so every gopass read slipped past as allow.

TK-A021's pattern now reads pass|gopass, and the unless list of non-decrypting subcommands gains gopass's (create, move, sync, clone, mount, mounts, config, setup, history, hist, templates, completion, update), so routine store work isn't held. gopass recipients stays held — it changes who can decrypt the store — as do cat, edit, otp, env, jsonapi, audit, pwcheck and git-credentials.

One corpus case added (tests/data/policy/deny/shell.jsonl), the coding pack bumped to 2026.11-v2-85, and E17/E21 results regenerated so each policy_hash names it.

How I ran it as a user

  • python eval/e17_policy_corpus.py: before the rule change the new case printed under missed:; after it, TOTAL deny recall 100.0%, benign FP 0.10%, engine mismatches 0 — still the one known false alarm (the draft email, TK-M003).
  • python eval/e21_robustness.py: 952 deny corpus cases, original: 952/952 contained, each rewrite form 100% (bash-c, env bash-c 603/603), 0 misses, 0 engine mismatches — so bash -c 'gopass show …' is held too.
  • python eval/e21_policy_robustness.py: rerun; machine and latency left as main has them.
  • tracekit policy lint tracekit/policy2/packs/coding.yaml → ok.
  • python -m pytest tests/test_signer_policy.py tests/test_eval_docs.py → 276 passed, 36,059 subtests. The new cases in test_credential_store_commands_as_their_tools_read_them cover show, bare-name, cat, otp (held) and ls, insert, sync, clone, mounts, config (not held).
  • make lint and make build pass. Docs quoting the E17/E21 counts updated (README, docs/evaluation.md, docs/policy-v2.md, the CI comment).

Checklist

  • make check passes (lint, tests, build); make test-ts too if sdk/typescript/ changed
  • a regression test covers the change
  • user-visible changes are described above (release notes are written at release time; don't edit CHANGELOG.md)
  • docs updated if behaviour or a security claim changed (docs/threat-model-laptop.md, docs/threat-model-server.md)
  • every commit is signed off (git commit -s, see CONTRIBUTING.md)

Security invariants

  • the agent still never holds a signing key or assigns sequence numbers
  • nothing an agent-controlled process supplies (isolation level, fail mode, gap/tamper records, approval identity) is newly trusted by the signer or verifier
  • gaps are still signed, never silent; a check that cannot run warns instead of passing
  • no verification code is shipped inside a bundle

Evidence format

  • this change does not touch the frozen formats: v1 (core.sig_message, ledger.make_record, the v1 schema, how the verifier treats existing bundles) or the published v2 format
  • or, if it does: the issue explicitly asks for it, existing bundles (including docs/sample/ and tests/fixtures/) still verify, and the change is called out above

`gopass show`, bare `gopass NAME`, `gopass cat`, `otp`, `edit`, `env`,
`jsonapi` and every other decrypting subcommand print or hand out a
stored password, as `pass` does, but TK-A021's `^pass\s+\S` never named
gopass, so the pack knew it only as TK-D020's whole-store `gopass grep`.
The rule now reads `pass|gopass`, and the `unless` list gains gopass's
non-decrypting subcommands (sync, clone, mounts, config, setup, history,
templates, completion, update, create, move) so routine store work isn't
held; `gopass recipients` stays held, since it changes who can decrypt.

Adds one deny corpus case and regression coverage; bumps the coding pack
to 2026.11-v2-85 and re-runs E17 and E21 so each policy_hash names it.

Refs Cygnux-Labs#737

Signed-off-by: Seyamalam <seyamalam41@gmail.com>
@LoopGlitch26

Copy link
Copy Markdown
Member

Thanks, @Seyamalam. The holds and the benign twins are the right shape, and gopass cat and gopass otp held is exactly the point. Two things before this can merge:

  1. find and search shouldn't be in gopass's unless. In the gopass versions I know, gopass find <term> and gopass search <term> show the secret itself when exactly one entry matches, where pass find only lists names. Please check it against the gopass version you test: run gopass find with a term that matches one entry, and say what it printed (redacted). If it shows the secret, split the unless: pass keeps its list, and gopass gets its own list without find and search, with tests gopass find email → TK-A021 and gopass ls still benign. Do the same check for any other subcommand you added that could print a value (create at the end of its wizard, templates show, history). Keep a subcommand in unless only if you've seen it print no secret.
  2. The pack version. TIPS: lessons from signed runs, approved by a person, given to the next session (#859) #866 also takes 2026.11-v2-85. Whichever merges second moves to the next one and re-records the evals, with tests/test_eval_docs.py's quoted numbers too. If TIPS: lessons from signed runs, approved by a person, given to the next session (#859) #866 lands first, merge main and take v2-86.

Split TK-A021's unless per review on Cygnux-Labs#878: `pass find`/`search` only
list names, but gopass's showed the secret itself on a match until
gopass removed the direct show, so gopass's exemption list drops them —
an agent on an older gopass gets a held call, not a password. Tested
against gopass 1.17.4: `find`/`search` print only the entry name today;
`generate`, `create`, `templates show`, `history`, `sync`, `clone`,
`mounts`, `config`, `setup`, `completion`, `update` and `move` print no
secret and stay exempt.

Adds `gopass find`/`search` to the held cases and `pass find` to the
benign ones; re-runs E17 and E21 for the new policy_hash.

Refs Cygnux-Labs#737

Signed-off-by: Seyamalam <seyamalam41@gmail.com>
@Seyamalam

Copy link
Copy Markdown
Contributor Author

Both done, pushed as 4e454419.

find/search. Tested against gopass 1.17.4 (the current release, in a scratch store with a throwaway GPG key): gopass find infra matching exactly one entry printed infra/db — the entry name only, not the secret — and search is an alias of find with the same output (gopass show infra/db prints the password, gopass find infra/db the name). But gopass's own changelog has "Avoid direct show on gopass search", so releases that did show the secret on a match are in the wild, and the pack has to hold for whichever version the agent runs. The unless is split as you asked: pass keeps find/search, gopass's list drops them. Tests now cover gopass find email → TK-A021, gopass search infra → TK-A021, pass find exa → benign, gopass ls still benign.

The other added subcommands, each run against 1.17.4 (secrets redacted to S3cr3t-gh-… where shown):

  • generate — prints Password for entry "…" generated / Not printing secrets by default.; the new password is not printed.
  • create — an interactive wizard; aborts cleanly on EOF and prints nothing. Its -c/-C options only expose the secret just created, same as pass generate.
  • templates show — prints a .pass-template message skeleton (Hello {{ .Name }}), not an entry.
  • history — prints the store's git log (<sha> - <author> - <date> - Save secret <name>: <action>); names only, no values.
  • sync, clone, mounts, config, setup, completion, update, move — progress/config output only, no secrets.
  • Left held: recipients (changes who can decrypt), audit/pwcheck/fsck/convert (whole-store reads or rewrites), cat, edit, otp, env, jsonapi, git-credentials, binary, sum (all can emit secret material).

Evals re-run and committed: E17 952/952, FP still the one draft email; E21 all rewrite forms contained, 0 misses, engines agree. machine/latency in e21_policy_robustness.json left as main's.

Version. #866 is still open, so this keeps 2026.11-v2-85; if it lands first I'll merge main, take v2-86, and re-record.

@LoopGlitch26

Copy link
Copy Markdown
Member

Thanks, @Seyamalam. This is exactly the check I hoped for: each subcommand run against gopass 1.17.4, and find/search kept held because older releases showed the secret (gopass's own changelog says so). The split unless is right, and the tests cover both sides. Ready from my side once CI is green; a maintainer approves the first run for a new contributor. If #866 lands first, take v2-86 as you said.

@LoopGlitch26

Copy link
Copy Markdown
Member

@Seyamalam #866 has landed with 2026.11-v2-85, so as agreed: merge main into this branch, take v2-86, re-record E17 and E21, and run tests/test_eval_docs.py (docs/evaluation.md quotes E21's latency rows) before pushing.

…nded, take v2-86)

Cygnux-Labs#866 took 2026.11-v2-85; bump the pack to 2026.11-v2-86 and re-record
E17 and E21 against the merged packs. eval/results conflicts resolved by
regenerating; e21_policy_robustness machine/latency kept at the recorded
reference.

Signed-off-by: Seyamalam <seyamalam41@gmail.com>
@Seyamalam

Copy link
Copy Markdown
Contributor Author

Done. Merged main (includes #866), pack is now 2026.11-v2-86, E17 and E21 re-recorded against the merged packs (eval/results regenerated rather than hand-merged; e21_policy_robustness machine/latency kept at the recorded reference), and tests/test_eval_docs.py passes — the E21 latency rows docs/evaluation.md quotes still match. Full tests/test_signer_policy.py also green.

@Seyamalam

Copy link
Copy Markdown
Contributor Author

The Speed py3.9 on macos-latest failure was TK-M003 only — server-comms.yaml is byte-identical to main (untouched by this branch and by #866), so the pattern's search time can't differ between the branches. On that runner (py3.9 → regex 2026.1.15, the last cp39 build) the four "to":[…] list fillers measured 111-124 ms in the alone re-search while machine_scale came out ~1.7, putting the 0.06 budget at ~102 ms. The same pattern passed this job on the earlier head and on main's last run — a marginal overshoot, not a regression.

Pushed a fix following the TK-A040 precedent: RULE_BUDGET_S for TK-M003 raised to 0.12 (10x its ~12 ms M-series reference, still far under a real rescan at 0.3 s+), with the observed CI range noted in the comment. Speed test re-run locally: green.

@LoopGlitch26

Copy link
Copy Markdown
Member

Thanks for tracing it. Please drop the budget commit from this PR. The Speed job on macOS and Windows is advisory (continue-on-error), so that miss doesn't block the merge. Raising TK-M003's budget is a separate change: bring the numbers to #722 if it repeats on main. Once the branch is back to the gopass change, CI runs again and I'll review the result.

@Seyamalam
Seyamalam force-pushed the fix-gopass-credential-read branch from e96e989 to e0fa17f Compare November 16, 2026 10:47
@Seyamalam

Copy link
Copy Markdown
Contributor Author

Done — dropped; the branch is back to the gopass change at e0fa17ff. If the TK-M003 timing repeats on main I'll take the numbers to #722.

@Seyamalam

Copy link
Copy Markdown
Contributor Author

For the record on the earlier run: the py3.13 on windows-latest miss was also advisory — test_constraints.py's grammar-parser linearity bound (0.1875 s vs the 8x allowance on a slow runner), unrelated to this change.

@Seyamalam

Copy link
Copy Markdown
Contributor Author

Branch is gopass-only + the main merge now (v2-86). On the two check failures: both are timing misses on advisory jobs, not merge-induced — server-comms.yaml, tests/test_policy2.py and tests/test_constraints.py are all byte-identical to main (TK-M003's pattern dates to d5008e9, Oct 10), so the branch can't change either measurement. Locally TK-M003's worst "to":[…] filler runs ~52 ms against an ~87 ms budget when the box is quiet, but ~360 ms under load — the pattern scales worse under contention than machine_scale's linear reference search, so a busy runner can overshoot its scaled budget (~102 ms there) by ~15%. The grammar linearity subtest likewise sits at its bound: one subfail, two passes in three runs here. Left the bounds alone per your note; if TK-M003 repeats on main I'll take the numbers to #722.

@Seyamalam

Copy link
Copy Markdown
Contributor Author

py3.13 on macos-latest (advisory): test_grants.py's grant-flood decide hit 1.14 s vs the 1 s CPU bound on the regex backend — a 64 KiB -y flood decided against the dev pack. Both dev.yaml and test_grants.py are byte-identical to main (this branch only touches coding.yaml), so it's the same class of busy-runner miss as the other two.

@Seyamalam

Copy link
Copy Markdown
Contributor Author

Measured this one rather than assume — the dev pack does extend coding.yaml, so my TK-A021 change is in the composed policy here. Direct benchmarks of the exact failing decide (tracekit grant --signer s + 21,800 -y flags, regex backend, CPU time), branch vs an origin/main worktree on the same machine:

  • flood decide: branch 78-83 ms (min/med 78/83), main 77-80 ms (77/80) — identical within noise
  • neutral decides, 200x each: branch 0.213-0.221 ms, main 0.194-0.216 ms — no per-decide overhead from the added pass|gopass alternation (it's ^-anchored, fails fast on non-matching commands, and the unless only runs when the pattern matches)

So the 1.14 s on the runner is the same ~80 ms decide on a shared macOS box under load, 14% over the 1 s bound — a margin miss, not a regression. Same class as the other two advisory misses; TK-D012's grant flood is the same shape on main.

@LoopGlitch26
LoopGlitch26 merged commit 4e6e04a into Cygnux-Labs:main Nov 16, 2026
80 of 83 checks passed
@LoopGlitch26

Copy link
Copy Markdown
Member

Merged, thanks @Seyamalam. Measuring the decide instead of assuming was the right call. You've now seen three of these runner misses up close, so I opened #890 for exactly that: make the three speed checks hold on loaded runners without testing less. It's yours if you'd like it.

LoopGlitch26 added a commit that referenced this pull request Nov 17, 2026
* Policy: read every way a call reaches a protected file, a harness's settings or a shell line

The packs held a file tool's write to a credentials file, a startup file, a Git hook or a harness's settings, while
other routes to the same effect went by. Each class now has one reader:

- every writer the effects field knows (sed -i, perl -i, truncate, dd of=, awk's print >, find -exec on the names
  its -name tests) is read for those files: TK-D014 (credentials, deny), TK-A067 (startup items), TK-A068 (Git
  hooks), TK-F024 (shell startup files, flagged; held on strict)
- a pathname pattern is also read as each protected name it may stand for (.bashr?, authorized_key?, id_*,
  .git/hook?/), in a redirection and an argument alike; a for loop's brace words are its values
- Hermes Agent's settings: ~/.hermes in TK-F009/TK-F015, `hermes plugins disable tracekit` (TK-A054), `hermes
  config set` and `profile use` (TK-A069); a harness CLI started with another HOME, settings variable, env -i or a
  settings option is held (TK-A070, the harness_launch field)
- an unmapped write_file, patch, read_file or search_files is also decided as the file tool it is, and Hermes's
  process_manage write or submit as the shell line it types; the stricter decision stands
- a `commands` list is read joined and entry by entry
- SQL: `/*/` inside a PostgreSQL comment opens a nested one, a dollar-quote tag may hold a letter past ASCII, and
  MySQL's -- starts a comment before any control character
- typed text (Codex's write_stdin, agy's send_input, Devin's write_to_process, Hermes's process_manage write) that
  leaves its line unfinished or holds a control character is blocked in the hook; \r is a line end
- OpenCode 2's `path` and `shell`; an MCP round's input_responses are decided and recorded with its arguments

Pack versions: coding 2026.11-v2-81, strict 2026.11-strict-11. E17 and E21 regenerated: no corpus call is decided
looser, no benign call newly held, held-out recall 256 and 286 of 420.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: read ruby -i as an in-place editor, as sed -i and perl -i are

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: read harness launches, typed lines, writers and patterns as they run

- A `commands` list's joined reading stands where one entry can't be read alone (a heredoc across entries).
- TK-A070 holds only what moves or turns off a harness's hooks, plugins, approvals or sandbox: HOME,
  XDG_CONFIG_HOME and the harness's own variables set in any way bash sets one, env -i or -u of them,
  --settings, --setting-sources, --bare, --config, --profile, and codex -c for its hooks, notify, sandbox,
  approvals or profiles keys. Model, effort and MCP options and other tools' variables pass. It reads the
  harness through npx, bunx, pnpm dlx, a JavaScript runtime on its package, python -m hermes_cli, xargs and
  words built at run time. Hermes's plugin disable and config commands are read the same ways.
- Typed text a terminal hasn't finished reading is kept per terminal and decided with the next call as the
  line it completes. Keys typed alone wait for that line. Devin's control characters stay blocked as before,
  and a live shell's HOME or harness variables count as shell state.
- Writers: sed, perl and ruby in-place switches in any cluster or versioned name, BSD sed's -i suffix, awk
  output through variables or concatenation, gawk -i inplace, the programs that write an option's or operand's
  file (sort -o, uniq, ex, vim -es, xxd -r ...), find on its start paths and protected names (negated tests
  find nothing), find | xargs and echo | xargs writers, find -fprint, and a command after cd in its folder.
- Patterns resolve every part at once and read [^x], [!x] and POSIX classes.
- V4A patch headers are read as Hermes's parser reads them, Move File: a -> b included.
- A $ after an identifier's byte past ASCII opens no dollar quote.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Tests: the joined typed line test puts back the hook's agent name

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: decide typed text on its own and joined, match patterns in linear time

- A typed-input call is decided on its own text and, under typed_line, as the line a shell there would read
  it into; the stricter stands, since the hook can't tell a shell from a pager that took a key. Keys typed
  alone (Esc, Tab, an arrow) are allowed and aren't kept; keys among text hold their line until a ^C. A line
  ends at \n, \r, Ctrl-O or a ^D flush, for Hermes too. A call that names its terminal twice is refused.
- A pattern is matched token by token in time linear in its length, a run of * as one star, with
  equivalence and collating classes, and the dotglob, nocaseglob or GLOBIGNORE the line sets; extglob's
  syntax is held as unreadable.
- A find reaches the protected folders (.ssh, .git, .claude ...) only from a home or /; a pattern after a cd
  joins only as the protected names it may make.
- TK-A070 reads codex --disable of a hooks feature, -c with one anywhere in its value and `codex features
  disable`, every way bash sets or unsets a variable (loops, getopts, unset, a nameref's target, ${X:=}),
  positional words and variables the line gives no value, runners' versions, pnpx, a runtime's options
  before the script, harness path, root and data variables, and env's own words only before its command.
- Writers: env -C's folder, awk's print > FILENAME, patch's file after its valued options and in its -d
  folder, vi, vim and nvim unless read-only, and xargs fed by printf's text or by a stage that may print a
  protected name.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: read gh as cobra does, the whole environment sent, REST writes and dry runs

- gh's options before its command are read after it, as cobra parses them (`gh -X PUT api ...` is
  `gh api ... -X PUT`), so the rules on gh api, pr merge, repo sync and secrets read every order.
- TK-D015 denies the whole environment (env or printenv alone, export, set, declare -p, a process's
  environ file) printed into a program that sends it off the machine: a later pipeline stage, the
  sender's words or herestring, or a block or subshell piped to it. The parse records where each
  command's output goes (reaches) for this.
- On dev, TK-A056 reads GitHub REST writes through curl, wget, HTTPie and xh as it reads gh api's:
  main's ref, contents put or delete, merges.
- A publish with --dry-run is read as the dry run it is, as kubectl's is.
- The PowerShell tool is read as a shell line in any case.
- A policy may set `oversize: deny` again over the laptop default's ask; the docs list oversize as
  the dev pack's fourth difference and in the file format, and the E21 page's gate figures match its
  results.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: read a download nothing can run, and text written into data files, as data

- TK-D002 keeps reading a download followed by a shell or interpreter as 1.5.3 did, but a download
  no command on the line can run is data: a status check (-o /dev/null, -I, --spider; what -w
  prints), and a save of only data files (.json, .csv, .html, an image, a font) on a line that
  doesn't move, link, unpack or load them, sets no loader variable, runs no interpreter
  interactively and runs none of them; a project script given one as data or inline code that only
  reads one runs none. A download's text piped into code or kept in a variable still stops.
- Text printf, echo, cat or tee writes into notes, log or data files (.md, .txt, .log, .json, .csv,
  a memory, notes or reports folder) is data whatever follows it, unless the line runs one of those
  files or the text goes on down a pipe; text into an interpreter's stdin stays code.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: coding pack v2-82 on main with Cline; E17 and E21 recorded again

- The coding pack moves to v2-82 (main's #732 took v2-81); strict stays at strict-11.
- A `commands` list's entries are read on their own by Engine._parse, as main now does, so _shell
  reads the joined list only; what the parse learned as a dict (the names given a value) is merged
  across the readings too.
- An MCP round that resumes under its decision (main's #718) goes on as before; one whose answers
  carry content is decided as a call of its own, with its answers recorded under input_responses.
- E17 and E21 recorded with the merged packs; the latency rows stay main's reference run.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: read downloads and notes as data only on an allow-list; typed keys, glob options, gh, the environment

Round 6 of the sec08 review: each exception now names what it permits.

- TK-D002: a download is data only when every option it gives only fetches, it names one URL, and it is a
  status check (-o /dev/null or --spider, -w printing only a status, size, time or count), or what it saves
  goes to data files on a line whose other commands are pure readers (cat, head, tail, less, wc, grep, rg,
  jq, yq, sha*sum, md5sum, file, stat, ls, diff, cmp), commands that read no file, or such downloads. An
  interpreter, runner module, inline code, project script, copy, -D or trace file, wget -i keeps main's deny.
- Text written into a data file is data only when every other command is on an allow-list and those that
  name the file only read and print it, write text into it, post it (gh) or commit it (git add, commit);
  a copy, move, link or append of it anywhere keeps main's reading.
- The glob reader and the data-download reader are linear and charged to the parse budget (40,000 `[`
  took 156 s; 2,500 downloads 39 s); past it the line is held as unread.
- A typed line counts wherever a deny or ask rule matches it, TK-SHELL-PARSE too; Tab, Up, Down, Page Up
  or Down, Ctrl-P, -N, -R, -S and -Y sent alone leave the line unknown (a NUL the parser reads as unread),
  so the Enter after them is held; the line is also decided without the mark.
- Glob options set by bash -O, BASHOPTS, a quoted or built shopt name or a GLOBIGNORE in any form are
  read; ones the parser can't read (a variable, zsh's setopt) hold a pattern they may widen. Collating
  symbols by name and single-character equivalence classes read as bash reads them; find's -name lets
  * match a leading dot; ls and chmod read only a pattern's bracket names, as on main.
- TK-A071 holds a gh alias set, imported or used, an extension installed or run, and gh's editor, pager
  or browser set; a GraphQL query from a file, stdin or a substitution is held as unread.
- TK-D015 reads the environment written to a file then sent, jq's env, awk's ENVIRON, os.environ and
  process.env dumps, ps e, any /proc environ path, a subshell or >() sender, /dev/tcp, a heredoc's $(env)
  and gh bodies from stdin; a remote host's environment (ssh host env) is no longer denied.
- sh -c's literal words are its $0 to $9 (a find -exec script's {}), a bare for loop reads them, and
  awk's ARGV[n] is its n-th operand.
- yarn publish --dry-run is held again (Yarn 1 may publish).
- E17 and E21 recorded again; E21's latency rows stay main's reference run.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Docs: TK-A071 holds a gh command word set at run time

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: each file a download writes is a write target; one it can't name is held

Round 7 of the sec08 review. A download over a harness's settings or hooks (`curl -so .claude/settings.json`,
`curl -sO …/settings.json` in .claude, `wget -qO .mcp.json`, `wget -P .claude …`) was only flagged: the effects
read curl's and wget's output options as exact `-o`, `--output`, `-O` and `--output-document` words, so a clustered
`-so`, `-qO`, curl's -O URL name, wget's -P folder and its abbreviated options wrote nothing.

- shell.download_writes reads curl's (8.x) and wget's (1.21) argv on a table of all their options: each -o in any
  cluster, each URL's name with -O or --remote-name-all in --output-dir, the header, cookie, trace, error and cache
  files; wget's -O, each URL's name in its -P folder, its log and cookie files, its long options by unique prefix.
  Every one is a WRITE_TARGET for every write rule (TK-F015, TK-D014, TK-A068, TK-F024 …).
- A download whose file the line can't name (a variable it gives no value, a substitution, a pattern, curl's #1 or
  {{name}}, -K or wget's -e or --config, a URL list, -J or --content-disposition, a recursive fetch, an option the
  table doesn't hold) holds the line as unread: TK-SHELL-PARSE, cause `output`.
- The round-6 allow-list for data downloads is unchanged: a download is data only when every file it writes is a
  data file.
- E21 recorded again: one blind-pool benign call, `curl --dry-run` (no curl option), is held now (blind FP 10 to
  11); its latency rows stay main's reference run.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: the download-option table is curl 8.7.1's own list, checked by a test

The table round 7 wrote from memory is now compared with curl 8.7.1's `curl --help all`, kept in
tests/data/curl-8.7.1-help-all.txt: every option there is in the table with its arity and short letter (it already
was: 137 that take a value, 121 flags, 59 letters), and a test fails if the two drift.

- Options beyond 8.7.1 are named in shell._CURL_NEWER with the release that added each: --ech (8.8.0), --ip-tos,
  --vlan-priority, --keepalive-cnt, --mptcp (8.9.0), --show-headers, --skip-existing (8.10.0), --ssl-sessions
  (8.12.0), --upload-flags (8.13.0).
- Five the table held without a release to name are dropped, so curl reading them is held as an option the table
  doesn't know: --knownhosts, --parallel-max-host, --sigalgs (taking a value), --follow, --out-null (flags).
- wget: the table follows GNU wget 1.21's manual. --input-metalink takes a file (it was read as a flag) and names
  files the reader can't (held); --metalink-index and --preferred-location take a value; --ask-password,
  --no-if-modified-since, --no-use-server-timestamps, --random-wait and --keep-badhash are flags; enable-feature,
  no wget option, is dropped.
- The limits row says which curl and wget releases the tables follow.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* signer: a replay ends a consumed call's decision only when a later result ran under its approval

The writer ends it when the later result's arguments open the approval; the replay ended it on any result of the
call attempt, so after a restart that replayed the records the run closed with no decided_not_completed gap for an
approved call that never completed. An ask's result ran under it unless its executed_against_policy gap follows.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Provenance: an untrusted input observed as a digest makes the index partial; the MCP gateway lists in parts

The signer's observe indexed whatever value it was sent, and a digest carries no values, so an untrusted input sent
as a digest left the run's provenance index complete without what it said. The MCP client and gateway send a list
page (and the gateway a resource, the A2A gateway an event) over half a frame as its digest: a server that padded its
tool list past 512 KiB turned from: untrusted rules off, so send_email to the address its description named was
allowed, where the same list unpadded held it. observe now marks the index partial when an untrusted value is a
digest (a sha256: string or a {hash, size} reference), as complete already did for an untrusted tool's result.

A listing sent as one observe of more than 4096 values truncated the index instead (about 300 tools), so every
from: untrusted rule held every call it matched for the rest of the run. The MCP gateway now records a listing in
parts of whole items that each fit one observe (sdk.client.parts: 512 KiB and 4096 values), so the index reads all
of it, and records a part once per run. One item over 512 KiB is still a digest (partial), and a listing past the
run's 20,000 values truncates the index.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* MCP client: record a list page and a round's input requests in parts the signer indexes

A page over half a frame went as one digest, which now makes the run's provenance index partial, and a page of more
than 4096 values (about 300 tools) truncated it: either way every from: untrusted rule held every call it matched for
the rest of the run. The client now observes a page, and a round's input requests, in parts of whole items that each
fit one observe (sdk.client.parts), as the gateway does, so the index reads all of it and stays complete: with 300
tools, send_email to the address the task named is allowed, and one to an address a tool's description named is
held with the description as its source. One item over 512 KiB is still sent as its digest (partial), and a list
past the run's 20,000 values truncates the index.

The client doesn't skip a part it recorded before: under instrument() an observe goes to the current run, which the
session can't see, so a skip could leave a later run's index without the list.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* cline: decide the legacy extension's tools; v1 entries, hook time, init order, approver text

- Map the tool names of Cline's legacy VS Code bundle (execute_command, read_file,
  write_to_file, new_rule, replace_in_file, list_files, search_files,
  list_code_definition_names, web_fetch, browser_action, web_search, use_mcp_tool,
  access_mcp_resource, attempt_completion) onto the tools the policy reads, from the
  string parameters its handlers read, including a Gemini model's fixed command and
  a path or command without a multi-root workspace hint. A Cline tool Tracekit
  doesn't know whose input names a path, a command or a URL is cancelled.
- v1 policy: decide each entry of a commands, paths or urls list.
- Bound a Cline hook's whole run at 25 s; a hook still running then answers a
  cancel for a tool call.
- init and uninstall --agent cline check all five hook files before changing any.
- System init reads the agent user's Documents folder for the extension's warning.
- A held call on several commands, files or URLs shows every one to the approver
  (tracekit approvals list, the v1 approval summary); v1 records keep such lists
  in clear, as they keep one command or path.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: read every subject a rule can read, the environment sent from any group, two branch fields

- A rule stopped reading its subjects at the first one over 64 KiB and took TK-OVERSIZE, so a long word
  hid a later command or path from it; on dev (oversize: ask) that turned a deny into a hold. A rule now
  matches every subject it can read and takes TK-OVERSIZE only where it matches none.
- On dev, TK-OVERSIZE is held only for a call that is itself over 64 KiB (its arguments as JSON). A
  smaller call whose reading makes a subject that long (a variable expanded several times), or with more
  than 64 URLs, is denied, as on a server.
- TK-D015 reads a sender anywhere in a later pipeline stage: behind a wrapper in a subshell, in a { }
  group, if or loop after its first command, in code a shell or eval runs, in a substitution or process
  substitution. The parse records a block's opening stage as well as its closing one.
- gh api with two branch fields, and a REST body with two branch values, is a branch the line can't tell:
  held on dev, as one read from a file is.
- The comment on `run` says dev holds an unread call.
- Tests: metamorphic sweeps over long words and arguments (192 shell spellings, 10 argument cases, every
  pack), the environment sent (214 spellings and 126 benign ones, every pack, both engines), and 132 gh api
  field spellings.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* cline: read here-docs and trim with JavaScript's whitespace

Cline finds a run_commands here-doc's delimiter and its closing entry with
JavaScript's \s and trim(), which take neither \x1c-\x1f nor \x85: such an entry
opens or closes no here-doc there, and each entry runs on its own. JS_TRIM and
CLINE_HEREDOC now use the same whitespace set (JS_SPACE).

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: a publish is a dry run only as nopt reads --dry-run

npm and pnpm read their options with nopt, which takes a `true` or `false` right after a boolean option as its
value, an unambiguous abbreviation (`--dry=false`), one dash or three (`-dry-run=false`) and `no-` in any case
(`--NO-dry-run`). `npm publish --dry-run false` publishes, but _publish_dry_run read it as a dry run, so TK-A056
let it through flagged where main held it. A publish is now a dry run only when its last --dry-run is bare or
=true, not followed by `false`, and no other spelling nopt reads as the option is on the line.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: a download URL urllib can't split leaves its file unread

download_writes named the file a curl -O or wget download writes with urllib.parse.urlsplit, which raises on a
bracket that is no IPv6 host (`curl -O http://[::1/x.sh`, `wget https://[bad/.bashrc`). The engine failed on the
line and the signer denied it as TK-ENGINE-ERROR, logging the traceback. Such a URL's name is now one the line
can't tell: the line is held as unread (TK-SHELL-PARSE), as a name built at run time is.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: dry runs a runner extends, curl-glob URL names, REST branch spellings, runner-filled branches, npm pub

Fixes from the adversarial review of the 1.7.0 policy batch.

- A publish or kubectl dry run that xargs, parallel, find -exec or fd -x runs is no dry run: the runner may add
  `false` or --dry-run=none at run time. _pushes now reads the runner before the dry run; a word with a pattern
  (*, ?, [) or find's {} is one the line can't tell, so `npm publish --dry-run fals?` is held too.
- A download URL urllib can't split (curl's glob `http://10.0.0.[1-2]/.env`) is named from its raw path, so it is
  denied as its plain-host twin is, not held as unread. With no path after the host it stays unread.
- A REST body's branch is read as JSON reads it: a repeated key, a top-level branch other than the one the text
  shows, or an escape or quote in the value (`main`, HTTPie's `branch:='"main"'`) is a branch the line can't
  tell.
- A gh api branch a runner fills in (xargs -I's or parallel -I's string anywhere in it, a {...} word under xargs,
  parallel, find or fd) is a branch the line can't tell.
- npm runs pu, pub, publ and publi as publish (abbrev over its command list); TK-A056 (dev) and TK-F004 (coding,
  strict) read them. dev pack 2026.11-dev-5; E17 and E21 policy hashes recorded again.

Main's corpora (E17, E21 held-out, blind, sessions and rewrites; 5,410 calls, every pack, both engines) decide the
same on 3d4465f44f and here.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: v1 path rules take `\` or `/` between a path's parts

The v1 default policy's path rules (TK-D005, TK-D008, TK-D009, TK-D010,
TK-D011, TK-F005, TK-F009) named folders with `/` only, so a Windows
path such as C:\Users\u\proj\.env or \\server\share\proj\.env read as
no match. Each separator is now [/\\]; the .env template exceptions and
the memory-notes exception keep their meaning. Default policy 2026.10-3.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: shell targets and lines also read `\` as `/`

A path a shell call names with `\` (Git Bash keeps one in quotes or escaped:
cat 'C:\Users\u\.kube\config') is now read by the shell rules as Windows reads
it, as the file rules already read one:

- each shell target (engine._path_forms: TK-D010, TK-A011, TK-A013, TK-S004,
  TK-F005, TK-D007's tags) and each line the parser normalised (the `line`
  field: TK-D011 and the others) is also read with `\` as `/`;
- a file a line writes text into is checked as a startup file also in its
  resolved form (_normal), as write targets are, so echo '...' >> 'C:\u\.bashrc'
  keeps its text as code (TK-D002).

A second reading: it only adds matches. In a line the parser reads, a `\` it
read as an escape is gone by then; a line it can't read (held as
TK-SHELL-PARSE) is decided on its text as written, so that text is also read
with `\` as `/`. The raw command (`field: command`) is read as written only.

Main's corpora (E17 deny and benign, E21 held-out, blind pools, sessions and
rewrites; 5,410 calls, all 10 packs, both engines): no decision looser, no
benign call changed; one harmful held-out call (a PowerShell line the parser
can't read) is denied on dev, server-core and server where it was asked.
E21's held-out results and docs/evaluation.md record it. Packs unchanged.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: program names and homes also read as Windows reads them

A program a shell call runs by a path with `\` (Git Bash keeps one in quotes
or escaped: 'C:\Git\bin\bash', '.\x.sh') is now read as the program that path
names, as one with `/` is; a .exe name in any case (SUDO.EXE) as that program.

- shell.base_name: a word's name after its last `/` or `\`, casefolded and
  without a .exe; engine._program uses it, and the engine's program checks
  (package indexes, container access, effects, unread writers) use that.
- The parser reads a first word with `\` again as a command of its own with
  that `\` as `/` (emit), so its name, its wrappers and nested shells, the
  file it runs and the stdin it reads are those of its `/` twin.
- The files a line writes, downloads or copies Tracekit to, the #! line of a
  script it runs, a container's rm, awk's pipe into a shell, find -exec, the
  writer a git or container command runs and an unmapped tool's one-word
  command read names through base_name.
- TK-D004: a recursive rm, find or rsync on a Windows drive's root or a home
  on it (C:\, c:/Users/u, /c/, /mnt/c/, %USERPROFILE%, $USERPROFILE,
  $env:USERPROFILE) is read as root or home (_home_readings).
- E21's command-prefix rewrite counts a command read both ways as one.

Each reading is added: the line as written is read as before. Main's corpora
(E17, E21 held-out, blind pools, sessions and rewrites; 5,410 calls, all 10
packs, both engines): no decision changed. Packs unchanged.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Tests: tracekit audit names a pre-4.0 Cline task's calls as the hook maps them

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Harness launches and typed input: Copilot CLI, CodeBuddy Code, gptme; publish after options

- TK-A070 and the live-shell state check read Copilot CLI (copilot, @github/copilot, COPILOT_*, --config-dir),
  CodeBuddy Code (codebuddy, codebuddy-code, cbc, codebuddy-lowmem, @tencent-ai/codebuddy-code, CODEBUDDY_*)
  and gptme (gptme, its front ends, python -m gptme; its --profile is not a settings option).
- Copilot's write_bash and write_powershell join earlier unfinished typed text, keyed by session and shellId,
  as Codex's, Devin's and agy's typed input is.
- TK-F004 reads a publish after up to eight options, as TK-A056 does (npm --dry-run publish).
- Tests for the v1 hook's joined line, legacy Cline calls its hook can't read, and hint trimming.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell: a loop's values are read in each line a rule reads, past the fourth and in a redirection's target

A loop over several values decides at least as strictly as each value written in:
- a redirection's target with known variables is read with each literal they may hold, the command's
  words in the same reading (for f in a ~/.bashrc; do echo ... >> "$f"; done);
- a literal's or a pattern's reading past the fourth is a line too, of the command's pipeline alone,
  so a loop over many words reads each once without copying the whole line.

Test: #683's differential over E17's shell corpus, both engines, two values and six.
Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy engine: the same decisions in less time

- shell.base_name reads the name once and keeps the last 256 it read (a decision asks it of each
  command's program many times).
- harness_launch reads nothing more on a line that starts no harness and no env.
- _glob_options searches for the shell options only in a line holding a word they need.
- _environment_dump searches a command's words for an environ file only when one holds
  /proc/ or environ (or the line writes the environment into a file).
- _slashes builds its set only for a text with a backslash; _drop_program's patterns are compiled once.

Main's corpora and rel170's own (E17, E21 held-out, blind pools, sessions, rewrites; 10 packs, both
engines), the Windows twin probes and the 64 KiB stress lines: no decision changed.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* E21: --record caps each p99_ref 5% over the highest of four runs; results recorded again

- e21_policy_robustness --record measures each pack and engine three more times and caps its p99_ref
  5% over the highest of the four, as each cap recorded again by hand was (a new pack or engine's first
  cap stays 25% over its one run). Gates recorded again with it: default 8.05 / 9.21, strict 7.6 / 8.43,
  dev 8.16 / 9.35 on RE2 / regex.
- E17 policy corpus, E21 robustness: the packs' new policy hashes, no score changed.
- E16 doctor: init's hint names the root-owned clone, as the code says since the merge of main.
- docs: the latency table and the gate's rule.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell and policy: loop values read within the line's budget; patterns, publishes, shims

- A loop value's own reading (shell pieces) is read after the line as written, in the parse
  budget it leaves, one reading a value (not each way the line's variables combine), as the
  value's commands and the pipeline stages within 128 characters of them, one line per and-or
  list. Past the budget none is read and the line as written decides, held (TK-SHELL-PARSE);
  where the engine's reading then runs out, the call is decided as the line read without them.
- A for loop over a pattern gives its variable the pattern, each name it may make and, as a
  second reading, empty: read as the pattern written in the body.
- A package publish is also read after any number of options, a cargo +toolchain, pnpm's
  recursive, multi or m, yarn's workspaces foreach, through corepack, and as its program's
  base name in the push field (npm.cmd is npm).
- A program name drops .cmd, .bat and .ps1 as it drops .exe (npm's Windows shims).
- Settings options per harness: --config-dir is copilot's alone; gptme's --profile is no
  settings option in any form.
- The glob option text scan keeps shopt, BASHOPTS and GLOBIGNORE; bash -O and zsh's options
  are read from the parsed commands, as before. The harness early return needs no env check.
- Tests: the review's budget lines, a long-pipeline budget test, the survived mutants (sub()
  pieces, environ prechecks), pattern loops, publish spellings, shims, settings options.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Tests: a loop over a pattern also runs its command with the pattern written in

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* E21: gates recorded again with loop and pattern readings (a held-out call more caught); docs follow

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell and policy: script names, loop patterns and publish spellings

- A .cmd, .bat or .ps1 name is read as its program only when that program
  could be a Windows shim: a script named for a bash builtin, a shell or a
  program that reads data (echo.bat, grep.cmd, sh.ps1) is a program of its
  own, as before. DATA_ONLY moves to the shell module so both read one list.
- A loop over a pattern gives its variable the pattern's values on a line
  that writes files too, with $HOME or a variable the line sets to plain
  text in it, and in each word a brace expansion makes.
- The publish reader reads a manager's version (npm@10), pnpm's options
  after recursive, the command yarn's exec runs, and yarn's workspaces
  foreach in one pass; rustup run is a runner.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy (v1 default): file rules read a name in any case and as Windows opens it

The file rules (TK-D005 to TK-D011, TK-F005, TK-F009, TK-F011) named the
exact lowercase file, so on a file system that ignores case (macOS,
Windows) .ENV, ID_RSA or ~/.SSH/ read as no match. Each name is now read
in any case (env variable names keep theirs). TK-D005, TK-D009 and
TK-D010 also read a name as Windows opens it: a part's trailing dots and
spaces and an NTFS stream are dropped (.env., .env::$DATA). The .env
template exceptions and the memory-notes exception keep their meaning.
Default policy 2026.11-1; the v1 schema and verifier are unchanged.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell and policy: a wrapper is read as what it runs where a command starts

- A shell line is also read with each wrapper's own words left out
  (env | timeout 30 curl ... as env | curl ...), so a rule that reads the
  command after a pipe or at a command's start reads the program the
  wrapper runs.
- A CI workflow's text (TK-A061's subject) is also read with each wrapper
  where a command starts, after a pipe too and one named by its path,
  read as what it runs (the parser's wrapper table), and a shell's -c
  script as its commands.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell and policy: CI words at operators, exec's command after --, braces with $HOME

- A CI workflow's text is split into words at `|`, `&` and `;` too, a
  command's first word is read without the quote, `(` or `$(` it starts
  in, a wrapper name with quotes or backslashes is read as the wrapper,
  and a shell's -c script is found after its other options and a `--`.
  A script word that is only a quote is skipped, not read as a word.
- The publish reader reads the command a package manager's exec, x or
  dlx runs after its options and a `--`, and what a wrapper there runs;
  a runner's `--` after its operands is skipped (rustup run stable --).
- A loop header word with $HOME or a variable the line sets to one
  literal, and a brace, is brace-expanded with those read in.
- _ECHOERS leaves the shim exceptions: their words are not data, and
  reading whoami.cmd as whoami decides as the script does.
- Limits: scripts named for builtins or readers, a download piped into
  jq.cmd or fx.cmd, long lines of many pattern loops.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: the publish reader follows a wrapper only in a command an exec runs

The parser already unwraps the line's own wrappers and runners and gives
what they run as commands of their own; the publish reader reads a
wrapper or runner again only inside the command a package manager's exec
runs, which the parser leaves as words.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Crush: deny agent_dispatch and agent_send in the hook

Crush's TUI starts a sub-agent with agent_dispatch and resumes one with
agent_send; a sub-agent's tool calls run no hooks, as with agent and
agentic_fetch. The hook now denies both, and the crushrc and crush.json
lines it suggests name them.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Qwen Code: decide a cron_create gate as the command it runs

A scheduled task's gate is a shell command Qwen Code's scheduler runs at
each fire, unattended and with no hook. The call was an unknown tool; it
is now decided as a Bash call on the gate, marked as running later.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Antigravity CLI: decide 1.5's file tools; deny send_command_input and run_workflow

agy 1.5 has read_file, edit_file and write_file, which read Path: they
passed as unknown tools and were decided on no file. They are now Read,
Edit and Write on Path, with the same argument-name checks as the older
names. send_command_input types into a running command and run_workflow
runs a model-written Python script; their arguments aren't documented,
so the hook denies both until they can be read.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* gptme: decide watch run, until and stream as the command they run

gptme's watch tool runs its command with shell=True and returns while it
runs (until polls it again). The call passed as an unknown tool; it is
now decided as a background Bash call on the command gptme runs: the
words after the verb without the watch's own options, as gptme joins
them.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Cursor: deny WriteShellStdin in the hook

WriteShellStdin types into a running shell, but Cursor's hook payload
holds only the shell's id and the text's length, so nothing could decide
what it runs; it passed as an unknown tool. The hook now denies it before
the signer, as it does other typed input it can't read.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: hold goose recipe runs and OpenHands skills that run commands

goose starts a recipe's stdio extensions (cmd and args) with no hook when
the recipe runs, and loads recipes and sub-agents from recipes/ and
agents/ under .goose/ and .agents/, in a project or the home folder.
OpenHands' invoke_skill runs each !`cmd` line of a skill it loads from
.agents/skills/ with shell=True.

- TK-F009 and TK-F015 hold writes into goose's recipe and agent folders.
- TK-A081 holds goose's delegate when it names a source.
- TK-A082 holds OpenHands' invoke_skill.
- TK-A083 holds a write or edit of a .md file under .agents/skills/
  whose text has a !`cmd`, read from a new fs field, agent_skill;
  skill text without one isn't held.

coding.yaml 2026.11-v2-84. No decision changes on the E17 and E21
corpora; their results files carry the new policy hashes.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell and policy: option clusters, a runner's exec after its options, quoted CI words

- A shell's option cluster with an o or O takes the next word as its
  value (`bash -euo pipefail -c '...'` runs its script), where the
  parser reads a shell's mode, whether it is interactive, and in the
  CI text.
- The parser finds a runner's exec, x or dlx after the runner's own
  options (`pnpm -r exec`, `npm -w a exec --`, yarn's workspaces
  foreach), and a runner npx or corepack names at a version, so every
  rule reads what it runs; the publish reader goes back to a single
  program's words.
- The CI text keeps quoted runs and backslash pairs inside a word,
  reads a double-quoted substitution's commands as words, reads a
  quoted -c script's own words, and reads option words without their
  quotes and backslashes.
- A loop header brace word with $HOME or a given variable is read as
  bash expands it, and falls back to its text only where that text
  has no blank or quote.
- Limits: the CI text's reading may grow past 64 KiB (held).

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* OpenCode: load the plugin in OpenCode 2.x; doctor checks it

OpenCode 2.x loads a plugin only from its default export, {id, setup},
and logged Tracekit's plugin as failed to load, then ran every call
undecided and unrecorded. The plugin now also exports that object: its
setup hooks execute.before and execute.after, and its server is the 1.x
plugin, which OpenCode 1.x and Kilo Code load from it. Checked in
sealed containers on OpenCode 1.19.5, 2.2.0 and 2.3.0 and Kilo 7.8.27:
it loads, the before hook runs once per call, and a denied call is
blocked.

2.x's shell and subagent are decided as Bash and Task, and its read,
write and edit on path as well as filePath. tracekit doctor reports a
plugin without the default export (D-OPENCODE-PLUGIN): fail in system
mode and warn in dev when the OpenCode on PATH is 2.x.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell and policy: CI text read with and without quotes, runner subcommands both ways

- The CI text is also read with its words split at blanks and `|`, `&`
  and `;` wherever they are, quotes not read, beside the quote-aware
  reading: a quoted run that holds a whole command (a YAML-quoted
  scalar, a GitLab list item, a -c script of several quoted runs) is
  its words. A command's first word may follow an assignment of a
  substitution (`x="$(bash -c ...)"`).
- A runner's subcommand spelled as the value of the option before it
  is read both ways (`uv --directory run run ...`), and yarn's
  `workspace <name>` is skipped like `workspaces foreach`.
- zsh's --emulate and mksh's -T take a value; the shell's name is
  passed where its options are read.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Shell: the CI text's two readings in one pass, the second only where they split apart

unwrapped() returns both readings; a line whose words split the same way
with quotes read and without is read once, so a long wrapper chain costs
what one reading did.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Harness hooks: read a CI write's text under each harness's name; hold shell writes to skills

- agy: a write's or edit's text is every string it sends but its path
  (CodeContent, Content, ReplacementContent, ... are not all documented),
  so TK-A061 reads what a CI workflow write puts in the file; a CI
  workflow write with no text to read is denied in the hook. This also
  covers write_to_file.
- TK-A061 reads a write's text under each harness's name for it:
  file_text and new_str (OpenHands, Copilot), newString (OpenCode),
  contents (Cursor), every one sent.
- TK-F015 holds a shell write under .agents/skills/, whose skills
  OpenHands runs !`cmd` lines of.
- goose's delegate with a source and OpenHands' invoke_skill are flagged
  (TK-F025, TK-F026), not held: the hold is on writing a recipe or skill.
- OpenCode 2.x's experimental_image_generate is a read of its images and
  a write of its path, as Kilo's generate_image.
- An OpenHands file_editor command that isn't text is denied in the
  hook; it raised, which the v1 hook let run under fail-open. Copilot's
  str_replace_editor no longer raises on one.
- Limits rows: a !`cmd` built across two edits, the instruction files
  OpenHands loads as skills, OpenCode's artifact tools and image URLs.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: private rule ids past main's and the open policy train's

main's highest ids are TK-A078, TK-D022, TK-F024 and TK-S012, and the
open policy train claims TK-A079 to TK-A081. The startup-item, Git-hook
and gh-runs holds become TK-A082, TK-A083 and TK-A084; the agent-skill
write hold TK-A085; goose's recipe-run flag TK-F026 and OpenHands'
skill-run flag TK-F027 (TK-D023 and the startup-file flag TK-F025 are
free on both and stay). Packs: coding 2026.11-v2-90, dev 2026.11-dev-7.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* E17 and E21: results recorded again with the renumbered rules

E17 and E21's shell rewrites read the startup-item hold as TK-A082; no
decision moves. E21's gates hold as recorded (none written again): p99
over the reference 7.76 / 8.8 default, 7.3 / 8.05 strict, 8.06 / 8.97
dev on RE2 / regex, each under its cap; docs/evaluation.md quotes them.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* v1 policy: read a Windows path's backslashes as `/` again, beside the rules' own reading

#838's reading (each file_path and notebook_path also handed to the
rules with its `\` read as `/`) is kept with the default policy's rules,
which read `\` or `/` themselves, in any case and as Windows opens a
name. The policy's reading also covers a person's own rules written
with `/`; a test now says so.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* E17 and E21: results recorded again after main's second policy train

E17: 951 harmful calls stopped, 1 false alarm in 971 benign. E21's
shell rewrites: every original and rewrite contained, no regression
against the baseline. E21: the held-out pool 287 of 420 caught on the
default profile (122 denied) and 312 on strict (158), with the 1.7.0
gates as recorded on 2026-11-14 (none written again), every one held;
p99 over the reference 7.6 / 8.5 default, 7.05 / 8.08 strict, 7.78 /
9.05 dev on RE2 / regex. README and docs/evaluation.md quote them.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy engine: a command's words also read `\` as `/`, as its line is

main's quiet flags (#844) moved TK-F003 from the shell line to each
command's argv, which had no Windows reading: `chmod +x .git\hooks\x`
was held by TK-A013 but no longer flagged destructive as its slash twin
is. The argv subjects now get the same second reading (_slashes) the
line and the targets have; it only adds matches, and no call of either
corpus set decides differently. The twin test's absolute Windows
targets are compared with absolute POSIX ones, as TK-F003 now flags a
target it can't place in the project and not a relative one.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* E21: latency measured again with the engine's argv reading of `\`

Every gate holds as recorded; dev on the fallback engine reads 9.14 times
the reference against its 9.2 cap. docs/evaluation.md quotes the run.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Signer: provenance index across restarts and recoveries

- A restart rebuilds each open run's provenance index from the run's
  records (checked against its head) and the content vault, before the
  signer serves, and writes a content.accessed (principal signer) for the
  content it read. Trust comes from the records: an observe's own trust,
  and a tool result is untrusted when the signer's policy or one the run's
  decisions recorded lists its tool. Content counts only when it opens
  against its record and its commitment and redaction left it whole; an
  untrusted record whose content can't be read so leaves the index
  partial. Without a vault the index stays unavailable.
- A storage recovery keeps the index and makes it partial when records
  past the head it saw reached the store; a decision while the storage is
  down reads the index as partial.
- A redaction manifest counts each mark written over something besides
  marks, whatever marks the content held.
- Docs: limits, policy, quickstart and format.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Signer: a later run of an agent session starts its provenance index partial

- RPC contract 24: register_run takes `continues`, set by a client for a
  later run of an agent session whose model may still hold what an
  earlier run read. The signer starts that run's provenance index
  partial ("continues an earlier run of the session"), keeps the flag in
  the run state and snapshots, and its rebuild after a restart reads it
  there or from the reason the run's decisions recorded.
- The Claude Code hook sends it after the signer closed the session's
  run, for a resumed or forked session, and for a session that goes on
  after a SessionEnd; the other harness hooks after the signer closed
  the session's run or a SessionStart that says resumed; Hermes,
  tracekit.instrument() and the TypeScript SDK when they replace a run
  the signer closed. A fresh session's run starts complete.
- The Claude Code adapter contract's driver starts each session with
  SessionStart, as Claude Code does.
- Docs: limits and policy.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Signer: a result is untrusted under the policy its call was decided under

- Each call keeps the policy_hash it was decided under (run state,
  snapshots, replay; an older snapshot's calls get it from the records).
  complete indexes a result as untrusted when the signer's policy or that
  one lists its tool, and leaves the index partial when that policy is no
  longer kept.
- A redaction manifest counts the nesting marker (rule `nesting`).
- The dev signer logs STARTING once it holds its lock; a client waits up
  to two minutes past its timeout for one that says so.
- Tests for the rebuild's kept-policy check, gaps, digest results and
  values past what is read.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Hooks: wait for a starting dev signer only within the hook's timeout

- autospawn.ensure takes `start_wait`, the most it waits in all for a
  dev signer that says it is starting, and Client takes `start_wait_s`
  to pass on.
- Each hook sets it under its harness's timeout for the event
  (claude_code.start_wait): the default at a pre-tool call, Cline's cap
  for every Cline event, and no wait past autospawn's own timeout at any
  other event, the said record's connection included.
- Limits: the wait, and the provenance response trigger on an index that
  is not complete.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Hooks: one deadline per hook; a run rebuilt with nothing to go on starts partial

- Each hook has one deadline from its start (claude_code.deadline), under
  its harness's timeout for the event: APPROVAL_WAIT_S at a pre-tool call,
  CLINE_WAIT_S for every Cline event, twice autospawn's timeout at any
  other event (once at Claude Code's SessionEnd). The wait for a starting
  dev signer (Client `answer_by`), a rate-limit retry and an approval wait
  take what is left of it; each signer call at most a quarter. A harness
  hook's said record answers by the same deadline.
- The startup rebuild starts partial a run that no snapshot holds and that
  has made no decision: after a crash nothing says whether it was
  registered with `continues`. The reason stays in the run state until a
  decision records it.
- Limits rows to match.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Tests: the typed-line route's stand-in for handle takes the hook's start time

claude_code.handle now takes the time the hook began (sec10's deadline), which harness_hooks.run passes; the stand-in in test_policy_routes takes it too.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Review fixes: session continuation for every harness, SQL readings, wrappers

Harness hooks: a SessionStart's source reaches the run's registration for
every harness that sends one (jcode's from JCODE_HOOK_SOURCE: create is a
new session, attach and resume continue one). A session with no hook
state is new only at a SessionStart that says so (startup, clear, or no
source) when no SessionEnd of it came before; the hook keeps that marker
as long as a session's state. Any other first event registers the run
with continues. Hermes registers a session an earlier process ran with
continues too. A pre-tool payload whose tool_input is a list or null is
blocked in the hook, with a reason.

Policy: an assignment whose expansions are all variables the line
doesn't set is also read as written; cmd (/c, /k) and wsl are wrappers.
SQL is also read as PostgreSQL with standard_conforming_strings off and
MySQL with NO_BACKSLASH_ESCAPES read it, and a reading that doesn't
close a literal or comment is read up to its last `;`. The coding pack's
TK-A086 reads an SQL-like MCP tool's statements as every dialect lexes
them (the run field, now also an MCP tool's).

Signer: a decision that runs out of time reading a call's values keeps
an index's own reason when the index isn't complete.

Packs: coding 2026.11-v2-92, server-data 2026.11-server-data-5.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Open Interpreter: input typed into a running session is read as Codex's is

Open Interpreter (#853) sends Codex's write_stdin, mapped as Codex's, but
the release branch's handling of typed input was keyed on Codex alone.
Its write_stdin is now kept per exec session (TYPED_INTO), checked in the
hook (control characters, history expansion, shell state) and marked as
an effect after the post-tool hook (LATER), as Codex's.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Release 1.7.0

The version in every file docs/RELEASING.md step 1 lists (the Hermes bound was
already <1.8), the TypeScript lockfile's signer packages unlocked for 1.7.0,
and the 1.7.0 changelog entry.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Release 1.7.0: the TypeScript verifier reads format 1.7.0

READS in sdk/typescript/src/verify/index.ts is the release, or the newest
VERSIONS row when later (tests/test_ts_verifier.py checks it), and
docs/RELEASING.md step 1 now names it beside VERSION.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: harness launches, plugin removal and file writers read in more forms

- A program word that is only the path a name resolves to ($(which X),
  $(command -v X), $(type -p X)) is read as X.
- A harness is also recognised as the script a JavaScript runtime runs
  by its name, and when a container run, exec or create starts it;
  APPDATA and LOCALAPPDATA count as settings variables for TK-A070.
- TK-A054 reads Tracekit's plugin named in any case, by a path or with a
  version, and the switch that removes or disables all plugins.
- The file rules read more writers: yq -i, sd, dos2unix and kin, a
  decompressor's output, ditto, tar -x, unzip and 7z x (their members or
  folder), git config -f, base64 and uudecode -o, split and csplit,
  emacs, and an interpreter's inline write to a literal path.
- TK-D023 reads any file in .ssh/ or .aws/ as TK-D005 does a file
  tool's; a host key appended to known_hosts stays as it was.

Coding pack 2026.11-v2-94. E17 and E21 recorded again: every decision is
unchanged. Docs: limits, policy and evaluation rows; the changelog.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: program words, harness scripts, known_hosts and extract readers revised

- A program word that is the path a name resolves to is read as that
  program only when quoted as a whole word ("$(which X)"), and not on a
  line that defines which, command or type or runs enable; the unquoted
  and backquoted forms are read as before.
- A harness started inside a container isn't read as a launch; the
  limits row says so.
- A JavaScript runtime's script counts as a harness only as installed:
  its bin link, its package's own file, or the path its name resolves
  to, after the runtime's options and the values they take.
- TK-A054 reads plugin removal under any name the harness runs by (a
  package runner, node on its bin link), as TK-A070 reads the program.
- known_hosts: only the shell's append (>>, tee -a) is left out of
  TK-D023; a copy, link, move or other write of it is denied.
- Extract and decompress readers: the folder however the options give
  it, absolute members inside it, bsdtar and gtar, unzip -od, lz4's
  second operand, brotli -o, zstd -dfo, gunzip -S; each reads its words
  in linear time.
- Interpreter writes: Python's mode= keyword and Perl's layers are read;
  an inline write is read as tee of its file.
- The deadline test decides the long writer, interpreter and container
  lines in time.

Coding pack 2026.11-v2-95. E17 and E21 run again: every decision is
unchanged. Docs: limits and policy rows; the changelog.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* tracekit last: wait for a closed run that late records follow

Right after a Claude Code session ended, `tracekit last` showed the run
before it: it waited only while a run's newest record was run.closing,
and the tailer's model events are recorded after close_run. It now
reads each run's state from all its records (final, closed, or open)
and waits while the newest run is closed and not final yet, within the
same 15 s.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Hooks: the call that connects waits for a starting signer until the hook's deadline

Since #852 a client call's timeout also counts its connection, so a
hook's first call, capped to its share of the hook's deadline, gave up
on a dev signer that took longer to start (SlowSignerStart's Cline test:
"signer unreachable" where the call is held). The hook client gives the
call that connects the time left to the hook's deadline; every later
call keeps its own cap.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Policy: located words read from the parse, known_hosts appends and writer spellings

- The quoted "$(which X)" reading is left out on a line the parse reads
  as defining any function (through eval too) or running eval, source,
  `.` or enable; the line is read again without it, so a quote or a
  variable can't hide a definition from a text pattern, which is gone.
- known_hosts: tee's options are read only before its first file and
  `--` (`tee -- -a FILE` and BSD's `tee FILE -a` overwrite); the append
  exception reads a Windows spelling and any case. TK-D023's remedy
  names ssh-keygen -R HOST and ssh-keyscan HOST >> known_hosts.
- tar reads every -C: a member in the folder of the -C before it (GNU)
  and of the first -C (bsdtar); lz4 on a .lz4 without -d, and its second
  operand either way; zstd --output-dir-flat; node's --disable-proto and
  --v8-pool-size, deno's --import-map and tsx watch.
- Limits: tar -xP and 7z x -spf keep absolute paths no rule reads.

Coding pack 2026.11-v2-97. E17 and E21 run again: every decision is
unchanged.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Hooks: only connecting waits for a starting signer; the deadline caps every call

The previous change gave the call that connects the time left to the
hook's deadline for its answer too, so a signer that answered hello and
then nothing held a Claude Code PreToolUse for 540 s instead of its
call's cap, and a long poll could wait its timeout_ms past the deadline.
The hook client now connects first, waiting for a dev signer still
starting until the deadline; each call then keeps its own timeout, and
what is left of the deadline caps it and a long poll's timeout_ms.
Client._own() is the per-process reset _prepare did inline.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* tests: the audit tests read a home of their own

Since #902 audit's last line depends on whether Tracekit's v2 hooks are
in the person's Claude Code settings, which the tests read from the real
home: on a machine with the hooks installed, three of them failed. Each
test now runs with HOME and USERPROFILE in its own temporary folder and
no CLAUDE_CONFIG_DIR.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* zstd's mirrored output folder, and Codex's file items in any call that carries them

- zstd --output-dir-mirror DIR (and =DIR, and unzstd) writes each file
  at its own relative path under DIR: read as such, as --output-dir-flat
  is read in its folder.
- Codex's and Open Interpreter's items are read from any call of theirs
  that carries them but a shell, patch or MCP one (v2's
  collaborationspawn_agent and collaborationsend_input, a renamed tool),
  as a list, one item, a JSON string of either or nested lists: each
  item with a path is a Read of it, a file item's type is read in any
  case, and one with no path Tracekit can read is blocked in the hook,
  as a view_image whose path isn't a string is.

The changelog names the pull requests merged from main since the entry
was written (#852, #878, #884, #891, #901, #902) and their authors.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Codex's image items: a file: image_url is a Read of its file; CHANGELOG dated 2026-11-17

An image item of a Codex or Open Interpreter call whose image_url (a
string or {"url": ...}) is a file: URL is read as the local file it
names, percent-decoded (file:///x, file://localhost/x, file:/x; a
drive's file:///C:/x as C:/x); one that names no local path (another
host, a relative path) is blocked in the hook. An http(s) image_url
stays as it was. The 1.7.0 entry is dated 2026-11-17.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* A file: image URL's scheme read as a URL parser reads it; zstd -r into an output folder

- An image item's image_url is a file: URL by its scheme as
  urllib.parse.urlsplit reads it (leading spaces and control characters
  dropped, tabs and line ends taken out), so " file:///x" and
  "fi\tle:///x" are Reads of their file as file:///x is.
- zstd with --output-dir-flat or --output-dir-mirror, recursive (-r,
  --recursive) or given a folder, writes files the line doesn't name
  into that folder: the folder itself is read as written. A recursive
  decompress into a project folder stays allowed.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* Hooks: an image URL is normalised as WHATWG does before its scheme is read

urlsplit drops leading spaces and C0 controls and takes out tabs, CRs
and LFs only from Python 3.9.17 and 3.10.12 on, and a hook may run under
an older Python (macOS's 3.9.6). The hook now does it itself: C0
controls and spaces at either end dropped, every tab, CR and LF taken
out, then the scheme is read. The test runs under a urlsplit that, as
an old one, strips and removes nothing.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* tests: the release's hook tests keep to their own homes and run on Windows

- The v1 Cline hook budget test gives its hook process a client home of
  its own: the hook's call pairing wrote the client folder in the real
  home, which the home check flags on CI.
- The harness hook tests set USERPROFILE, LOCALAPPDATA and
  XDG_DATA_HOME beside HOME: a dev signer a hook starts keeps its data
  under LOCALAPPDATA on Windows.
- The stalled-signer test serves through the tests' own transport (a
  Unix socket, or tcp:// with its token on Windows), not AF_UNIX.
- The later-run provenance test closes the first run as the hook's own
  caller (over tcp:// on Windows the dev token, not the uid).
- The OpenCode doctor test's stand-in `opencode` is npm's opencode.cmd
  shim on Windows.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* A download URL with a bracket in its host is read the same on every Python; E21's record test needs no re2

- urlsplit refuses a host bracket that is no IPv6 address
  (`http://10.0.0.[1-2]`, curl's glob) only from Python 3.9.21 and
  3.11.4 on. On CI's 3.9.13 it split it as a URL with no path, so a
  wget of it was read as naming its file and flagged, not held. Any host
  with a bracket is now read from its raw path (an IPv6 one to the same
  name), whatever the Python.
- The E21 record-caps test builds its engines on the regex backend under
  each backend's name: google-re2 has no Python 3.9 wheel, and the test
  checks only how the caps are recorded.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

---------

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26 LoopGlitch26 mentioned this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants