Skip to content

feat(app-kit): add ctx.scrub, the app-facing outbound redaction seam - #9544

Merged
bolichen97 merged 1 commit into
kirodotdev:mainfrom
suhasaitham22:seam-c-scrub
Sep 11, 2026
Merged

bolichen97 merged 1 commit into
kirodotdev:mainfrom
suhasaitham22:seam-c-scrub

Conversation

@suhasaitham22

@suhasaitham22 suhasaitham22 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

An installed app that sends content off the machine — to an external document store, a ticket, a wiki — needs the same credential and exfiltration-URL redaction the gateway applies on its own boundaries. Today it has two options, and both are bad:

  • from kiro_crew.security import … — a built-in-only surface. Built-ins move in lockstep with the wheel; an installed app does not, so an app pinned to it breaks silently for anyone who upgrades. It is also the companion-blind baseline, so an app wiring it up directly gets weaker redaction than the gateway's own egress sites on any host with an edition companion loaded.
  • Copy the patterns into the app — worse than the import. A redaction pattern set that drifts from the one the gateway enforces is a security control that looks present and is not.

What changed

Two pieces. The first stands on its own and fixes an existing defect.

1. security.redact_with_findings — one home for the pass order

Beside security.redact, returning (text, credential_warnings, url_warnings) instead of discarding what each pass reported. redact() now delegates to it, so the order the two passes run in lives in exactly one place.

That order is a security property: exfiltration URLs run first because that pass matches whole URLs, and a credential replaced ahead of it leaves a placeholder inside one that the URL matcher then fails to recognise.

Both lists hold the warning strings the underlying passes emit. Note these are not uniformly payload-free: the credential pass reports shapes only ("Redacted credential pattern (20 chars)"), but _exfil_url_warning embeds the offending domain in every branch and, on the long-query branch, the first 60 characters of path+query. That is fine for in-tree callers that already handle the text itself; it is why the app seam below reports counts instead.

Two existing callers migrate to it in this PR — onboarding_import.py:896 (_sanitize_text) and :1341 (skill-asset screening). Both ran credentials-then-URLs, i.e. the unsafe order, so this is a behaviour fix and not just a refactor.

Correcting an earlier claim in this description: I previously wrote that the repo held "7 reversed sequences across 6 files". That was wrong by roughly an order of magnitude. Counting chained redact_credentials → redact_exfiltration_urls on the same value, the residue is on the order of ~70 sequences across ~37 files, of which a substantial number do consume the findings and stay reversed — including voice_reply.py:987 and :1629, snapshot_redact.py:304 (whose docstring calls credential-first "the order the rest of the repo applies"), dashboard/handlers/prompts.py:864 and :1739, and apps/builtins/aws_control/backend/routes.py:1256.

That residue is deferred, not fixed here, and stated so deliberately rather than left implied. Two consequences worth being explicit about: the two migrated sites are a sample, not the class, so this PR does not make the repo consistent; and snapshot_redact.py's docstring means the credential-first order is currently documented as the convention, so flipping ~70 sites is a decision about which order the repo endorses and belongs in its own change with its own review, not smuggled in behind a new app seam. What this PR does claim is narrower: redact_with_findings gives that eventual migration a single destination that already encodes the safe order.

2. ctx.scrub — the app-facing seam

src/kiro_crew/apps/scrub_sdk.py, with exactly one method:

result = ctx.scrub.outbound(body)          # may raise; see below
if result.redacted:
    ctx.logger.info("scrub removed %d credential(s), %d url(s)",
                    result.credentials_removed, result.urls_removed)
publish(result.text)          # only the scrubbed text may leave

