Skip to content

browse: redact query values from the audit origin and network log (GST-1635) - #4082

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1635-browse-audit-origin-query
Nov 6, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1635-browse-audit-origin-query

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4082,
  "head": "befd12d6e447fb064614905afafa1d2cd97a4631",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "redaction": {
      "pass": 45,
      "fail": 0,
      "skip": 0
    },
    "free": {
      "pass": 1612,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42248894362,
      "attempt": 1,
      "tree": "d89b0f5bd8a3fd2218bac459dfabf09392685c0d"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "e2456f4696c822d677d5e7f973f876dcc997c8eb",
  "product_patch_id": "0c75169be2048787caeebf682047dce7c96b39e8",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 55,
    "rules": "70895942bb8a8ee2",
    "base": "cf4d847e0169e8edb8d37abd00a29855bb2fd380",
    "registry": "cf4d847e0169e8edb8d37abd00a29855bb2fd380",
    "gate_scan": {
      "tagged": 0,
      "head": "befd12d6e447fb064614905afafa1d2cd97a4631"
    },
    "reasons": [
      "risk:security",
      "runtime=55"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @e2456f4696c8 (7 checks, current for befd12d6e447)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/42252745678/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42252745678/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42251738510/attempts/1"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, BROWSER.md, docs/ (plus SECURITY.md, ARCHITECTURE.md and the browse templates read by the auditor)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "carry": {
    "from": "4f87b29ee46743f1ff089f384e56c83b4ab55169",
    "reason": "scoped re-check by anthropic/claude-opus-5-5 (range-diff 17 lines) + test-only change + release metadata",
    "product_patch_id": "0c75169be2048787caeebf682047dce7c96b39e8",
    "changed_paths": [
      "product:browse/src/audit.ts",
      "test:browse/test/audit-redaction.test.ts",
      "metadata:changelog.d/capy-gst-1635-browse-audit-origin-query.md"
    ],
    "merge_commits": 0,
    "range_diff": "1:  712b176a6 = 1:  712b176a6 browse: redact query values from the audit origin and network log, scrub short digit pieces (GST-1635)\n2:  ae3e736a3 = 2:  ae3e736a3 test: build the userinfo test URL at runtime so the credential scan passes (GST-1635)\n3:  4f87b29ee = 3:  4f87b29ee fix: pre-landing review fixes\n-:  --------- > 4:  befd12d6e browse: redact a query piece with an empty or '=' value whole; fragment names what stays recorded (GST-1635)",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "d89b0f5bd8a3fd2218bac459dfabf09392685c0d"
    ]
  }
}
{"head":"4f87b29ee46743f1ff089f384e56c83b4ab55169","version":"1.96.0.0","gstack_version":"1.96.0.0","review_loop":{"passes":1,"blocking_found":0,"deferred":0,"noted":0,"fixed":1,"scope":"frozen","fix_checks":1,"rounds":2,"ledgers_read":4,"dispatches":{"specialist":1,"red-team":1}},"depth":"full"}

Fixes GST-1635. The audit origin field and browse-network.log now keep scheme, host, path and query parameter names, with every query value written as [REDACTED] and userinfo and fragment dropped. The audit error scrub also removes 2- and 3-character value pieces that contain a digit (a CVV, an expiry month), as whole tokens only.

Full body follows from /ship.

Open in Capy

What changed

The audit line for a page reached by a GET form: before, the origin kept the typed password and CVV and the error kept the 3-digit CVV; after, every query value and the CVV piece are [REDACTED]

The audit line for a page reached by a GET form: before, the origin kept the typed password and CVV and the error kept the 3-digit CVV; after, every query value and the CVV piece are [REDACTED].

Before/after as text: The audit line for a page reached by a GET form: before, the origin kept the typed password and CVV and the error kept the 3-digit CVV; after, every query value and the CVV piece are [REDACTED]
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 $ tail -1 .gstack/browse-audit.jsonl  (origin and error fields)
+origin: https://shop.example.com/checkout?email=[REDACTED]&password=[REDACTED]&cvv=[REDACTED]
+error:  Error: cvv [REDACTED] rejected at eval:1:5
-origin: https://shop.example.com/checkout?email=ann%40example.com&password=hunter2pw&cvv=123
-error:  Error: cvv 123 rejected at eval:1:5
 

Follow-up commit befd12d: a query piece whose value is empty or only = is now written as [REDACTED] whole, so a bare base64 token with = padding (?c2VjcmV0==) no longer reaches browse-audit.jsonl or browse-network.log as a parameter name. A named parameter with an empty value (flag=) is now [REDACTED] whole too, where it used to keep its name. The changelog fragment now says exactly which places are covered and lists what is still recorded as typed (navigation command arguments such as a goto URL, URL paths, and browse-console.log text).

