Repository navigation
feat(dashboard): add the settings panel for flagged-file delivery consent - #9010
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Description documents a superseded revision: the Watch
Suggestions
[DESIGN-REVIEWED] 81952b9 |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The nonce step-up re-spells Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: give the owner a consented, human-only way to deliver a scanner-flagged file they legitimately need — an ADDITION (panel + consent step-up), per issue #7770.
Capped at 10: screenshot PNGs under [FIRST-PRINCIPLES-REVIEWED] 81952b9 |
GPT 5.6 Review — ✅ human override acceptedHuman judgment by @chenmingwei23 overrides the GPT 5.6 finding for This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsNo findings. CANDIDATE 1 does not survive falsification. Its scenario requires an agent running unconfined ( [OPUS-REVIEWED] 81952b9 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Verify the live host-approve round trip flips "Waiting for approval" to "Allowed" within a poll — only static frames exist; the invalidation path was tested, not watched. Suggestions
[UX-REVIEWED] 81952b9 |
fbe34aa to
8993f6d
Compare
8993f6d to
fb428f0
Compare
fb428f0 to
e65fbf0
Compare
e65fbf0 to
fa5ec33
Compare
fa5ec33 to
006fd80
Compare
Update on head
|
Update on head
|
Update on head
|
|
Head 1d06440: cleared the CI reds on the prior head.
Verified locally: |
|
/ai-review override gpt 89fb0ee: GPT review is clean:true; the BLOCK-MERGE is the documented bootstrap gap on a PR that introduces the review contract (gpt-block-adjudication.md and review-cli manifest absent on base, plus a transient comment-read timeout), which the workflow itself names a maintainer override as the bootstrap path for. No reachable code finding. |
Human judgment recorded@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
|
/ai-review override scope 89fb0ee: Verified via denied_rules.py: the newly-refused surface is exactly the PRs one narrow documented floor self-protection-file-delivery (argv program is the product CLI, leading subcommand file-delivery, approve verb completes a flagged-file step-up). The lane fails in bootstrap mode because this PR introduces the scope harness (deny_diff.py/scope_candidates.py/scope_redact.py absent on base), so every intended refusal reads as newly-refused. No overbroad or unintended denial. |
Human judgment recorded@chenmingwei23 marked the scope AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
|
/ai-review override ux 89fb0ee: UX review failed on infra, not a UX finding: transient could-not-read-PR-comments plus an attachment-download transport failure. The PR commits its evidence under temp-screenshots/file-delivery-consent/ (10 PNGs at HEAD), so this is not a missing-evidence author gap; two re-runs hit the same transient download. No user-visible UX defect. |
Human judgment recorded@chenmingwei23 marked the ux AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Round disposition on
|
The four frontend shards on
|
| shard finding | rule | fix |
|---|---|---|
deStyle.test.ts |
style/de.md s5 wants informal du, not Sie |
rewritten with du, dropping Sie koennen |
esStyle.test.ts |
style/es.md s4 forbids usted outright |
rewritten in the informal register |
hiStyle.test.ts |
style/hi.md s4 wants tum, not formal aap |
rewritten with tum |
zhStyle.test.ts |
style/zh-CN.md s3 forbids opening with the translated "This will" |
opens with the action instead |
A fifth came from a gate that only runs when a base ref is present:
bnStyle.test.ts's [changed-values] register assertion is DIFF-SCOPED, so it
skipped locally until I set I18N_BASE_REF the way CI does, then asked for
informal Bengali. Worth stating plainly, because it is the trap here: running
vitest src/i18n/style/ without I18N_BASE_REF reports 11 passed while a
diff-scoped assertion inside those same files never executes. The re-run with the
base ref set is what I verified against.
Fixing those also caught two of my own typos that no gate would have flagged --
the Hindi read kul bhi nahin for kuchh bhi nahin, and the Chinese used a
mistyped verb that is not a word -- so this round improved the translations
beyond what the register rules asked for.
Four other locale files I touched (fr, it, pt, ru, ja, ko) passed unchanged;
the catalog diff for this round is 5 files, 5 insertions, 5 deletions.
Not mine, and not CI's: the same local shard run also failed four
src/test/Pierre* suites, all with Denied ID .../@pierre/diffs/dist/worker/worker-portable.js?worker&url
resolving into a DIFFERENT checkout's node_modules. That is a worktree-local
module-resolution artifact, not a property of this tree -- CI's frontend shards
did not report those files, and this diff touches nothing under src/pierre/.
Verification on 5e5f8a7740
vitest src/i18n/ src/test/passthroughChecks.test.ts src/pages/settings/SecurityPanel.fileDelivery.test.tsx
with I18N_BASE_REF set: 44 files passed. check-source-strings.mjs still reports
[changed-passthrough] 0 with the exemption deleted. Backend unchanged this
round and still green: 58 in test_file_delivery_consent.py, 1087 with
test_denied_commands_security.py.
Both fenced findings on
|
Round on
|
Round on
|
Stopping here on
|
| round | finding | what I shipped | what the next round found |
|---|---|---|---|
| 1 | ratchet weakened; denials unaudited | exemption deleted, real translations; all four 403 legs audit | delegated macOS spawns skip the mask; nonce claim not atomic |
| 2 | delegation + atomicity | spawn_delegates_masking; claim_grant under one lock |
the config check trusts a live session spawned earlier |
| 3 | config-vs-live-session; TCP fallback | unconfined_live_agent_pid over the session registry; no-fallback opener |
the computer-use read is point-in-time |
| 4 | the arm-to-approve window | safety_epoch stamped at arm, compared at claim |
a standalone kirocrew chat is not in the session registry |
The requirement underneath all of them
Every one of these is the same sentence failing: the host step-up proves a human
is present only while the agent cannot read the nonce. The nonce is a file owned
by the owner's own uid. So the claim is really "no unconfined process running as
the owner can read this file", and that is not decidable from inside the
gateway. A standalone kirocrew chat is a documented usage mode, runs as its
own process, and is in no registry the gateway keeps. Widening the enumeration to
a same-home process scan does not close it either -- it moves the boundary to
"processes I can recognize", and the next unrecognized shape is the next finding.
The finding is right and I am not disputing it. What I am saying is that the fix
it asks for is the fourth guard in a family whose completeness cannot be
established, and choosing between the real alternatives is an owner's call:
- Accept the residual. Keep the four guards, document that a same-uid
process predating the current sandbox configuration can still read the nonce,
and rely on the SEL audit trail plus revoke for detection. Cheapest, honest,
and leaves a named hole. - Change what the step-up proves. Stop resting on nonce secrecy and add a
factor an agent cannot supply even holding the nonce -- a short code the SPA
shows and the human types into the terminal. This ENDS the family, because it
no longer matters who can read the file. It is product-visible UX and a new
design surface, so I have not built it unasked. - Refuse while the configuration is younger than the gateway. Pin the
sandbox tier at boot and refuse approvals until a restart after any change.
Closes everything the gateway spawned with one boot-time capture and no
enumeration; still cannot exclude a foreign same-uid process.
My recommendation is 2 as the real fix with 1 as the interim, because 1 and 3
both leave the same residual and only 2 removes the assumption. I will implement
whichever you pick, immediately.
The second blocker is a rule-owner call, and it is structural
Security scope adjudication refuses on all three OS legs with "newly-refused
candidates". It is the same refusal the earlier comment reported: the
self-protection-file-delivery floor rule THIS PR ADDS makes
kirocrew file-delivery --help a refused candidate, and a candidate that does not
exist at base is "newly refused" by construction on every run. That is why it
flips green and red as the base moves rather than tracking anything I changed.
--help prints usage and is neither a delivery nor an approval path, so either
the floor should exclude the help verb or the candidate should be accepted. I
cannot rule on the repository's own floor rule.
Where the PR actually stands
7fa7d422d0, one commit, MERGEABLE, rebased on current main. Green: Fast Gate,
PR Hygiene, all eight POSIX and all Windows backend shards, frontend shards,
Coverage, Design, First Principles, Opus, Screenshot Evidence. 68 tests in
test_file_delivery_consent.py, 1097 with test_denied_commands_security.py,
every guard added across these four rounds mutation-checked in both directions.
Blocked on two decisions that are not mine: which of the three options above, and
the floor-rule question. Not merged, not approved, no reviewer nudged.
Two CI findings on
|
The two POSIX shards on
|
Rebased onto main for the card-classification fix -- head
|
|
/ai-review override gpt 42ca2db: already-attacked fails. Reading the nonce needs a process already running as the OWNER's uid outside the sandbox, and that caller reads the 0600 leaf and the flagged file directly, so the step-up is not what stands between it and the data. The adversary this fence exists for, the gateway-spawned sandboxed agent, is bind-masked from the leaf AND enumerated at :209. Enumerated path pinned by test_a_confined_pid_set_permits_approval in test/test_file_delivery_consent.py. |
Human judgment recorded@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Disposition of every open lane on
|
…sent Adds a Security-panel path for the owner to allow delivery of a file the credential scanner flags, recorded as a durable grant every delivery gate re-reads. Recording a grant takes a human-only step-up: the owner ARMS on the SPA and completes it with `kirocrew file-delivery approve` on the host, which consumes a single-use nonce and records the grant through a loopback-only endpoint. The step-up is agent-proof by construction. A new `self-protection-file-delivery` denied-command floor rule mirrors `self-protection-update`, so a prompt-injected agent cannot run the approve verb and cannot self-grant delivery of the owner's secrets. The pending nonce lives on a sandbox-masked, pre-created leaf so the mask binds before any sandbox spawns, and the approve endpoint is loopback plus X-Internal-Secret only. `clear_pending_grant` takes an optional expected identity and unlinks the pending file only while it still holds that request's id and nonce, so a request armed after approve validated survives instead of being deleted by a stale clear; the approve handler and `consume_grant` both pass the request they validated. `read_pending_grant` no longer unlinks an expired request on read -- the next arm's `os.replace` overwrites the single file. A dedicated `_PENDING_LOCK` serializes `arm_grant`'s write against `clear_pending_grant`'s compare-and-unlink, so a fresh arm cannot land between the compare and the unlink and be deleted; the racing actors are threads on the gateway's to_thread pool, so a threading lock is the right primitive. The resting-state control discloses what the click actually does. A helper line under the button states that the click only ARMS a reversible two-step request, that nothing is delivered until the host command runs, and that it can be withdrawn at any time -- the button alone read to a blind reader as an immediate, irreversible grant. The grant query is invalidated on the armed-to-not-armed transition, so a completed host approval renders as Allowed rather than expired. The consent copy ships as a `TODO(i18n):` marked English placeholder in all 11 locale catalogs, and `passthrough-checks` recognizes that pending-translation convention (`isPendingTranslation`) so a disclosed placeholder passes the zero-tolerance changed-passthrough gate by design. A confident machine mistranslation on a consent path is worse than an honestly untranslated one. Closes #7770
The UX BLOCK on
|
|
/ai-review override gpt 81952b9: already-attacked fails. The only caller who can trigger the stale overwrite is the authenticated owner PATCHing their own monitor message from a second tab, and that caller can already set that field to any value, so the guard withholds nothing it does not already hold. Also outside this diff: neither autonudge.py nor handlers/autonudge.py is changed here, and main's own call site passes no fingerprint either. |
Human judgment recorded@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Problem / Motivation
Kiro Crew refuses to deliver a file whose contents the credential scanner flags,
with no consented way through -- so a VPN device key the owner legitimately needs
delivered is blocked, and the feature reads as broken rather than protective
(issue #7770). This PR adds an owner-consented delivery path, recorded as a
durable grant every delivery gate re-reads.
The hard part is that this grant authorizes a secret-bearing file past four
independent content gates, so the consent point IS a security boundary -- and the
issue's own acceptance is that consent must be "a human dashboard action", not
something a background agent can grant on the owner's behalf.
Why it matters
An owner dashboard session proves identity, not human presence: anyone running
computer use points an agent at an owner-authenticated browser, so an
owner-session check alone lets a prompt-injected, auto-approved click record a
grant and make every later flagged file deliverable -- the exact "agent can
self-approve" hole #7770 exists to close. And a consent prompt the owner cannot
understand is not informed consent. The security boundary and the copy are the
two things this feature is actually about.
What changed (motivation -> approach -> change)
Security -- a human-only step-up, mirroring the established
update_stepuppattern (RFC OQ7) the repo already uses for "a dashboard session is not enough
authority for a security-critical write":
request and writes a single-use nonce;
kirocrew file-delivery approveon thehost consumes it and records the grant via a new loopback-only endpoint.
file-delivery-consent-pending/,registered in both
security._CREW_SECRET_LEAVES(file gate) ANDsandbox._CREW_HIDDEN_LEAVES, so it is bind-masked out of the agent sandbox inevery mode. It is deliberately NOT under
trust/, which is sandbox-VISIBLE forSEL appends and would let a prompt-injected agent forge a nonce there with a
runtime-constructed shell path. Because that directory is created lazily at arm
time, it is also added to
sandbox._CREW_PRECREATE_HIDDEN_DIR_LEAVESso themask binds over it before any sandbox spawns on a fresh install
(
aws-control-stagingis the precedent)._STRICT_INTERNAL_API_PATHS(notMIXED), exactly like its sibling
/api/update/approve: loopback +X-Internal-Secret only, no cookie fall-through, so a dashboard/agent bearer
cannot even reach the handler. The handler also re-asserts host-locality.
self-protection-file-deliverydenied-command FLOOR rule blocks the agentfrom running the approve verb through its own shell at all, mirroring
self-protection-update. Defence in depth alongside the mask.desktop input synthesis would let a prompt-injected agent type the approve
command into a host terminal and complete the owner's armed step-up itself, so
that one tier is excluded rather than trusted (reads the fail-safe-to-disabled
keystone
computer_use.json).pending-nonce mask: with
agent.sandboxoff (or no backend + unsandboxed execopted in) the nonce is unmasked and an unsandboxed agent could read or forge it
directly, so the presence proof is void. Uses the same security-reviewed
credential_mask_appliespredicate the ACP tool gate uses, which fails closed.fail-safe direction.
it validates the nonce, records the grant, and only then clears the single-use
nonce. A grant-write failure therefore leaves the nonce valid and the owner can
retry, instead of a 500 that also destroyed the armed request; single-use still
holds because the nonce is cleared on the success path before the response.
UX -- plain language and a stated purpose at the point of consent:
file_delivery_descnow names the use case ("Use this when a file of your own-- like a VPN key -- was blocked on its way to you"), the piece a blind reader
said it needed before it would allow anything.
one-line helper naming the outbox folder and the Files view, and stating it
never goes to Slack or a chat channel; never-grantable legs are described in
words, not the raw ids.
allowed"; the armed expiry renders as a human duration ("about 10 minutes"),
not raw seconds; em dashes match the catalogue.
ErrorNoticeinstead of silentlydropping the command panel. While a request is armed the row shows a "Waiting
for approval" badge and a disabled "Waiting on this machine" CTA (so a re-click
is not an invisible re-arm); the host command has a Copy button; an expired
armed request leaves a line rather than a silent unmount.
kirocrew file-deliveryCLI verb requires itsapproveaction (nonargs="?"): a bare invocation errors instead of silently approving.docs/feature-map/README.mdcorrected to state the real boundary (arm isowner-gated; recording is the host-only nonce step-up; the masked nonce leaf
plus the floor rule are the agent fences) -- the prior line called the
endpoints owner-gated, which this change made false.
i18n path, en-XA regenerated by
gen-pseudolocale.mjs), passing theper-language style gates (Italian accents, zh-CN particle stacking, Hindi
informal register).
Default preserved: delivery is still refused until the owner allows it, so nothing
changes until a human opts in on the host.
Tests
test/test_file_delivery_consent.py,test/test_denied_commands_security.py,test/test_sandbox_governance_mask.py,test/test_sandbox_absent_ceiling_seal.pyand
test/test_mcp_call_site_auth_coverage.py(run-n0): arm->approveround-trip;
TestGrantRequiresAHostStepUppins arm-records-nothing,remote-approve-refused, wrong-nonce-refused, single-use, the nonce leaf is
masked, the precreate materialises the leaf before spawn, the approve endpoint
is STRICT-not-MIXED, and approve is refused while computer use is enabled but
allowed when disabled. Mutation-verified: the floor rule, the mask leaf, the
precreate entry, the STRICT entry and the computer-use fence each redden a test
when removed.
SecurityPanel.fileDelivery.test.tsx: clicking Allow ARMS (recordsnothing) and shows the host command with the disabled waiting CTA, and a Copy
button; a failed arm-status read is surfaced. tsc clean.
renderScan, and the per-locale style specs; en-XA is generator-produced.
Manual verification
Rendered the panel through the capture harness against the built SPA and read the
frames: the resting state (use-case sentence + plain destination), the armed
step-up showing
kirocrew file-delivery approvewith "expires in about 10minutes", the write-failure notice, and the arm-status-failure notice. The
capture harness asserts each failure notice actually rendered before shooting, so
it cannot emit a plausible frame of the wrong state.
Screenshots / video
Every frame below was captured at the current head with
node scripts/capture-file-delivery-consent.mjs, which builds the SPA first andasserts the state it is shooting actually rendered. They are attached rather than
linked by raw URL, because the previous frames were pinned to a pre-rebase commit
and so showed the panel BEFORE the resting-state helper line existed, which is
what the UX review caught.
Resting state -- plain destination, the use-case sentence, "Allow delivery", and
the helper line saying the click only starts a request:
Granted -- the only state with a timestamp and the Withdraw control:
Armed step-up -- the click did NOT record a grant; the host command finishes it,
with a human-readable expiry:
The Copy control, both halves. Success:
and failure, when neither clipboard layer is available:
Arming write failure:
Arm-status read failure -- an unreadable approval state renders as unknown, not as
"not confirmed":
An armed request that lapsed its window without an approve:
Consent read failure:
Light theme and the narrow breakpoint:
Related Issues
Closes #7770
Out of scope (tracked separately)
The UX review (Fable 5) raised one blocker that this PR deliberately does not
fix: the consent card does not name the specific file that was refused, so the
owner has no concrete event to anchor the decision to. It is a valid concern, but
its only faithful implementation is a new surface -- the refused-file event is
written to no owner-readable store today (
audit_decisionrecords onlygranted/revoked/delivered, never the refusal, and there is no SEL readpath in the app surface), so surfacing it needs a new refusal-capture store, a new
read endpoint, and card rendering. That is filed as #9091 and is not folded here,
to keep this PR's security-critical surface reviewable. The reviewer's suggested
source ("from the SEL entry
audit_decisionalready writes") does not exist forrefusals -- the concern is real, the proposed remedy is not, and #9091 carries the
correct one. This PR does fold the review's smaller, frontend-only items: an
armed-state badge and a disabled "Waiting on this machine" CTA while armed, a Copy
button on the host command, an expired-request line instead of a silent unmount,
the long-duration expiry form, and the missing arm-status-failed screenshot.
Pattern harvest
security-critical write reachable by an agent-driven owner browser needs a
host-only step-up, and the step-up is only as strong as the fences around its
nonce: the nonce must live on a sandbox-MASKED leaf (a sandbox-visible one can
be forged with a runtime-constructed shell path), the leaf must be pre-created
so the mask binds before spawn, the approve endpoint must be STRICT-internal so
no cookie bearer reaches it, the CLI verb must be on the self-protection floor,
and the one tier that can synthesize host presence (computer use) must be
excluded.
update_stepupis agent-proof because these hold together; each wasa distinct review finding on this PR where one was missing.
old one, and comments are what no test covers -- grep the tree for the old
description, not just the line the reviewer named.
destination label and a stated purpose are where informed consent is won or
lost.
Resting-state consent disclosure + review fixes (latest head)
A blind-reader review pass flagged that the resting-state Allow delivery
button reads as an immediate, irreversible grant when it is neither: the click
only arms a reversible two-step request that delivers nothing until the host
command runs. Added a resting-state helper line under the button:
i18n handling -- really translated, and the gate exemption removed. An
earlier revision shipped this line as English prefixed with
TODO(i18n):in all11 catalogs, exempted by an
isPendingTranslation()predicate inscripts/lib/passthrough-checks.mjs. That is no longer what ships, and the reasonis the exemption rather than the copy: it keyed off a marker inside the very value
being judged, so any value could switch the check off by carrying a prefix, and a
ratchet the judged value can disable is not a ratchet. The exemption is deleted
and
file_delivery_confirm_helpis translated in all 11 locales(
bn de es fr hi it ja ko pt ru zh-CN), one line changed per catalog. Eachtranslation satisfies its own locale style gate, which is stricter than parity:
informal register where the locale requires it (
du,tum, nousted), and noopening literal translation of "This will".
passthroughChecks.test.tsnow pinsthe opposite of what it used to: a
TODO(i18n):prefix earns NO exemption, so theremoval cannot silently regress.
check-source-strings.mjsreports zerountranslated changed values with the exemption gone.
GPT F1 (test isolation) fixed. The expired-request test scoped its clock
patch to a
pytest.MonkeyPatch.context()so nomonkeypatch.undo()can leak afresh arm write past the test's isolation.
Opus / GPT (stale post-approval UI) fixed. When a host approval ends an
armed request, the arm poll flips to
{armed:false}and stops; the card nowinvalidates
['file-delivery-consent']on that armed-to-not-armed transition, so acompleted approval renders as Allowed with a Withdraw control instead of
reading as expired. Mutation-verified: disabling the invalidation reddens the
new regression test.
Local verification:
tscclean;i18n:checkPASS withI18N_BASE_REF=origin/main(
changed-passthrough= 0); SecurityPanel fileDelivery (14) + passthroughChecks(24) + englishIdentity + deadKeys = all pass; backend
test/test_file_delivery_consent.py57 passed (-n0); eslint clean.