Decisions that are load-bearing:

  • It redacts through the ACTIVE policy, not the baseline. The text is finished through platform.context.redact_via_context, the canonical shim every egress site routes through, so a loaded companion's extra token and cookie regexes apply. The baseline pass runs first only to count what it recognised, and the policy pass runs over its result — so an app's published text is never less redacted than the gateway's own boundaries. Routing an app-facing egress helper through security.redact* alone would have been companion-blind, and the resulting exposure is irreversible.
  • Fail-closed. redact_via_context re-raises PlatformCompositionError on a host that could not compose its companion, and outbound propagates it rather than silently downgrading. Documented for app authors as "abandon the publish".
  • It reports COUNTS, not the passes' warning strings. credentials_removed / urls_removed, because the exfiltration warning carries a fragment of the URL it just removed — exactly where a token that escaped the credential patterns sits — and handing that to an app as "safe to log" would relocate a secret from the published text into the app's log. A count cannot carry a payload however core later phrases a warning, so the property does not depend on that phrasing. test_nothing_the_seam_reports_can_carry_a_payload pins it, and asserts core's raw warning really does echo the secret so the hazard is documented rather than assumed.
  • redacted is set by the SDK, not derived from text != original, and accounts for the policy as well as the baseline: a companion can remove a token the baseline never counted, so redacted may be True with both counts at zero. It is never False when something was removed.
  • One method, on purpose. Neither single pass is exposed alone and no inbound path check rides along. An earlier revision had four methods; three had no caller and one (is_sensitive_path) transitively made a bounded-but-blocking future.result(timeout=2.0) reachable from an app's async handler. test_the_seam_exposes_only_the_combined_pass pins the surface so a second spelling cannot accrete.
  • No permission gates it, and it is never None. Every other SDK on AppContext grants a capability and stays None until the manifest asks. This one only ever removes data from a string the app already holds, so there is nothing to withhold — and a gate would be actively harmful: an app refused the seam does not stop sending the content, it ships its own regexes. A None field would also make the else branch a silent no-redaction path. It carries no app name either, because nothing it does is attributed.

security_posture.py lists apps/scrub_sdk.py in NON_EGRESS_REDACTION_MODULES rather than as a sink: the seam owns no output, and registering it would count an egress path as covered on the strength of a call the app may never make. The sink-or-allowlist pin in test_security_posture.py requires one or the other. redact_with_findings is also registered in that test's _BASELINE_REDACTORS set, since it is a new companion-blind entry point.

Why it matters

It closes the gap between "the gateway redacts its own output" and "an app redacts the content it publishes on the user's behalf" — at the same strength, through the same active policy — without asking app authors to own a copy of a security control.