Why

GST-1631 left two known limits. The audit log's origin field stored the full page URL, so after a GET form submit the next line held what the user typed, and short secrets such as a 3-digit CVV survived in error text. Now browse-audit.jsonl and browse-network.log keep only the scheme, host, path and query parameter names, and 2-3 character pieces of a redacted value that contain a digit are scrubbed from error text as whole tokens. The follow-up commit closes the padded-token gap the first review noted, because a bare token's text would otherwise survive as a parameter name, and it narrows the changelog fragment so it no longer claims more than ships.

Blast radius

The new redactUrl runs only where browse writes a URL to disk, which is the audit origin field (writeAuditEntry, browse/src/audit.ts) and each browse-network.log line (formatNetworkLogLine, called from flushBuffers in browse/src/server.ts). The in-memory network buffer, which browser-manager matches by raw URL to update status and size, is untouched, so redacting only at format time cannot break that matching (red-team reader traced the callers; file:line read). The digit-piece scrub only adds needles to scrubSecrets, matched as whole tokens, so its worst case is extra [REDACTED] in error text such as line 12, never a leaked value. The befd12d change is one condition in redactUrl's per-piece map, so its worst case is a parameter name lost from an empty-value piece, which costs debugging detail and never leaks a value (all 46 audit-redaction cases passed at befd12d).

Approvals

Approved: yes (record r-a2cb27db7fa6). The full approval record stays private: this repository is public or its visibility is unknown.

This is a bug fix (R65: no plan review; failing-first tests instead). The first round: 7 new cases failed before the fix while 38 existing cases passed, then all 45 cases passed. The follow-up commit befd12d: its new case failed at 4f87b29 while the other 45 cases passed, then all 46 cases passed.

Review-loop exception for this PR: the Captain's grant (approval a-5393611ebb88, scope "#4082 review_loop_exception") allowed one scoped fix round past the two-round cap, limited to the two hunks of befd12d, with anything a reviewer raises recorded as a note. Merging follows the crew's standing "merge when green" approval through the GStack Minder land queue.

Summary

Two GST-1631 follow-ups ship together. The audit origin and the network log now record every query value as [REDACTED] while keeping parameter names, write a piece with an empty or =-only value as [REDACTED] whole, and drop userinfo and the #fragment; an unparseable origin is cut at its query. Every query value is redacted, not a key-name list, because a page's GET form can name a field anything (cvv, q, ccnum), which the args filter's name list would miss. The error-text scrub now also removes 2-3 character pieces of a redacted value that contain a digit, such as a CVV or an expiry month, as whole tokens, while word pieces like a or is stay so the error text remains readable.

/ship also fixed two things on the way: a test URL with a literal user:password pair tripped the credential scan in the pregate and in CI's quality check, so the test now builds the same URL from a variable, and a red-team note moved formatDialogLogLine's doc comment back onto it. The Captain's one scoped round (befd12d) then fixed review notes 1 and 2 from the first /ship.

Test Coverage

Coverage: deterministic (each of 3 changed runtime files has a changed test naming it; no audit reader).
Regression proof: 7 new cases fail at the base revision and pass after the fix (lane failing-first log: 38 cases passed and 7 failed before, all 45 cases passed after). The befd12d case fails at 4f87b29, where the other 45 cases passed, and passes at befd12d, where all 46 cases passed.
Tests ran at befd12d: all 46 audit-redaction cases passed (lane log); the free suite carried from free-tests.yml run 42252745678/1 at tree e2456f4696c8 (35,990 tests); macOS obligations cleared from run 42252745678 and Windows smoke from run 42251738510.

Pre-Landing Review

Full panel at 4f87b29 (security class, full depth): batched specialist (testing, security, state machines), red team, native adversarial (anthropic/claude-opus-5-5) and an outside voice on another model family (openai/gpt-6.1-sol, via a host subagent), plus one fix-check on the fixed range.

Pre-Landing Review: 1 issue — 1 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 4 noted

  • [AUTO-FIXED] [browse/src/buffers.ts:141] formatNetworkLogLine sat under formatDialogLogLine's doc comment → moved the dialog doc back and gave the network formatter its own one-line doc (4f87b29).

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=1 scope=frozen ledgers_read=4 fix_checks=1 dispatches=2

Gate edits: none detected (3 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Outside review: completed, no findings (openai/gpt-6.1-sol: "accept because no exploitable regression was found in URL sanitization, short-secret scrubbing, or persistent-log integration"). Fix-check: no findings. Native adversarial: 4 low-severity notes below, none blocking.

Scoped re-check at befd12d (J1, under the Captain's review-loop exception): one reader (anthropic/claude-opus-5-5) read the 17-line range-diff packet from 4f87b29 to befd12d plus befd12d's test hunk and changelog fragment hunk. Verdict: no findings. The receipt was carried from 4f87b29 to befd12d on that verdict with a pregate current for befd12d.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR unless marked.

  • FIXED in befd12d: browse/src/audit.ts:153 redactUrl kept a bare base64 query token with = padding (?c2Vj...=) as a parameter name, so the token minus its padding reached browse-audit.jsonl and browse-network.log. A piece whose value is empty or only = is now [REDACTED] whole.
  • FIXED in befd12d: changelog.d/capy-gst-1635-browse-audit-origin-query.md:1 goto args still record the typed URL with its query (redactCommandArgs keeps navigation args by design), so the headline was broader than what ships. The fragment now names the two places covered and lists what is still recorded as typed.
  • INFORMATIONAL browse/src/audit.ts:152 The parse-failure fallback keeps userinfo for a non-absolute input such as //u:p@host/p?a=1; page.url() and request URLs are absolute in practice.
  • INFORMATIONAL browse/src/server.ts:657 Secrets in URL paths and in console text still persist: browse-console.log writes console text as-is and path tokens are kept by design. Not a regression.
  • INFORMATIONAL (scoped re-check, befd12d) browse/src/audit.ts:156 A parameter with an empty value (flag=) now loses its name in the log, where before it was kept as flag=[REDACTED]. That costs some debugging detail and no data or secrets, and the fragment's "a query piece with no value ... is written as [REDACTED] whole" covers it.

Exploratory QA

Surface: functional (the library functions behind browse's audit log and network log; no live browser). Mode: /ship smoke, 3 of 12 probes, 300 s budget. Verdict: pass.

Capture Contract Outcome
001 GET-form checkout URL: names kept, every value [REDACTED], fragment dropped, in both the audit origin and the network line pass
002 userinfo dropped, bare and nameless pieces redacted, a 3-digit CVV piece scrubbed as a whole token while 1234 survives pass
003 an unparseable origin is cut at its query pass

Limits: smoke only; the server flush path is pinned by the unit test that asserts server.ts writes entries.map(formatNetworkLogLine).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: redact query values from the browse audit origin and network log, and scrub short digit pieces from audit error text (GST-1635).
Delivered: redactUrl on the audit origin and network log lines, a 2-3 character digit-piece rule in scrubSecrets, tests and a changelog fragment.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Issues

Refs p1/red-team#1

Verification Results

No plan-specific verification items (bug fix with no bound plan); VERIFY_RESULT: skipped. Automatic smoke QA above passed.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed for GST-1635.

Scope: base b10cc47 to head 4f87b29 on capy/gst-1635-browse-audit-origin-query, covering browse/src/audit.ts (new redactUrl, audit origin redaction, short-digit scrub), browse/src/buffers.ts (formatNetworkLogLine), browse/src/server.ts, browse/test/audit-redaction.test.ts and the changelog.d fragment. Nothing was staged, unstaged or untracked.

Documentation health:

  • BROWSER.md: Current. The Capture section lists browse-network.log and browse-audit.jsonl without describing URL contents, so it is still accurate.
  • SECURITY.md, ARCHITECTURE.md, docs/BROWSER_INTERNALS.md, docs/privacy.md: Current. None of them covers the audit origin or network-log URLs.
  • browse/SKILL.md.tmpl, browse/sections/command-list.md.tmpl: Current.
  • changelog.d/capy-gst-1635-browse-audit-origin-query.md: Current. It matches the code (query values become [REDACTED], userinfo and fragment are dropped, 2-3 character digit pieces are scrubbed).

Coverage debt: Browse log redaction (GST-1631 argument redaction and GST-1635 URL query redaction) has no reference, how-to or explanation coverage outside changelog fragments. The natural home is a sentence in BROWSER.md's Capture section; run /document-generate if it is wanted.

Diagram drift: none. No diagrams reference audit.ts or buffers.ts.

Test plan

  • bun test browse/test/audit-redaction.test.ts at befd12d: all 46 cases passed (lane log); the new case fails at 4f87b29
  • bun run test: carried from free-tests.yml run 42252745678/1 at tree e2456f4696c8, 35,990 tests, green
  • Credential scan (pregate secrets stage over added lines at befd12d): no high findings, 2 advisory (a Luhn-valid test card, MEDIUM)
  • Guards: typecheck, module-size, conflict-markers passed at tree e2456f4696c8

…rub short digit pieces (GST-1635)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 6, 2026 15:44
…asses (GST-1635)

The literal user:password URL tripped creds.basic_auth_url in the pregate and in CI's quality credential scan.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nt names what stays recorded (GST-1635)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 9ceec3f into main Nov 6, 2026
68 checks passed
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.

1 participant