Repository navigation
Conversation
79346ce to
c280274
Compare
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Degraded multi-link chip never says several links were merged — the blind reader couldn't tell if the second blocked link had simply vanished. Watch
Suggestions
[UX-REVIEWED] a8250ab |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the live-gateway capture tracked in #12699 — the redactor → persistence → broadcast → chip seam is only exercised per-segment by unit tests here. [DESIGN-REVIEWED] a8250ab |
First Principles Review (Fable 5) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK The new default chip rendering and newly persisted blocked-link records rest on an RFC the base records as Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let the owner of a chat see why a link was blocked and judge a false positive, instead of a bare
Blockers
[FIRST-PRINCIPLES-REVIEWED] a8250ab |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/security/exfil.py:1117 -- Partially encoded bare credentials survive retained paths BLOCKING -- website/src/pages/chat/AssistantMessage.tsx:506 -- Local variant switches retain the previous variant’s link metadata (origin: validation) [BLOCK-MERGE] a8250ab Adjudication (Opus 5) — is blocking on each finding proportionate?F1 — src/kiro_crew/security/exfil.py:1117 F2 — website/src/pages/chat/AssistantMessage.tsx:506 False positive or not applicable? A repository writer can comment: |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsTwo advisory findings; nothing blocks. FINDING — website/src/pages/chat/AssistantMessage.tsx:506 — a locally switched variant ( FINDING — website/src/components/MarkdownRenderer.tsx:2215 — [OPUS-REVIEWED] a8250ab Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
e08e62c to
9f0d2ee
Compare
|
Round 1 dispositions for GPT — F1 The finding is right and the anchor names the reason better than the symptom: the store is the transcript line, so the bound has to sit at RETENTION and not at a render site. Three named constants now apply at both retention points — the collector in
One property worth stating because it is the part that must not regress: the cap bounds what is DESCRIBED, never what is removed. A message with more blocked links than the cap still has every one of them redacted out of its text; only the records stop. A test pins that ( UX — "Inspect" promises examining the link — agreed, renamed. This is the sharpest finding of the round because it is about the one thing the design deliberately does not have. The query is not kept, so a control promising a look at the link sends every reader hunting for what the panel then denies. The key is now UX — Now "{{chars}}-character query removed": it states what happened to the query instead of naming a quantity and leaving the reader to infer the rest. UX and Design — cannot evaluate, no rendered evidence — accepted, captures in flight. Correct on both counts, and the gap is mine: the description said no render exists and none did. Design notes a harness render suffices, which is the route being taken — the five states named (full chip, Inspect open, degraded multi-record, no-record fallback, and a long retained path in flowing prose) plus the light/dark comparison against the solid remote-media chip. These land on the next push rather than this one; the security bound above was worth clearing on its own. First Principles — product-shape change without an accepted RFC — needs a decision, routed to @buluoray. Not disputed, and it is the same block this stack's base carries: the cited record, |
9f0d2ee to
936c7b7
Compare
|
Evidence for Design's note that a harness render suffices is what made this reachable without a live gateway, and the repo already had the right vehicle. Making it paint needed a one-line fix: Reviewing my own captures found three defects that the unit tests could not see, all fixed before attaching:
The stories also used rule ids that do not exist in |
c280274 to
f7307bf
Compare
Security Scope Review -- 🟡 CONCERNSWhich legitimate operations does Verdict basis: the reviewer's own judgement; no confirmed regression. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: CONCERNS TIGHTENING: New validation and retention gates on the blocked-link records that ride a message's ADJUDICATED: 20 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: posix — grep over the touched governance tree, the literal placeholder-prefix text in argv, UNADJUDICATED: The tightening itself sits in guards no shell command line reaches, so the classifier settles none of it:
None of these guards can be expressed as a shell row, so no verdict exists for them; [SCOPE-REVIEWED] a8250ab |
e129326 to
eceac82
Compare
|
GPT F1 This is the SECOND time this rule has fired on this diff by a different escape route — last round the count was unbounded, this round the strings and the dedupe set were — so the fix is not a third set of per-field checks. Being bounded is now a property of the record's shape: The rest follows from it: the domain and rule patterns now carry bounded quantifiers (253 is the DNS maximum, so a longer host is not a host this collector saw), the length check runs before any regex, the collector falls back to One property the tests keep separate, because conflating them would be the dangerous reading: the cap bounds what is DESCRIBED, never what is REMOVED. A message carrying more blocked URLs than the cap still has every one of them redacted out of its text — |
f7307bf to
48c4fb7
Compare
eceac82 to
77ac82c
Compare
77ac82c to
74ae26e
Compare
|
GPT F1
The fix is where the finding points, and it is also the honest shape: records are born at the ONE moment the URL still exists — the redaction inside Everything downstream became a subtraction. Persistence no longer derives records at all (it cannot; it only ever sees the placeholder) and simply carries what the row arrived with, so the second collector is gone. The memoised front door's Tests follow the same correction. The persistence cases now feed the shape the live path produces (content already a placeholder, records in meta), one asserts persistence does NOT invent records from a placeholder, and a source guard pins |
48c4fb7 to
fa04137
Compare
|
First Principles item 7 for Routing both retention points through That is the whole of item 7. The remaining First Principles block on both this PR and its base is the RFC-on-base class, which is a maintainer decision rather than something I can close from here. |
e792ac3 to
3fe2fee
Compare
|
GPT round dispositions for BLOCKING, a credential-shaped host walks past the text redaction — agreed, and it is an inconsistency in my OWN stated rule rather than a new idea. The RFC says a retained string is kept only when the removers themselves would pass it, and I applied that to
A second invention, found while fixing the first and not reported by any lane: the collector fell back to FINDING, bracketed IPv6 — agreed, and it was real in both regexes. A backend test pins what the placeholder actually carries ( Gates: 1251 backend, 1422 frontend, black/isort/flake8/mypy/comment-history/tsc/eslint clean. |
3fe2fee to
f15631d
Compare
|
First Principles item 6 for Once So are its two siblings,
Gates: 1251 backend on the touched set plus 526 export/facade tests, flake8/isort/mypy clean. |
f15631d to
7119fa3
Compare
|
Opus host-shape finding for Last revision I widened the render-side host pattern for bracketed IPv6 and stopped there. The backend's gate admits THREE shapes, and the third is a dotted name carrying Rather than widen the pattern a second time, the render side now MIRRORS the backend's regex shape for shape, in its order, with a comment saying that is what it is. The render side should not hold its own opinion about what a valid host looks like: that opinion drifting from the backend's is exactly how this appeared twice. Pinned from both ends so the next drift fails a test rather than a reader: a frontend case asserts a chip for The bracket-aware placeholder capture from the previous revision stands, since a bracketed host makes a Gates: 1241 backend, 1423 frontend, black/flake8/comment-history/tsc/eslint clean. |
7119fa3 to
ff15fc3
Compare
|
GPT round dispositions for
A domain the collector kept and the reload dropped — agreed, and this is the worse of the two: the record displayed once and then vanished under the reader after a reload, which is a stranger failure than never appearing. The collector's host check was the regex plus credential-safety; the read-back's was those plus the 253-char bound from the table. The root cause behind both, and behind the last three rounds on this anchor: the collection point and the read-back validated the SAME record shape through two separate code paths, so every round found one more check present on one side and absent on the other — the count bound, then the credential rule, now the length bound and the ordering. My previous retrospective unified how a record LIST is built (
A test states the property directly rather than testing the two paths separately: anything collection keeps, the read-back keeps ( Gates: 1255 backend, black/isort/flake8/mypy/comment-history clean. |
…eholder When the exfiltration check blocks a URL the reader is left with plain text naming only the site: `[REDACTED: suspicious URL to example.com]`. It cannot be selected, it does not say why the link was blocked, and it gives the owner no way to judge a false positive. The rest of the URL is discarded before the message is written, so nothing a renderer can reach explains the block. This retains STRUCTURE and never the query value, and the rule for what may be kept is that only what the removers themselves would pass is kept. A path is kept only when the path ALONE fails to trip the URL warning and survives credential redaction unchanged, because a link can smuggle data in its path as readily as in its query. The query is described by its length and never stored. Keeping this does not feed the link back to the model: the replay is built from role and message text only and that text is re-run through both removers before injection, so a detail in a message's meta is never part of it. What one message may retain is BOUNDED at both retention points rather than at a render site, because the store is the transcript line: a record is cheap to write there and every render re-validates and re-serializes whatever the line holds. `MAX_BLOCKED_LINKS_PER_MESSAGE` caps the count in the collector and again where the line is read, with the overflow counted in one log line; a path over `MAX_BLOCKED_LINK_PATH_CHARS` is dropped rather than truncated, which keeps "only what the removers pass is kept" from acquiring a weaker second branch; a count over `MAX_BLOCKED_LINK_QUERY_CHARS` marks the record malformed. The cap bounds what is DESCRIBED and never what is removed -- every blocked URL is still redacted from the text. The records and the redaction come out of ONE loop. `redact_exfiltration_urls_with_records` holds the body and `redact_exfiltration_urls` becomes a thin wrapper, so no existing caller changes and two scans cannot disagree about which URL was blocked. Records carry no positional index on purpose: the placeholder names only the domain, so two different URLs on one host produce byte-identical placeholders and an index could attach one link's path to another. The chip pairs by domain and shows the host and reason alone when a host has several differing records. A transcript line is attacker-writable, so `revalidate_blocked_link` re-checks every record read back from meta -- exact key set, strict host, `[a-z0-9_]` rule id, bounded count, and a path that still passes both removers under the strictest posture available. A record that fails is dropped on its own and its siblings stand. Two readers need the records and both get them from that one scan. The saved entry carries them; the memoised front door copies them onto the live row, because the display path hands the ROW's meta to the redactor and a cache hit never runs the body. A rehydrated row holds the placeholder rather than the URL so a rescan finds nothing -- content survives a reopen because redaction is idempotent, records are derived, so they are carried forward while the content still shows a placeholder. The chip is injected by a rehype pass that runs after `rehypeSanitize`, so `blocked-link` stays out of the agent-influenceable tag allowlist and a literal tag written in prose is still escaped. It is never an anchor and never navigates. The disclosure is labelled for the outcome it delivers -- "Why blocked?" rather than "Inspect", because the one thing a reader wants is the query and that is the thing deliberately not kept, so a label promising a look at the link sends them hunting for what the panel then denies. The panel states in plain language why the rule fired and that the query was not kept, and the char count reads as what happened to it rather than as shorthand. Design record: docs/request-for-change/rfc-redaction-explain-and-reveal.md, section 3 and the retention tradeoff recorded under it. Stacked on the renderer hard rules it builds against. Copy URL and Open once are deliberately absent: they need the query value, and keeping that puts sending it one confirmation away.
|
Scope-lane candidate refusal for
The test needs a host the credential remover rewrites; it never needed a cloud key. The fixture is now a token-prefix shape held in one named constant with a comment saying why it is not an access-key id, an ARN or an account id. All three cases still assert exactly what they did — collection refuses such a host, read-back drops a forged one, and the URL is redacted from the text regardless — and the scope lane's corpus stops carrying a shape it cannot attribute. I did not reach for Gates: 1244 backend, black/flake8/comment-history clean. |
Problem / Motivation
When the exfiltration check blocks a URL, the reader is left with plain text naming only the site:
[REDACTED: suspicious URL to example.com]. It cannot be selected, it does not say why the link was blocked, and it gives the owner no way to judge a false positive. The rest of the URL is discarded before the message is written (security/exfil.pyreplaces the whole match with the site name), so nothing a renderer can reach explains the block.Why it matters
A protection that cannot explain itself reads as a malfunction. The most common blocked link is a long query string, and long query strings are exactly where false positives live — a wiki link whose title is CJK percent-encodes into twenty-plus consecutive
%XXgroups. Today the owner cannot tell that case from a real exfiltration attempt, because the only thing on screen is a host name.What changed (motivation → approach → change)
This retains STRUCTURE and never the query value. The rule for what may be kept is that only what the removers themselves would pass is kept: a path is kept only when the path ALONE fails to trip the URL warning AND survives credential redaction unchanged, because a link can smuggle data in its path as readily as in its query. The query is described by its length and never stored.
Keeping this does not feed the link back to the model. The replay the model receives is built from role and message text only, and that text is re-run through both removers before injection, so a detail kept in a message's meta is never part of what the model reads. What it does cost is recorded rather than glossed: a link judged suspicious now sits in the saved conversation instead of being destroyed.
The records and the redaction come out of ONE loop.
redact_exfiltration_urls_with_recordsholds the body andredact_exfiltration_urlsbecomes a thin wrapper, so no existing caller changes and two scans cannot disagree about which URL was blocked.Records carry no positional index on purpose. The placeholder names only the domain, so two different URLs on one host produce byte-identical placeholders and an index could attach one link's path to another. The chip pairs by domain, and shows the host and reason alone when a host has several differing records — the degraded case is honest rather than confidently wrong.
Every record read back from meta is re-validated. A transcript line is attacker-writable, so
revalidate_blocked_linkre-checks the exact key set, a strict host, a[a-z0-9_]rule id, a non-negative count, and a path that still passes both removers under the strictest posture available (is_https=False, no port — those parameters only ever unlock exemptions inside the warning, so re-checking as plain http can only reject more). A record that fails is dropped on its own; its siblings stand.Two readers need the records and both get them from that one scan. The saved entry carries them, and the memoised front door copies them onto the live row, because the display path hands the ROW's meta to the redactor and a cache hit never runs the body — without that copy the chip would appear on a later load rather than on the turn that produced it. A rehydrated row holds the placeholder rather than the URL, so a rescan of it finds nothing: content survives a reopen because redaction is idempotent, records are derived, so they are carried forward while the content still shows a placeholder.
The chip is injected after sanitize. A rehype text-node pass runs after
rehypeSanitize(like the streaming plugins), soblocked-linkstays out of the agent-influenceable tag allowlist and a literal<blocked-link>written in prose is still escaped by the sanitizer that ran before it. A remark plugin was rejected for exactly that reason. The chip is never an anchor and never navigates; its border is dashed in the warning token, deliberately unlike the solid remote-media chip, because something is missing rather than loadable.Inspectexplains the rule in plain language and states that the query was not kept — never "hidden" — so nobody hunts for a reveal that does not exist.Copy URLandOpen onceare deliberately absent. They need the query value, and keeping that puts sending it one confirmation away; the RFC records them as a separate decision.Strings ship in all 14 locales. The count is interpolated as
{{chars}}rather than{{count}}: a base-only key withcountmakes i18next look for plural forms that do not exist, which is a latent trap rather than a live bug.Backwards compatibility
redact_exfiltration_urlskeeps its signature and behaviour, so every existing caller is untouched; the records variant is additive. A transcript written before this change has noblocked_linksand renders exactly as it does today — the chip needs a record, so its absence degrades to the current plain placeholder. The new meta key is dropped entirely when nothing was blocked.Tests
Backend (
test/test_redaction_blocked_links.py, new): records match the redaction one-for-one; a repeated URL yields one record; records carry no positional field; a clean path is kept; a path that itself trips the rule is not; a path carrying a credential is not;query_charscounts the query and no record contains any substring of its value; the existing two-tuple caller is unaffected; the persisted entry carries the records and omits the key when clean; the user branch stays unredacted; the row gains the records and a cache HIT carries them to a second byte-identical row while a clean row is left alone; a reopened session keeps its records and drops them without a placeholder; a carried record is still re-validated, with tampered siblings dropped individually.Frontend (
website/src/test/MarkdownRenderer.blockedLink.test.tsx, new): the chip replaces the placeholder and leaves surrounding prose intact; several placeholders in one message; the degraded multi-record case; path omitted when null; the char count shown only when positive; the chip is never an anchor; Inspect states the query was not kept.Gates run locally: 1505 backend tests, 1411 frontend tests (i18n + MarkdownRenderer suites),
tsc -p tsconfig.app.json, eslint,npm run i18n:check(19 checks), black + baseline gates, comment-history, isort, flake8, mypy.Manual verification
The visual states are rendered from this revision in Storybook (see Screenshots). What is still outstanding is the live one: a real blocked link in a real session on a running gateway, which no unit test and no story can stand in for because it exercises the redactor, the persistence attach point and the display path together. Tracked with the other live redaction checks in #12699.
Related Issues
Rollout step 3 of the design in
docs/request-for-change/rfc-redaction-explain-and-reveal.md. Stacked onfeat/redaction-renderer-hard-rules(#12684), which ships the RFC and step 1; this branch builds against that renderer and should merge after it.Screenshots
Rendered from this revision through the repo's own Storybook (
src/stories/BlockedLinkChip.stories.tsx, new), which mounts the realMarkdownRendererwith the real theme rather than an invented approximation. A live-gateway capture is a separate pending item — see Manual verification.Every state in dark mode: one record with its retained path and what became of the address's trailing characters, the chip in flowing prose, a long retained path, two differing records on one host degrading to host-and-reason, the no-record fallback that stays plain text, and the chip beside the remote-media chip it must not be mistaken for. That last pairing is the point of the wording: the media chip holds something back and offers to load it, this chip states a removal, so the two say different words for different outcomes.
The disclosure open. Three separate facts on three lines — why the rule fired, that the removed characters were not kept, and the rule id — because run together they read as one sentence trailing off into an identifier. The id is labelled as an id and promises nothing further: telling a reader to report a mistake while naming no place to report it is a promise the chip cannot keep. The chevron is what says "this expands" before the reader risks a click, and it rotates with the
aria-expandedstate the button already announces.One chip per reason sentence the panel can state, all four open at once. Each rule gets its own sentence: the encoding rules do not borrow the credential one, because a long run of escaped characters is also what an ordinary non-Latin page title turns into and calling that a credential would accuse the reader's own content; and the two query rules differ, because length is about how much was there while pattern is about what it looked like. Every rule id shown is one the redactor actually emits from
trace()insecurity/exfil.py.The one case with no single answer: two records on one host that disagree on the rule. The panel states the generic reason and prints NO id line, because the only id it could print is one the redactor never emits — an owner searching for it would find nothing, which is the id line's one job failed exactly where the records conflict.
The same states in light mode, which is where the dashed warning border has to stay legible against a warm subtle fill and still read as a different kind of thing from the neutral solid chip.
What the captures and the reviews caught, fixed before this revision: the disclosure was
text-accent hover:underline, this app's anchor styling on a chip that deliberately never navigates (now static main text with accent on hover only, pinned by a test); the panel ran its three facts together on one line; the rule-to-reason map sent the two encoding rules to the credential sentence; the chip body offered a pointer cursor while only the disclosure is interactive; the reader-facing copy asked for "query string", a term the chip itself never teaches; the label and its control used two different verbs for one event; and the degraded panel printed a fabricated rule id. Each of those is pinned by a test so the capture and the code cannot drift apart again.Getting a Storybook render to paint at all needed a one-line fix to
.storybook/vite.config.ts— it had no@tailwindcss/viteplugin while its docstring claimed Tailwind came from the package root via PostCSS, which this package does not have, so every story rendered as unstyled text. That fix is infrastructure rather than part of this change, so it sits on the base PR (#12684) where the first story landed; this branch inherits it and its own diff carries only the chip.