On consumers, stated plainly: nothing in-tree calls ctx.scrub yet. It was asked for in review of the two merged manifest-contribution PRs (#7955, #7975), for an app that installs from outside this repository and therefore can neither pin kiro_crew.security at a stable version nor reach the active credential policy. That exchange was not in a public thread, so I am not citing one — a maintainer should confirm it here before this is taken as settled. What I would ask reviewers to weigh is the alternative: without the seam that app either copies the patterns (a control that drifts) or imports the baseline directly (companion-blind), and both are outcomes this repo's own posture module treats as findings. The redact_with_findings half is independent of that question and lands a real fix either way.

Tests

test/test_scrub_sdk.py (9) — a credential is removed and counted; nothing the seam reports can carry a payload (pinned against core's raw warning, which does echo the secret); ordinary prose stays byte-identical (an app may fingerprint what it sent); the seam finishes through the active policy (a companion-only token is removed, and redacted is True with both counts at zero); a failed companion composition propagates rather than downgrading; the seam wraps core rather than copying it; the seam owns no ordering of its own; the public surface is exactly outbound; every app gets scrub with no permission declared while a capability SDK still requires its own.

Manual verification

N/A — unit coverage is sufficient: the module is a thin, side-effect-free delegation, and each property that could regress silently (companion routing, fail-closed propagation, reference-vs-copy, pass ordering) is pinned by a test rather than by inspection.

Screenshots / video

N/A — no UI.

Related

Sibling of #9545 (ctx.audit). Both exist so an app can meet the gateway's own security posture without importing built-in-only modules; the consumer question above applies to both.

Checklist

  • One commit, Conventional Commits title
  • New tests for the new seam
  • Docs updated in the same commit — docs/system-specs/modules/security.md (the owning spec) and docs/app-kit/api-reference.md (app authors)
  • flake8 / isort / black / mypy clean; docs-lint and the ratchet gates pass
  • No unrelated reformatting in the diff
  • No secrets or internal references in the diff

@suhasaitham22
suhasaitham22 requested review from a team and patrigao September 8, 2026 21:08
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 1ddf3775b302713e2ede9d7610f1ab37a2fbae30 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All key claims verified against the base tree: redact_via_context exists with the documented fail-closed PlatformCompositionError semantics, redact() was already URLs-first (so the helper canonicalizes an existing order rather than inventing one), and the posture registry changes match the test's sink-or-allowlist pin.

Design-Verdict: CONCERNS

Sound seam with minimal surface, but it ships unwithdrawable public API for a consumer only a private, unconfirmable review exchange attests to.

Watch

  • Zero in-tree callers of ctx.scrub, and the stated demand ("asked for in review of feat: add contributes.fileMenuItems app-manifest contribution #7955/feat: add contributes.panelTabs app-manifest contribution #7975... not in a public thread, so I am not citing one") is unverifiable from the repo. The author themself asks for confirmation; public App Kit surface cannot be withdrawn once an external app pins it, so that confirmation must precede merge, not follow it.
    Clears when: a maintainer confirms the app-consumer demand on the PR, or a concrete consumer (in-tree or named external app) is identified.
  • The PR makes redact_with_findings "the single home of the URLs-then-credentials order" while ~70 hand-sequenced reverse-order sites remain and snapshot_redact.py's docstring still documents credential-first as the repo convention — two contradictory endorsed orders until the deferred migration lands, with nothing tracking it. The deferral itself is reasonable; the untracked contradiction is the risk.
    Clears when: a tracking issue for the reversed-order residue is filed and linked, and the snapshot_redact.py docstring's "order the rest of the repo applies" claim is corrected or scheduled with it.

Suggestions

  • The companion-routing test proves the seam calls _redact_via_context only via monkeypatch; a one-line integration assertion that ScrubSDK.outbound and a registered egress sink produce identical text for the same input would pin the parity claim against the real shim rather than a stub.

[DESIGN-REVIEWED] 1ddf377

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 1ddf3775b302713e2ede9d7610f1ab37a2fbae30 via the fork AI-review pipeline; updated in place on each push.

Review details

Both underlying redactors return tuple[str, list[str]], so redact_with_findings's unpacking and list(...) wraps are correct. redact now delegates while preserving the URLs-then-credentials order byte-for-byte. redact_via_context is confirmed fail-closed (re-raises PlatformCompositionError) and its Default delegates to security.redact, so on the default host final == stripped (idempotent re-run) and on a companion host it can only remove more — never less than the baseline. The onboarding order flip changes the passes to the canonical safer order and keeps secret_count a sum, so no total-count regression. The redacted flag correctly handles the companion-only-delta case. No candidate to falsify, and no independently grounded defect emerges in the changed lines.

No findings.

[OPUS-REVIEWED] 1ddf377

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 1ddf3775b302713e2ede9d7610f1ab37a2fbae30 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All verification is done. Final assessment: the redact_with_findings consolidation and the two onboarding-order migrations are derived from the base redact() order (security/init.py:774) and carry real consumers; the ctx.scrub seam is honestly described but has zero consumers anywhere in the tree (grep: 0 files) and rests on a request the description itself says cannot be cited. Pre-launch with no adopter, deleting it later locks nobody out, so per the contract's tie-breaker this lands at CONCERNS rather than BLOCK.

First-Principles-Verdict: CONCERNS

ctx.scrub ships app-facing API with zero consumers, resting on a request the description itself says nobody can cite — the maintainer confirmation it asks for is the real gate.

Not justified as shipped

  • Item 3 — zero consumers, inherited: grep ctx\.scrub|ScrubSDK over the base tree finds 0 files; the sole demand is "not in a public thread, so I am not citing one." The harm (app egress leaking credentials) is boundary-derived, but the consumer that feels it is unconfirmable from this repo.

What this change ships

Inventory (6 items) — 5 justified

Intent: give installed apps the gateway's own outbound credential/exfil redaction without copying it — an ADDITION, with a standalone fix riding along.

  1. New security.redact_with_findings; redact() delegates, so the pass order lives in one place — justified
  2. Onboarding text and skill-asset screening now redact URLs before credentials, matching base redact() — justified
  3. Every app gets ctx.scrub.outbound, ungated and never None — zero consumers, inherited requirement
  4. App Kit API reference gains a Content Scrubbing section — justified
  5. security.md documents the seam and the single-home order — justified
  6. Posture panel allowlists the seam as non-egress — justified

Watch

  • The repo now documents two opposite canonical orders: snapshot_redact.py:299 calls credential-first "the order the rest of the repo applies" while the new helper pins URL-first as the single home; 53 files still chain credential→URL (multiline grep redact_credentials\(...\) → redact_exfiltration_urls). Declared deferred, but until the follow-up lands the contradiction is live. Clears when: the repo-wide order decision the description promises exists as a linked issue or PR.
  • Item 3's provenance. Clears when: a maintainer confirms the feat: add contributes.fileMenuItems app-manifest contribution #7955/feat: add contributes.panelTabs app-manifest contribution #7975 requesting app on this PR, or an in-tree consumer lands.

Subtractions

  • Defer the seam — apps/scrub_sdk.py, the AppContext.scrub field, both doc sections, the NON_EGRESS_REDACTION_MODULES entry — to the PR carrying its first confirmed consumer; items 1–2 are complete without it.

[FIRST-PRINCIPLES-REVIEWED] 1ddf377

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 1ddf3775b302713e2ede9d7610f1ab37a2fbae30 via the fork AI-review pipeline; updated in place on each push.

Review details

FINDING -- src/kiro_crew/security/init.py:787 -- "never the removed values" is false because long-query URL warnings include removed path/query text -> Fix: document URL warnings as payload-bearing and unsafe to log.
[GPT-REVIEWED] 1ddf377

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 8, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 9, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 9, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 11, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 11, 2026
@suhasaitham22

Copy link
Copy Markdown
Contributor Author

Maintainer confirmation requested — this is the only thing still blocking

Everything mechanical on this PR is green (tests, lint, type check, coverage, build, the ratchet gates), and it is rebased onto current main. The single remaining blocker is the First Principles review's zero-consumer finding, and its clearing condition is explicit:

Clears when: a maintainer confirms the #7955/#7975 request on this PR, or a consumer lands alongside the seam.

I cannot clear that myself, and I do not want to argue around it, so stating the position plainly:

What would help: if the request is real, a one-line confirmation on this thread clears the blocker. If you would rather wait until the consumer is in-tree or publicly citable, say so and I will act on that instead — I would much rather be told to defer than have deferral inferred from silence.

Worth noting the review rounds have been productive regardless: they caught a genuine event-loop-blocking call, a URL warning that echoed a fragment of the redacted secret into a field documented as safe to log, and an outcome field reaching the append-only SEL log unscrubbed. Those are fixed and covered by tests either way.

An app that sends content off the machine needs the same credential and
exfiltration-URL redaction the gateway applies on its own boundaries. The only
routes to it were importing kiro_crew.security -- a built-in-only surface, so an
installed app pinned to it breaks silently when the wheel moves -- or copying the
patterns, which is worse: a pattern set that drifts from the enforced one is a
control that looks present and is not.

ScrubSDK wraps redact_credentials, redact_exfiltration_urls and
is_sensitive_path BY REFERENCE, reached as ctx.scrub, so an app picks up a
tightened pattern with the wheel. outbound() applies URLs then credentials in
that order: redacting a credential first leaves a partial token inside a URL the
exfiltration matcher would no longer recognise.

No permission gates it and it is never None. It only removes data, so there is
nothing to withhold, and an app refused the seam would ship its own regexes --
the outcome this exists to prevent -- while a None branch would become a silent
no-redaction path.

Empty of behaviour change for existing apps: nothing reads ctx.scrub yet.
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🟡 CONCERNS

Which legitimate operations does 1ddf3775b302713e2ede9d7610f1ab37a2fbae30 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

the reviewer's own judgement; no confirmed regression

Scope-Verdict: CONCERNS

TIGHTENING: The redaction pass ordering at the two onboarding-import sanitization sites (_sanitize_text, _skill_package in src/kiro_crew/onboarding_import.py), flipped from credentials-first to URLs-first by routing through the new redact_with_findings -- the one threat it refuses is an exfiltration URL in imported skill/document text whose embedded credential previously camouflaged the URL from the exfil matcher: "exfiltration URLs run FIRST because that pass matches whole URLs, and a credential replaced ahead of it leaves a placeholder inside one, which the URL matcher then fails to recognise as the shape it is there to catch." The shell-command deny composite itself is not modified: redact() already ran URLs-then-credentials at base and the new wrapper preserves that order exactly, denied_rules.py/argv_floor.py and the other composite tiers are untouched, and the remaining hunks (the ScrubSDK seam, its AppContext field, docs, posture inventory, tests) are additive.

ADJUDICATED: 13 candidates, 0 confirmed newly-refused
No confirmed rows were handed to this review; the candidates in candidates.json probe the composite's neighbourhood of the touched code (tests over the new files, read-only listings/greps/diffs over the security and apps trees, redaction-symbol argv shapes, doc reads in both platform spellings) to confirm empirically that the composite's behaviour did not move. A regression without a script verdict is not a finding, and none is claimed.

PLATFORM COVERAGE: posix rows cover the interpreter path (.venv/bin/python), /-separated repo paths, grep/sed spellings, and the quoting the posix tokenizer applies to the python3 -c smoke checks; windows rows cover the .venv\Scripts\python.exe interpreter path, \-separated test and docs paths, and the findstr/Get-Content spellings of the same symbol-search and doc-read operations. No any rows were written because every candidate carries a path or executable name. The diff itself makes no shell-visible platform assumption — the only new path literal, "apps/scrub_sdk.py" in NON_EGRESS_REDACTION_MODULES, is an internal module-inventory key, not a guard input — so no assumed platform went unprobed. Per-leg verdicts are the deterministic fold's to report, not this section's.

UNADJUDICATED: The tightening this change actually makes lives entirely outside the shell deny composite, so no classifier verdict exists for it and the empty adjudicated set above is not evidence it is well scoped.

  • Guard: the onboarding-import text sanitizer. Call path: onboarding_import._read_text / skill-asset decode → _sanitize_text / _skill_package → redact_with_findings (URLs pass now first). Candidate legitimate inputs I would have submitted: an imported skill README whose documentation example URL embeds a placeholder credential (e.g. an AWS docs link carrying the canonical [REDACTED-AWS-KEY-ID] example key in a query parameter) — at base the credential was redacted in place and the link survived; at head the whole URL is removed from the imported skill, losing a working docs pointer; likewise any imported runbook whose legitimate URL contains a token-shaped path or query segment that the credential pass used to neutralize before the URL pass saw it.
  • Guard: the new app-facing ScrubSDK.outbound (ctx.scrub). Call path: app code → ScrubSDK.outbound → redact_with_findings + redact_via_context, fail-closed on PlatformCompositionError. Candidate legitimate inputs: an app publishing a wiki page or ticket containing a richly-parameterised dashboard permalink (≥200-char query, no credential) — redacted by the aggregate-length signal at the app's boundary; and, on a host whose edition companion fails to compose, every app publish through the seam now raises rather than degrading — deliberate per the diff, but a refusal path no leg here can classify. The seam is additive (no existing app path is forced through it), which bounds the exposure, but its refusals are unmeasured by design of this lane.

[SCOPE-REVIEWED] 1ddf377

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 10 classified, 0 newly refused, 8 still allowed.
  • ubuntu-latest (platform posix): 10 classified, 0 newly refused, 8 still allowed.
  • windows-latest (platform windows): 3 classified, 0 newly refused, 3 still allowed.

No candidate flipped from allowed to refused.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@bolichen97
bolichen97 merged commit 6575bee into kirodotdev:main Sep 11, 2026
105 of 106 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 11, 2026
@suhasaitham22

Copy link
Copy Markdown
Contributor Author

On "a consumer lands alongside the seam" — I checked, and that path is not available

The zero-consumer blocker offers two ways out: a maintainer confirming the request, or a named consumer landing with the seam. An earlier round suggested issue_radar adopting ctx.scrub as its first consumer. I went and tried to do that rather than argue, and it does not work. Recording why, so the option is not left on the table as though it were open:

  • issue_radar never receives an AppContext. It has no hooks.py — only backend/ — and its entry point is register_routes(app: web.Application) -> None. Its own docstring notes that signature "matches every other builtin app … confirmed against the real call site in dashboard/server.py (_mod.register_routes(app), single argument)".
  • The semantically right site, _comment_text(body: str) -> str in backend/azure_client.py ("the vetted text for a comment this app is about to publish"), is a module-level function. Reaching it from a context means threading an AppContext down through an unrelated app's backend.
  • No builtin uses any ctx.<sdk> outside hooks. The only in-tree consumers of sibling SDKs are mochi/hooks.py (ctx.spawn) and crew_companion/hooks.py (ctx.events).
  • mochi is the one app with in-gateway hooks, and it is the wrong consumer: redact.py::redact_tree is deliberately a leaf module ("so both importers can take it at module scope without a circular import"), it walks JSON rather than publishing a string, and its sinks are browser surfaces and persisted state — not off-machine sends. ctx.scrub.outbound is fail-closed by design (it propagates PlatformCompositionError), so routing persisted UI state through it would convert a redaction miss into a crash on a render path. That is a regression dressed as an adoption.
  • For ctx.audit there is no candidate at all. Builtins reach sel() directly and are right to: they ship in the same wheel as sel, so they have no version-skew problem.

That last point is the general one, and I think it is the honest reading of the situation: a builtin cannot be a real consumer of either seam. The seams exist because an app installed outside the wheel cannot pin kiro_crew.security / kiro_crew.sel across an upgrade, and cannot reach the active CredentialPolicy. Anything shipped in-tree has neither problem. Migrating one would make the API read as non-speculative while changing nothing real — satisfying the gate rather than the concern it encodes, which I would rather not do.

So the two genuine options are the ones the review already named: a maintainer confirms the request, or these defer until the external consumer is citable. Either is fine by me — what I would like is a decision, because the alternative is that I keep pushing rebases past a gate that is correctly refusing to guess.

For what it is worth, the current state of both PRs: every test shard, lint, type check, coverage, build and the ratchet gates pass; the Opus, GPT, Security-Scope and UX reviews all pass. The only remaining red is this finding (plus, on #9544, a Windows runner that hit the 40-minute execution cap and needs a re-run — I do not have permission to trigger one).

amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…irodotdev#9544)

An app that sends content off the machine needs the same credential and
exfiltration-URL redaction the gateway applies on its own boundaries. The only
routes to it were importing kiro_crew.security -- a built-in-only surface, so an
installed app pinned to it breaks silently when the wheel moves -- or copying the
patterns, which is worse: a pattern set that drifts from the enforced one is a
control that looks present and is not.

ScrubSDK wraps redact_credentials, redact_exfiltration_urls and
is_sensitive_path BY REFERENCE, reached as ctx.scrub, so an app picks up a
tightened pattern with the wheel. outbound() applies URLs then credentials in
that order: redacting a credential first leaves a partial token inside a URL the
exfiltration matcher would no longer recognise.

No permission gates it and it is never None. It only removes data, so there is
nothing to withhold, and an app refused the seam would ship its own regexes --
the outcome this exists to prevent -- while a None branch would become a silent
no-redaction path.

Empty of behaviour change for existing apps: nothing reads ctx.scrub yet.

Co-authored-by: Suhas Aitham <suhasaitham22@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants