Repository navigation
Description
Follow-ups from reviewing #615 at 8487062. None of these blocked the PR, but a few are worth fixing soon. Most important first:
-
Second request cookie can survive scrubbing (looks important). When a request carries more than one Cookie field and the logged header joins them with a comma, only the first pair is masked; the cookie-pair continuation is only applied for
Set-Cookie. The merge base masked the whole header. Realistic request logs hit this._scrub_error_summary("Cookie: locale=en, sessionid=DemoSessionValue") # head: "Cookie: [REDACTED], sessionid=DemoSessionValue"
A related variant: a diagnostic between cookie pairs (
Cookie: sid=FirstCanary; CARD_EXPIRED; other=SecondCanary) ends cookie-context scanning, soSecondCanarystays visible. Keeping cookie context across the whole header value, while still preserving recognised diagnostics, should cover both. -
PEM private keys survive in line-oriented output (looks important). Once a decoded JSON container is marked scrubbed, it skips the PEM pattern, and in a
stdout_lines-style array the BEGIN line, body and END line are separate strings, so nothing matches the whole envelope. The merge base removed the body._scrub_error_summary(json.dumps({ "stdout_lines": ["-----BEGIN PRIVATE KEY-----", "dGVzdHRlc3R0ZXN0", "-----END PRIVATE KEY-----"], "status": "CARD_EXPIRED"})) # head keeps the body line
-
Large-payload fallback erases ordinary diagnostics. Past the 2,048 flat-decode budget or the 512 KiB byte budget, the fallback treats escaped quotes or a newline plus
key=valuetext as unresolved nesting and replaces the value with a single[REDACTED]. It fails closed, so nothing leaks, but a big tool result or a long JSON-encoded log loses its error markers (for example a 9,000-line log loses its finalERROR: CARD_EXPIRED; 2,500 serialized records keep only 2,048 status markers). A bounded linear scan for single-layer text, keeping whole-value redaction for genuinely unresolved nesting, would fix it. The current budget tests only check secret absence and timing, so worth asserting diagnostic preservation too. -
Mock/offline runs now reject legal hyphenated table names.
run_demo/run_demo_asyncvalidate identifiers before the mock branch, and the table check uses the dataset character set, so--offlinewithEVAL_TURNS_TABLE=eval-turns-2026(ortable_id="agent-events") now raisesValueError. BigQuery allows dashes (and spaces/Unicode) in table names.test_run_demo_mock_live_rejects_invalid_eval_turns_tablecurrently pinsbad-tableas invalid and would need updating. The HTML drawer also strips spaces and Unicode from the displayed table name.
Smaller items:
- Duplicate or colliding JSON members. On a duplicate key or a post-redaction name collision the whole object goes back to the prose scanner; with an
Authorization: Bearer ...string in it, the output can become invalid JSON or lose trailing members. Separately, two URL keys that scrub to the same text still collapse into one member inscrub_sensitive_text(pre-existing;scrub_sensitive_dataalready disambiguates). - Collision suffix search is quadratic. Each collision restarts at
#2; thousands of keys that scrub to the same name get slow (8,000 keys took about 3s). Tracking the next suffix per name fixes it. - Two regression fixtures don't hit the intended branches. The padded-base64 fixture uses
==padding and the depth fixtures wrap in a fresh object per step; the committed assertions pass on the merge base too. Adding single-=rows and direct repeated string encodings would make them real regressions. - Folded
Set-Cookiewith an extension flag. A bare attribute outside the known list (e.g.Discard) ends the scan early, so a following cookie in a folded response stays visible. - Null/boolean count policy differs between entry points.
{"token_count": null}(and booleans) becomes a redaction marker through the text API but stays as-is through the data API. Worth picking one behaviour and testing both. - Minor: a few new timing assertions still use a single elapsed sample with fixed ceilings; plenty of headroom today, but a median-of-three like the other helpers would be steadier on slow CI.
All values above are synthetic.
Activity