A member may print a credential file on its terminal, and nothing refuses it #255

Closed
opened 2026-11-26 09:00:58 +00:00 by pluto · 3 comments
Member

Purpose (defect): a member can put credential bytes on its own terminal, and nothing refuses it, so a token can reach a pane, a transcript or a log by accident.

What happened

In the martha-ai/martha#239 proof run (crew martha-239, three members, launcher at ee1615ea), the crew got as far as calling the forge. Its supervisor asked its owner, through the engine's own permission request, to run:

cat ~/.config/forge/pluto.token | head -c 20; echo; cu...

which prints the first 20 characters of the forge token to that member's terminal. The builder's next request compiled the same file into a shell variable, with the rest of the line not shown by martha answer's listing. The owner's hand at the pane refused both rather than approving a credential being printed.

Why reading is not the defect

The declaration names token_file: ~/.config/forge/pluto.token under its forgejo host, and DECIDED 2026-11-22 "Yes, file path only" says a tool reads the file when it calls: into a request header, never printed or echoed. So the read is the declaration working as written. What nothing covers is the print: the same file can be sent to the terminal, and from there into whatever keeps it, with no refusal anywhere.

What this issue asks for

A decision, not a build. DECIDED 2026-11-19 "No new checks without your yes" means a refusal is the owner's to call. The question is whether a member's command that prints a credential file is refused by the shell gate or by the engine, and where that line is drawn between reading a token into a header (allowed) and echoing it (refused).

Done when

A member that prints a credential file is refused, and the refusal names the file and the way to use it instead; or the owner records that it needs no refusal, with the reason.

Refs martha-ai/martha#239 (the run that found it), martha-ai/martha#241 (the same hole from the other side: which calls an unattended crew may make).

Purpose (defect): a member can put credential bytes on its own terminal, and nothing refuses it, so a token can reach a pane, a transcript or a log by accident. ## What happened In the martha-ai/martha#239 proof run (crew martha-239, three members, launcher at ee1615ea), the crew got as far as calling the forge. Its supervisor asked its owner, through the engine's own permission request, to run: cat ~/.config/forge/pluto.token | head -c 20; echo; cu... which prints the first 20 characters of the forge token to that member's terminal. The builder's next request compiled the same file into a shell variable, with the rest of the line not shown by `martha answer`'s listing. The owner's hand at the pane refused both rather than approving a credential being printed. ## Why reading is not the defect The declaration names `token_file: ~/.config/forge/pluto.token` under its forgejo host, and DECIDED 2026-11-22 "Yes, file path only" says a tool reads the file when it calls: into a request header, never printed or echoed. So the read is the declaration working as written. What nothing covers is the print: the same file can be sent to the terminal, and from there into whatever keeps it, with no refusal anywhere. ## What this issue asks for A decision, not a build. DECIDED 2026-11-19 "No new checks without your yes" means a refusal is the owner's to call. The question is whether a member's command that prints a credential file is refused by the shell gate or by the engine, and where that line is drawn between reading a token into a header (allowed) and echoing it (refused). ## Done when A member that prints a credential file is refused, and the refusal names the file and the way to use it instead; or the owner records that it needs no refusal, with the reason. Refs martha-ai/martha#239 (the run that found it), martha-ai/martha#241 (the same hole from the other side: which calls an unattended crew may make).
Author
Member

