Skip to content

fix(feed): redact user-controlled fields on JSONL load (#298) - #472

Open
christopherkarani wants to merge 7 commits into
mainfrom
cursor/fix-298-feed-redaction-parity-5a3f
Open

fix(feed): redact user-controlled fields on JSONL load (#298)#472
christopherkarani wants to merge 7 commits into
mainfrom
cursor/fix-298-feed-redaction-parity-5a3f

Conversation

@christopherkarani

@christopherkarani christopherkarani commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Closes #298.

What changed

Load-path redaction for historical feed JSONL: reason / remediation / target_summary / rule / host / pack_id / severity go through core_api.redactAlloc. .raw is rebuilt from the parsed record. session_id uses a path-safe redacted placeholder when containsStructuredSecret hits a provider token at a non-alnum boundary (so task- / ask-followup-1 survive, while sess.ghp_ / sess-sk- / sess_ghp_ / sess_AKIA… do not). High-entropy / JWT classify is not used on session ids.

writeFeedRecordJson also gates session_id so append-time JSONL cannot persist a raw ghp_ host id. stack.append OOM deinits the in-flight LoadedFeedRecord.

Review

Five independent 3-agent waves on the claimed load-path surface were 0/0. Leftover commit 2e388471 fresh wave: 0 Critical / 0 Important. Ready to merge after rebase onto current main (feed_writer.zig changed on both sides).

Checks

  • ./scripts/zig build -j1 -Dincremental=false -Dtest-filter="feed" test-lib — 71/71 (includes new host/pack_id/severity, append-time session_id, and embedded AWS rows)

Out of scope

Open in Web Open in Cursor 

cursoragent and others added 6 commits August 16, 2026 14:43
Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
Replace whole-line redactAlloc of feed .raw with writeFeedRecordJson
from already-redacted fields so high-entropy JSONL stays parseable.
Secret-shaped session_id values become the path-safe placeholder
"redacted" instead of [REDACTED:…], which breaks validateSessionIdText.

Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
Unanchored `sk-` matches inside `task-<uuid>` and `ask-followup-1`.
Accept findStructuredSecret hits only at isKeyStart so Hermes task
ids survive while `sess-sk-` still becomes the path-safe placeholder.

Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
OpenCode and host ids use `sess_` / `ses_`. Env-var isKeyStart treats
`_` as interior, so `sess_ghp_…` survived. Gate on non-alnum instead.

Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
@christopherkarani
christopherkarani marked this pull request as ready for review August 16, 2026 15:51
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Load-path host/pack_id/severity go through redactOwnedAllocOptional.
writeFeedRecordJson gates session_id with containsStructuredSecret so
ghp_ cannot persist. Embedded AKIA after a session boundary becomes
redacted. stack.append OOM deinits the in-flight LoadedFeedRecord.

Co-authored-by: Christopher Karani <chrisbkarani@gmail.com>
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.

[ZIG] feed_writer / feed_visibility redaction parity with audit redact_bridge

2 participants