fix(runner): a download is redaction incomplete unless the runner rewrote it
Merged
OK
2mo ago+299+299+012345678901234567890123456789-17-17-01234567890123456789
REDACTION_BY_KINDstamped everydownloadartifactredaction: 'complete'without the runner reading a byte of it. Repro: fill a field through aSecret, have the app serve an export holding the same value, and the file lands in the attempt's artifacts ascomplete; a configuredartifacts.storereceives the plaintext with metadata that says it is clean. A store that exports onlycompleteartifacts exports the secret. Screenshots on the same session were already withheld by the pixel taint.- A download now defaults to
incomplete, the label a video already carries: bytes the app served, not rewritten by the runner (packages/e2e/src/run/artifacts.ts). - After a secret fill on the session (
taint.value), a text-like download (.txt,.csv,.json,.html) is rewritten through the session'sSecretLedgerbefore it is hashed or handed to the store, and labelledcomplete, the same way trace text entries are. A binary or a file that is not UTF-8 stays as served and staysincomplete. StoredArtifactgainsredaction, the report's label, so a store can hold back what the runner does not vouch for.e2e mcpstandalone attempts get the same wiring.- No schema change:
incompletealready exists in report-1 and both fixtures.
flowchart LR
A[engine attaches download] --> B{secret filled on session?}
B -- no --> E[keep bytes, incomplete]
B -- yes --> C{text/* or JSON?}
C -- no --> E
C -- yes --> D[ledger.redact, rewrite file, complete]
D --> F[hash + store.put with redaction]
E --> F
export interface StoredArtifact {
readonly kind: 'screenshot' | 'trace' | 'video' | 'download' | 'log';
readonly path: string;
/** How much of the file the runner masked, as the report records it. */
readonly redaction: 'complete' | 'not-required' | 'incomplete';
// ...
}
Docs: docs/security.mdx (limits list and the artifacts table), docs/debugging.mdx, docs/reference/config.mdx, docs/reference/engine.mdx. Changeset: patch on e2e.
One call to check: a text download the ledger scanned but did not change is labelled complete, not incomplete, matching what a trace text entry claims after the same scan. If the label should say "unchanged" instead, redactDownload in artifacts.ts is the one place to flip.