DECIDED 2026-11-26 "Yes, refuse the print (Recommended)" (Raf, on this issue's question): Martha refuses a member command that sends a declared token_file to the terminal, while reading it into a header stays allowed. That is the line this issue asked for, and it agrees with DECIDED 2026-11-22 "Yes, file path only".

Placement, from Mars: after martha-ai/martha#241, built on Opus, reviewed on fable. Nothing is built here until that slot.

Re-measured in the proof run the same hour, for the record: a member asked to print 20 bytes of the declared token, another asked a line whose tail the owner could not see, and the owner's hand rejected both. The read-into-a-header case was the supervisor's curl -s -H "Authoriz..., which the owner also rejected, because martha answer truncates an ask so the header path and a print look the same from the owner's side. That truncation is the practical reason the line above needs a refusal Martha makes, not one the owner makes by eye.

DECIDED 2026-11-26 "Yes, refuse the print (Recommended)" (Raf, on this issue's question): Martha refuses a member command that sends a declared `token_file` to the terminal, while reading it into a header stays allowed. That is the line this issue asked for, and it agrees with DECIDED 2026-11-22 "Yes, file path only". Placement, from Mars: after martha-ai/martha#241, built on Opus, reviewed on fable. Nothing is built here until that slot. Re-measured in the proof run the same hour, for the record: a member asked to print 20 bytes of the declared token, another asked a line whose tail the owner could not see, and the owner's hand rejected both. The read-into-a-header case was the supervisor's `curl -s -H "Authoriz...`, which the owner also rejected, because `martha answer` truncates an ask so the header path and a print look the same from the owner's side. That truncation is the practical reason the line above needs a refusal Martha makes, not one the owner makes by eye.
Member

Harm. The bytes of a declared token_file reach a member's terminal. From there they go into a pane, a transcript, the relay journal or a log, and anyone who reads those reads the token. In #239 this happened by accident: a model checked that its token was there with cat F | head -c 20. The owner could not tell that call from a header read, because martha answer truncates the line. So Martha has to make the refusal; the owner cannot make it by eye.

Out of scope (one-line notes, no refusal). A member set on getting the bytes out, for example with python3 -c, a write to a file it then reads with the Read tool, or an export in one call and an echo in the next. This gate is a speed bump against accidents, like the git shim, not a boundary. A token written to a file (cat F > x) does not reach the terminal and is not refused here.

Which files. Every hosts[].token_file the crew declares. <member> stands for any member, so printing another member's token is refused too. A path counts as named in every spelling the shell expands to the same file: ~/…, $HOME/…, ${HOME}/… and the absolute path. A glob that matches the file counts too.

Where. In the crew's refusals after the gate (whatTheCrewRefusesOfACall, beside the git guard's seam a). That path answers both hosts: Claude Code through the relay, and the engine through the entry (answer_a_goose_call_by_the_entry). The line is the shell call's input.command, which is how the_acts_of_a_call already reads it on either host. A crew with no token files declared refuses nothing.

What is refused. A line that names the file outside a substitution: cat F, head F, base64 F, < F, cp F /dev/stdout, cat F | head -c 20. A small set of commands that never print a file's bytes stays allowed: ls, stat, test/[, chmod, wc, file, du. Inside a substitution, a value that is printed: echo $(cat F), printf %s `cat F`, T=$(cat F); echo $T, cat <<<"$T", when the printing command's output goes to the terminal (the end of its pipeline, not piped on, stdout not sent to a file; >&2 still counts as the terminal).

What stays allowed. Reading the file into a value that goes into a request: curl -H "Authorization: token $(cat F)", tok=$(tr -d '[:space:]' < F), --header @F / -d @F, and printf '…%s…' "$tok" | curl -K - (the printf goes into a pipe, not the terminal).

The refusal says which file it was, and the way to use it instead: read it into a header, -H "Authorization: token $(cat F)".

Reader. Neither existing shell reader can draw this line. #241's a_shell_line_read_plainly refuses any $( (correctly, for its own question), and theWordsOfACommand splits $(…) and >&2 into loose words. So this slice reads only what its question needs: substitution spans, the pipeline ends and stdout redirects. It does not read git calls or commands, and it does not edit either reader.

Proof. Red tests first for every refused and allowed line above, on both hosts' shell tool names. Mutants on the guard: dropping the substitution exemption, dropping the pipe-onward exemption, dropping the variable taint and dropping the ~/$HOME spelling must each turn a test red.

## Threat model (Neptunus, before code), for DECIDED 2026-11-26 "Yes, refuse the print (Recommended)" **Harm.** The bytes of a declared `token_file` reach a member's terminal. From there they go into a pane, a transcript, the relay journal or a log, and anyone who reads those reads the token. In #239 this happened by accident: a model checked that its token was there with `cat F | head -c 20`. The owner could not tell that call from a header read, because `martha answer` truncates the line. So Martha has to make the refusal; the owner cannot make it by eye. **Out of scope (one-line notes, no refusal).** A member set on getting the bytes out, for example with `python3 -c`, a write to a file it then reads with the Read tool, or an `export` in one call and an `echo` in the next. This gate is a speed bump against accidents, like the git shim, not a boundary. A token written to a file (`cat F > x`) does not reach the terminal and is not refused here. **Which files.** Every `hosts[].token_file` the crew declares. `<member>` stands for any member, so printing another member's token is refused too. A path counts as named in every spelling the shell expands to the same file: `~/…`, `$HOME/…`, `${HOME}/…` and the absolute path. A glob that matches the file counts too. **Where.** In the crew's refusals after the gate (`whatTheCrewRefusesOfACall`, beside the git guard's seam a). That path answers both hosts: Claude Code through the relay, and the engine through the entry (`answer_a_goose_call_by_the_entry`). The line is the shell call's `input.command`, which is how `the_acts_of_a_call` already reads it on either host. A crew with no token files declared refuses nothing. **What is refused.** A line that names the file outside a substitution: `cat F`, `head F`, `base64 F`, `< F`, `cp F /dev/stdout`, `cat F | head -c 20`. A small set of commands that never print a file's bytes stays allowed: `ls`, `stat`, `test`/`[`, `chmod`, `wc`, `file`, `du`. Inside a substitution, a value that is printed: `echo $(cat F)`, `` printf %s `cat F` ``, `T=$(cat F); echo $T`, `cat <<<"$T"`, when the printing command's output goes to the terminal (the end of its pipeline, not piped on, stdout not sent to a file; `>&2` still counts as the terminal). **What stays allowed.** Reading the file into a value that goes into a request: `curl -H "Authorization: token $(cat F)"`, `tok=$(tr -d '[:space:]' < F)`, `--header @F` / `-d @F`, and `printf '…%s…' "$tok" | curl -K -` (the printf goes into a pipe, not the terminal). **The refusal says** which file it was, and the way to use it instead: read it into a header, `-H "Authorization: token $(cat F)"`. **Reader.** Neither existing shell reader can draw this line. #241's `a_shell_line_read_plainly` refuses any `$(` (correctly, for its own question), and `theWordsOfACommand` splits `$(…)` and `>&2` into loose words. So this slice reads only what its question needs: substitution spans, the pipeline ends and stdout redirects. It does not read git calls or commands, and it does not edit either reader. **Proof.** Red tests first for every refused and allowed line above, on both hosts' shell tool names. Mutants on the guard: dropping the substitution exemption, dropping the pipe-onward exemption, dropping the variable taint and dropping the `~`/`$HOME` spelling must each turn a test red.
Member

Done-when check against main 3f092f10 (landed-but-open sweep, 2026-12-01). Each commit below is an ancestor of main (git merge-base --is-ancestor).

  • A member command that sends a declared token_file to the terminal is refused, naming the file and saying to read it into a header; reading it into a header stays allowed (DECIDED 2026-11-26 "Yes, refuse the print (Recommended)"): met, PR 272 (landed in batch PR 279, 5d3c4813; fix 90fa6717), src/refuse_printing_a_credential_file/refuse_printing_a_credential_file.ts and its node-test.

Every line is met. Closing.

Done-when check against main `3f092f10` (landed-but-open sweep, 2026-12-01). Each commit below is an ancestor of main (`git merge-base --is-ancestor`). - A member command that sends a declared `token_file` to the terminal is refused, naming the file and saying to read it into a header; reading it into a header stays allowed (DECIDED 2026-11-26 "Yes, refuse the print (Recommended)"): met, PR 272 (landed in batch PR 279, `5d3c4813`; fix `90fa6717`), `src/refuse_printing_a_credential_file/refuse_printing_a_credential_file.ts` and its node-test. Every line is met. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha#255
No description provided.