Skip to content

feat: let crewmates propose changes the user confirms as cards - #18448

Merged
buluoray merged 1 commit into
mainfrom
feat/change-cards
Oct 11, 2026
Merged

buluoray merged 1 commit into
mainfrom
feat/change-cards

Conversation

@buluoray

@buluoray buluoray commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let a crewmate prepare a change to Kiro Crew (a setting, schedule, crewmate, MCP server, connection, secret, app trust or denied-command rule) that applies only after the user presses its card.

With guided tours (#18443) a crewmate can point at the control, but the user still has to find every field and fill it in. A crewmate asked "make replies shorter" or "move that reminder to 8:30" cannot hand over a prepared change for the user to confirm. The decision is recorded in docs/request-for-change/rfc-crewmate-guides-and-mate.md (accepted, merged in #18326). This is the third of three PRs that ship it: Mate (#18406), guided tours (#18443, the base of this PR), then change cards (this one).

Why it matters

A prepared change that applies on one press turns a settings hunt into a one-message request, while every change still needs the user's own click and goes through the routes the settings pages already use.

Not a goal

  • Applying any change without the user's own press, or a path around approvals, governance or the security policy. Trust-root files (security policy, computer use, the keystone files) have no card kind.
  • Replacing the settings pages, the MCP server form or the crewmate editor. A card replays the routes those pages already call.
  • Replacing the direct tools: an agent that schedules its own work, a conductor or a scheduled run keeps cron_add and its other tools, under their own approvals.

What changed (motivation → approach → change)

Approach: the agent names one registered kind with parameters; the gateway, not the model, writes what changes, the risk and the exact requests, and the owner's browser applies it through the existing routes under a hook that verifies each step.

  • Tools (src/kiro_crew/mcp_guide.py): list_change_kinds, propose_change, get_change_status, plus the reads find_setting, get_member_capabilities and diagnose_settings. Exact allowedTools grants (agent._GUIDE_AUTO_GRANTS in src/kiro_crew/agent.py, config/defaults.json), through the governance ceiling.
  • Catalog (change_card_catalog.py): settings, schedules and one-time reminders, crewmates and their capabilities, templates, MCP servers, connections, secrets (typed into a field the agent never sees), app trust and denied-command rules. Each plan is rebuilt from kind and params on load; card text the output redactors would change is refused.
  • Store and routes (dashboard/change_cards.py, dashboard/handlers/change_cards.py, dashboard/server_runtime/crewmate_prune.py, dashboard/server.py, server_runtime/mcp_routes.py): a write step is persisted before its route runs; the card hook on the hooked routes verifies X-Card-* steps; proposing needs a turn the user sent (feat: welcome users with Mate, a first crewmate they get to name #18406's admission). Outcomes reach the proposing slot's next turn as a [CHANGE CARD RESULTS] block (context_blocks.py, chat_runner.py).
  • Change log in memory: an owner change on a route a card can also write, by card or by hand on the Settings page, appends one Dashboard: ... line to Global memory history (_record_memory), so diagnose_settings can name recent changes. Names only, never a secret or token value; nothing is written when persistent memory is off (docs/architecture/context-management.md).
  • Diagnosis (diagnose_probes.py): twelve read-only symptom probes behind diagnose_settings; agent_sdk/drivers/acp.py re-exports resolve_usable_model for them.
  • Dashboard (website/src/cards, website/src/api/cards.ts): the card is a row of the conversation, drawn where it was proposed, with Apply, Undo and a widen acknowledgement; card_update frames keep it live (hooks/useWebSocket.ts).

Smaller pieces: crew_log/emit.py, crew_log/entry_types.py, crew_log/schema.py and dashboard/chat_cards.py add the card/* entries and the change row surface; security_posture.py, validation.py and history_projection.py list the new redaction sinks and schemas; dashboard/handlers/guide.py and dashboard/guide_runs.py share the admission and retention; website/src/guide, website/src/components, website/src/pages/chat, website/src/store, website/src/app-sdk and website/src/hooks carry the card row and wording; website/src/i18n holds the card strings; src/kiro_crew/config/prompt.md, src/kiro_crew/docs and docs/ cover MCP, crew log, crew mode, history and the feature map.

Design decision: a card that widens what an agent may do without asking (approval mode auto, sandbox off, a crewmate's autoApprove) stays possible, but only behind an acknowledgement tick plus the user's own press (risk: widen).

Backwards compatibility

Compatible: every change a card makes goes through a route that already exists, and the hook only adds checks to requests that carry card headers. The new routes refuse callers they cannot attribute to a dashboard turn.

Removes nothing: the diff adds a tool set, a store and a card UI; nothing main accepts is narrowed.

Tests

  • Backend: test_change_cards.py (catalog, persist-before-run, rebuild on load, redaction refusal, hook), test_change_card_one_shot.py, test_diagnose_probes.py, test_guide_admission.py (a turn the user did not send cannot propose a card), test_guide_server.py (card grant under the ceiling, off-dashboard wording, card reply hints), plus updated composition, spec-byte, crew-log and persistence contracts.
  • Frontend: src/cards/*.test.tsx (every kind renders, plan steps in order, refusals, widen gate, secret field, undo, one-shot schedules), chatSlice.cardRow.test.ts, TurnBlock.cardRow.test.tsx, useWebSocket.frameTrace.test.ts.

Manual verification

Earlier heads, live on a preview gateway with a real model: "Move that PR reminder to 8:30am America/Los_Angeles" → propose_change put a schedule card in the chat; it was not pressed. That run found the time zone shown twice, fixed in kindBodies.tsx and pinned by shows a changed time zone once, in its change row. Gates on this head: flake8, mypy, tsc, the index check, i18n against origin/main, and the related pytest and vitest sets. Not exercised: pressing a card through to its write on a live gateway; Windows and macOS hosts.

Screenshots / video

From an earlier head: a schedule change card in the chat.

d-change-card

Related Issues

Part of #18300 and the RFC in #18326; based on #18443.

Pattern harvest

Not generalizable: a feature PR.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners October 9, 2026 10:31
@buluoray
buluoray requested review from cruisercohen and removed request for a team October 9, 2026 10:31
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/secrets/vault.py

  • src/kiro_crew/security_posture.py

  • @buluoray posted a complete reasoning template for 93dbeef.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 93dbeef54e2e7bbd5583a5539710191ed68ec8fd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Press a card all the way through to its write on a live gateway, including a multi-step plan that gets interrupted. The PR says this was never exercised.

Suggestions

  • Every owner change on a hooked route, whether made by card or by hand on the Settings page, now adds a line to Global memory (_record_memory). That puts a change-history log into memory the model reads in every crewmate's context. diagnose_settings could read the existing SEL/audit trail instead, which keeps the Settings page free of this side effect.

[DESIGN-REVIEWED] 93dbeef

Description read

[DESCRIPTION-READ] 20ab3d632ffa306f0f21d75f2a3d26193b2eadcd18d2ae2f26f63ed3c63af82d

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ human override accepted

@buluoray overrode this lane for 93dbeef54e2e7bbd5583a5539710191ed68ec8fd via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@buluoray overrode this lane for 93dbeef54e2e7bbd5583a5539710191ed68ec8fd via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @buluoray overrides the GPT 6.1 finding for 93dbeef54e2e7bbd5583a5539710191ed68ec8fd; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] 93dbeef

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:
/ai-review override gpt 93dbeef54e2e7bbd5583a5539710191ed68ec8fd: <one-sentence reason>

@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 Oct 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 Oct 9, 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 labels Oct 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 Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 93dbeef54e2e7bbd5583a5539710191ed68ec8fd — this comment is updated in place on each push.

Review details

No findings block this merge. Two advisory findings in the new diagnose probes.

FINDING — src/kiro_crew/diagnose_probes.py:278 — the probe checks path.stem in listed, but list_agents names an agent by the spec's name field. A package-installed spec ({package}-{name}.json) or any other spec whose name differs from its filename, changed after the gateway started, is listed correctly yet reported as a PROBLEM telling the user to fix a valid spec → Fix: compare against AgentInfo.filename (or the parsed name) rather than path.stem.

FINDING — src/kiro_crew/diagnose_probes.py:576 — "?mode=ro&immutable=1" makes SQLite ignore the -wal of memory.db, which vector_memory.py keeps in WAL mode and the running gateway writes to. Rows and embedding updates that haven't been checkpointed are left out of the counts, so without_embedding/wrong_dimension come out wrong. A checkpoint that runs during the read can also raise "malformed", and the probe then reports unknown → Fix: open with mode=ro only.

[OPUS-REVIEWED] 93dbeef

Verdict parsed from the review's SHA-scoped output markers for commit 93dbeef54e2e7bbd5583a5539710191ed68ec8fd.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 93dbeef54e2e7bbd5583a5539710191ed68ec8fd: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the ux AI finding as false positive, not applicable, or explicitly accepted for 8a2fd7e2f414c1cb279b027c0350d388b989c650.

Owner decision: no new screenshots for this PR; the card copy and states are covered by tests, and the remaining evidence gaps are accepted by the owner.

This decision applies only to this commit. A new push requires a new judgment.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • A core save path now depends on aiohttp internals: accepted, deferred.

The hook reads an ordinary save only when it can record it (a declared length within 1 MiB on a MEMORY_ROUTES route); otherwise the request reaches the route untouched. The replay through request._payload is pinned by the route tests that read the body both as request.json() and by iterating request.content, so an aiohttp change that breaks it fails CI. Recording from the handler's own parsed body instead is the cleaner shape and goes with the card follow-ups (#18825).

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Hand edits now reach every agent's context: kept.

The line names only what changed (never a secret, environment or token value), is written only when persistent memory is on, and is how diagnose_settings explains a surprise the owner caused by hand. It is documented in context-management.md and the PR description.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Item 3 Secret-save card, and approval mode reachable through the setting card: accepted, owner decision.

The owner keeps secret.save, app-trust and denied-command cards in scope for this PR and will amend the RFC to list them. Approval mode stays a widening setting behind the acknowledgement tick plus the owner's press, as the owner decided for widening cards. The secret value is typed into the card and goes only to the vault; the agent never sees it.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Item 5 Manual Settings edits written to Global memory: kept, rebutted as oversized.

The line is what lets diagnose_settings answer "why does it behave differently" with what the owner changed and when, whether by card or by hand; card-only history would hide exactly the manual edits that usually explain a surprise. It names only what changed, never a secret, environment or token value, writes nothing when persistent memory is off, and is documented in context-management.md and the PR description. An ordinary save is never refused or altered by the hook that records it.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 8a2fd7e: Infrastructure failure, not a finding: discovery returned under 250 characters with no [OPUS-DISCOVERY] marker on both the run and its rerun.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the fable AI finding as false positive, not applicable, or explicitly accepted for 8a2fd7e2f414c1cb279b027c0350d388b989c650.

Infrastructure failure, not a finding: discovery returned under 250 characters with no [OPUS-DISCOVERY] marker on both the run and its rerun.

This decision applies only to this commit. A new push requires a new judgment.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Apply grows records beyond the loader's size budget: accepted residual, owner decision.

Reaching it needs an agent to propose about 400 near-limit cards (each clearing some 200 tool references) and the owner to press Apply on every one, so the applied records outgrow the 32 MiB file bound. Each card is still capped at proposal, the store still holds at most 512, and the outcome of the extreme case is a 503 the owner sees, not a silent loss: the file is left intact and is read again once trimmed.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 8a2fd7e: Owner decision: reaching it needs about 400 near-limit cards proposed and each one applied by the owner; every card is capped at proposal and the store at 512, and the extreme case is a visible 503 with the file left intact, not data loss.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 8a2fd7e2f414c1cb279b027c0350d388b989c650.

Owner decision: reaching it needs about 400 near-limit cards proposed and each one applied by the owner; every card is capped at proposal and the store at 512, and the extreme case is a visible 503 with the file left intact, not data loss.

This decision applies only to this commit. A new push requires a new judgment.

@buluoray

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 71b78f0
  • What rule changed: security_posture.py adds three entries to its inventory and widens one existing entry.
    • dashboard/change_cards.py: the settings diagnosis. A credential-like key is reduced to whether it is set, and every remaining value passes the credential redactor before it reaches an agent.
    • change_card_catalog.py: the values a change card shows before Apply (an MCP server's launch line, environment values and request headers), each passed through the credential redactor.
    • diagnose_probes.py: evidence strings from the read-only probes, redacted before they leave the probe.
    • The existing guide-row entry now also covers change-card rows.
    • The secrets vault gains a revisioned write and a revisioned delete (set_with_revision, delete_if_revision). POST /api/secrets also returns the stored entry's revision, a digest of the ciphertext under a fresh nonce that says nothing about the value. DELETE /api/secrets/{name}?if_revision= deletes only while that revision is still stored, checking and deleting under one store lock. Both routes stay owner-only, and no value is ever returned.
    • The cron store gains an internal compare-and-delete used only by a schedule card's Undo: the job is deleted only while it still matches the snapshot the card wrote, checked and deleted under one cron-store lock. Otherwise Undo answers 409 changed_since_apply and the job and its run history are kept. There is no new HTTP parameter. A delete the fingerprint refused is audited as cron.remove outcome denied with reason=changed_since_apply, not as a missing job.
    • The card hook never refuses an ordinary (no-card) save: a body with no declared length or over 1 MiB reaches the route untouched and records no memory line, so no route accepts less than it did on main.
    • An owner change on a route a card can write, by card or by hand on the Settings page, appends one Dashboard: ... line to Global memory history. It names what changed, never a secret, environment or token value, and nothing is written when persistent memory is off.
    • Undo is narrowed, never widened. A crewmate card's Undo deletes the crewmate only while its immutable member_id still matches, checked inside the config deletion lock; a schedule's delete compares under the cron store lock. Cards whose inverse would delete by name alone (MCP uninstall, connection disconnect, trusted-app revoke, denied-command rule delete), and a schedule update whose inverse is an unconditional cron PATCH, now offer no Undo at all (undo_unavailable_reason: no_identity_check); their Apply is unchanged. A crewmate update card's Undo writes the old fields back only while the crewmate's member_id still matches the one its apply recorded, checked under the config lock the update route saves under; otherwise it answers 409 changed_since_apply.
    • No deny rule, sandbox scope, credential path or approval default changes. Every change a card applies goes through the existing owner-only routes, only on the user's own Apply.
  • Before -> after (what was allowed/blocked, now): before, there were no change cards. After, an agent can propose one registered change, the user sees exactly what Apply runs, and nothing changes until the owner presses Apply in the dashboard. A secret typed into a secret card is sent only to the vault and never returned to the agent. Nothing that was blocked before is allowed now.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a setting value or probe excerpt holding a credential reaches an agent's context, or a card's launch line shows a credential. Each of these outputs runs the shared credential redactor, and the diagnosis reduces credential-like keys to set/unset before any redaction.
  • Evidence checked (which sandbox result proves it): test_security_posture.py (inventory and redaction-module coverage), test_change_cards.py and test_change_card_one_shot.py (owner-only apply, plan match, redaction of card values and probe evidence), test_guide_server.py and test_guide_admission.py pass on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): the route tests above apply and undo each registered kind through the real owner-only handlers. A preview gateway built from this branch showed a schedule card in a crewmate chat (the screenshot is in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): there are no new config keys, and the existing settings, schedule and MCP routes are unchanged; a card calls them as the dashboard already does. This is covered by test_change_cards.py.
    • Existing tests (which suites passed on this head): test_security_posture.py, the card and guide suites above, the composition and spec-byte contracts, flake8, mypy, tsc, build, i18n and docs-lint.
  • How to undo: revert the commit. The inventory entries, the card routes and the card tools go with it, and stored card rows simply stop rendering.

@buluoray

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 9824775
  • What rule changed: security_posture.py adds three entries to its inventory and widens one existing entry.
    • dashboard/change_cards.py: the settings diagnosis. A credential-like key is reduced to whether it is set, and every remaining value passes the credential redactor before it reaches an agent.
    • change_card_catalog.py: the values a change card shows before Apply (an MCP server's launch line, environment values and request headers), each passed through the credential redactor.
    • diagnose_probes.py: evidence strings from the read-only probes, redacted before they leave the probe.
    • The existing guide-row entry now also covers change-card rows.
    • The secrets vault gains a revisioned write and a revisioned delete (set_with_revision, delete_if_revision). POST /api/secrets also returns the stored entry's revision, a digest of the ciphertext under a fresh nonce that says nothing about the value. DELETE /api/secrets/{name}?if_revision= deletes only while that revision is still stored, checking and deleting under one store lock. Both routes stay owner-only, and no value is ever returned.
    • The cron store gains an internal compare-and-delete used only by a schedule card's Undo: the job is deleted only while it still matches the snapshot the card wrote, checked and deleted under one cron-store lock. Otherwise Undo answers 409 changed_since_apply and the job and its run history are kept. There is no new HTTP parameter. A delete the fingerprint refused is audited as cron.remove outcome denied with reason=changed_since_apply, not as a missing job.
    • The card hook never refuses an ordinary (no-card) save: a body with no declared length or over 1 MiB reaches the route untouched and records no memory line, so no route accepts less than it did on main.
    • An owner change on a route a card can write, by card or by hand on the Settings page, appends one Dashboard: ... line to Global memory history. It names what changed, never a secret, environment or token value, and nothing is written when persistent memory is off.
    • Undo is narrowed, never widened. A crewmate card's Undo deletes the crewmate only while its immutable member_id still matches, checked inside the config deletion lock; a schedule's delete compares under the cron store lock. Cards whose inverse would delete by name alone (MCP uninstall, connection disconnect, trusted-app revoke, denied-command rule delete), and a schedule update whose inverse is an unconditional cron PATCH, now offer no Undo at all (undo_unavailable_reason: no_identity_check); their Apply is unchanged. A crewmate update card's Undo writes the old fields back only while the crewmate's member_id still matches the one its apply recorded, checked under the config lock the update route saves under; otherwise it answers 409 changed_since_apply.
    • No deny rule, sandbox scope, credential path or approval default changes. Every change a card applies goes through the existing owner-only routes, only on the user's own Apply.
  • Before -> after (what was allowed/blocked, now): before, there were no change cards. After, an agent can propose one registered change, the user sees exactly what Apply runs, and nothing changes until the owner presses Apply in the dashboard. A secret typed into a secret card is sent only to the vault and never returned to the agent. Nothing that was blocked before is allowed now.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a setting value or probe excerpt holding a credential reaches an agent's context, or a card's launch line shows a credential. Each of these outputs runs the shared credential redactor, and the diagnosis reduces credential-like keys to set/unset before any redaction.
  • Evidence checked (which sandbox result proves it): test_security_posture.py (inventory and redaction-module coverage), test_change_cards.py and test_change_card_one_shot.py (owner-only apply, plan match, redaction of card values and probe evidence), test_guide_server.py and test_guide_admission.py pass on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): the route tests above apply and undo each registered kind through the real owner-only handlers. A preview gateway built from this branch showed a schedule card in a crewmate chat (the screenshot is in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): there are no new config keys, and the existing settings, schedule and MCP routes are unchanged; a card calls them as the dashboard already does. This is covered by test_change_cards.py.
    • Existing tests (which suites passed on this head): test_security_posture.py, the card and guide suites above, the composition and spec-byte contracts, flake8, mypy, tsc, build, i18n and docs-lint.
  • How to undo: revert the commit. The inventory entries, the card routes and the card tools go with it, and stored card rows simply stop rendering.

@buluoray

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 816c118
  • What rule changed: security_posture.py adds three entries to its inventory and widens one existing entry.
    • dashboard/change_cards.py: the settings diagnosis. A credential-like key is reduced to whether it is set, and every remaining value passes the credential redactor before it reaches an agent.
    • change_card_catalog.py: the values a change card shows before Apply (an MCP server's launch line, environment values and request headers), each passed through the credential redactor.
    • diagnose_probes.py: evidence strings from the read-only probes, redacted before they leave the probe.
    • The existing guide-row entry now also covers change-card rows.
    • The secrets vault gains a revisioned write and a revisioned delete (set_with_revision, delete_if_revision). POST /api/secrets also returns the stored entry's revision, a digest of the ciphertext under a fresh nonce that says nothing about the value. DELETE /api/secrets/{name}?if_revision= deletes only while that revision is still stored, checking and deleting under one store lock. Both routes stay owner-only, and no value is ever returned.
    • The cron store gains an internal compare-and-delete used only by a schedule card's Undo: the job is deleted only while it still matches the snapshot the card wrote, checked and deleted under one cron-store lock. Otherwise Undo answers 409 changed_since_apply and the job and its run history are kept. There is no new HTTP parameter. A delete the fingerprint refused is audited as cron.remove outcome denied with reason=changed_since_apply, not as a missing job.
    • The card hook never refuses an ordinary (no-card) save: a body with no declared length or over 1 MiB reaches the route untouched and records no memory line, so no route accepts less than it did on main.
    • An owner change on a route a card can write, by card or by hand on the Settings page, appends one Dashboard: ... line to Global memory history. It names what changed, never a secret, environment or token value, and nothing is written when persistent memory is off.
    • Undo is narrowed, never widened. A crewmate card's Undo deletes the crewmate only while its immutable member_id still matches, checked inside the config deletion lock; a schedule's delete compares under the cron store lock. Cards whose inverse would delete by name alone (MCP uninstall, connection disconnect, trusted-app revoke, denied-command rule delete), and a schedule update whose inverse is an unconditional cron PATCH, now offer no Undo at all (undo_unavailable_reason: no_identity_check); their Apply is unchanged. A crewmate update card's Undo writes the old fields back only while the crewmate's member_id still matches the one its apply recorded, checked under the config lock the update route saves under; otherwise it answers 409 changed_since_apply.
    • No deny rule, sandbox scope, credential path or approval default changes. Every change a card applies goes through the existing owner-only routes, only on the user's own Apply.
  • Before -> after (what was allowed/blocked, now): before, there were no change cards. After, an agent can propose one registered change, the user sees exactly what Apply runs, and nothing changes until the owner presses Apply in the dashboard. A secret typed into a secret card is sent only to the vault and never returned to the agent. Nothing that was blocked before is allowed now.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a setting value or probe excerpt holding a credential reaches an agent's context, or a card's launch line shows a credential. Each of these outputs runs the shared credential redactor, and the diagnosis reduces credential-like keys to set/unset before any redaction.
  • Evidence checked (which sandbox result proves it): test_security_posture.py (inventory and redaction-module coverage), test_change_cards.py and test_change_card_one_shot.py (owner-only apply, plan match, redaction of card values and probe evidence), test_guide_server.py and test_guide_admission.py pass on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): the route tests above apply and undo each registered kind through the real owner-only handlers. A preview gateway built from this branch showed a schedule card in a crewmate chat (the screenshot is in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): there are no new config keys, and the existing settings, schedule and MCP routes are unchanged; a card calls them as the dashboard already does. This is covered by test_change_cards.py.
    • Existing tests (which suites passed on this head): test_security_posture.py, the card and guide suites above, the composition and spec-byte contracts, flake8, mypy, tsc, build, i18n and docs-lint.
  • How to undo: revert the commit. The inventory entries, the card routes and the card tools go with it, and stored card rows simply stop rendering.

A crewmate can now prepare a change to Kiro Crew instead of only
pointing at the control: propose_change names one registered kind
(settings, schedules and one-time reminders, crewmates and their
capabilities, templates, MCP servers, connections, secrets, app trust,
denied-command rules) and the gateway writes what changes, the risk
and the exact requests. Nothing changes until the user presses the
card; the browser replays the routes the settings pages already call,
under a hook that verifies each step.

find_setting, get_member_capabilities and diagnose_settings are the
read-only lookups a proposal needs. A secret is typed into the card
and never passes through the agent, and a card that widens what an
agent may do without asking needs an acknowledgement tick as well as
the press. Only a turn the user sent from the dashboard may propose.
@buluoray

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 93dbeef
  • What rule changed: security_posture.py adds three entries to its inventory and widens one existing entry.
    • dashboard/change_cards.py: the settings diagnosis. A credential-like key is reduced to whether it is set, and every remaining value passes the credential redactor before it reaches an agent.
    • change_card_catalog.py: the values a change card shows before Apply (an MCP server's launch line, environment values and request headers), each passed through the credential redactor.
    • diagnose_probes.py: evidence strings from the read-only probes, redacted before they leave the probe.
    • The existing guide-row entry now also covers change-card rows.
    • The secrets vault gains a revisioned write and a revisioned delete (set_with_revision, delete_if_revision). POST /api/secrets also returns the stored entry's revision, a digest of the ciphertext under a fresh nonce that says nothing about the value. DELETE /api/secrets/{name}?if_revision= deletes only while that revision is still stored, checking and deleting under one store lock. Both routes stay owner-only, and no value is ever returned.
    • The cron store gains an internal compare-and-delete used only by a schedule card's Undo: the job is deleted only while it still matches the snapshot the card wrote, checked and deleted under one cron-store lock. Otherwise Undo answers 409 changed_since_apply and the job and its run history are kept. There is no new HTTP parameter. A delete the fingerprint refused is audited as cron.remove outcome denied with reason=changed_since_apply, not as a missing job.
    • The card hook never refuses an ordinary (no-card) save: a body with no declared length or over 1 MiB reaches the route untouched and records no memory line, so no route accepts less than it did on main.
    • An owner change on a route a card can write, by card or by hand on the Settings page, appends one Dashboard: ... line to Global memory history. It names what changed, never a secret, environment or token value, and nothing is written when persistent memory is off.
    • Undo is narrowed, never widened. A crewmate card's Undo deletes the crewmate only while its immutable member_id still matches, checked inside the config deletion lock; a schedule's delete compares under the cron store lock. Cards whose inverse would delete by name alone (MCP uninstall, connection disconnect, trusted-app revoke, denied-command rule delete), and a schedule update whose inverse is an unconditional cron PATCH, now offer no Undo at all (undo_unavailable_reason: no_identity_check); their Apply is unchanged. A crewmate update card's Undo writes the old fields back only while the crewmate's member_id still matches the one its apply recorded, checked under the config lock the update route saves under; otherwise it answers 409 changed_since_apply.
    • No deny rule, sandbox scope, credential path or approval default changes. Every change a card applies goes through the existing owner-only routes, only on the user's own Apply.
  • Before -> after (what was allowed/blocked, now): before, there were no change cards. After, an agent can propose one registered change, the user sees exactly what Apply runs, and nothing changes until the owner presses Apply in the dashboard. A secret typed into a secret card is sent only to the vault and never returned to the agent. Nothing that was blocked before is allowed now.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a setting value or probe excerpt holding a credential reaches an agent's context, or a card's launch line shows a credential. Each of these outputs runs the shared credential redactor, and the diagnosis reduces credential-like keys to set/unset before any redaction.
  • Evidence checked (which sandbox result proves it): test_security_posture.py (inventory and redaction-module coverage), test_change_cards.py and test_change_card_one_shot.py (owner-only apply, plan match, redaction of card values and probe evidence), test_guide_server.py and test_guide_admission.py pass on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): the route tests above apply and undo each registered kind through the real owner-only handlers. A preview gateway built from this branch showed a schedule card in a crewmate chat (the screenshot is in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): there are no new config keys, and the existing settings, schedule and MCP routes are unchanged; a card calls them as the dashboard already does. This is covered by test_change_cards.py.
    • Existing tests (which suites passed on this head): test_security_posture.py, the card and guide suites above, the composition and spec-byte contracts, flake8, mypy, tsc, build, i18n and docs-lint.
  • How to undo: revert the commit. The inventory entries, the card routes and the card tools go with it, and stored card rows simply stop rendering.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 93dbeef: Owner decision: secret.save, app-trust and denied-command cards are in scope for this PR; the RFC will be amended to list them.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 93dbeef54e2e7bbd5583a5539710191ed68ec8fd.

Owner decision: secret.save, app-trust and denied-command cards are in scope for this PR; the RFC will be amended to list them.

This decision applies only to this commit. A new push requires a new judgment.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override ux 93dbeef: Owner decision: no new screenshots for this PR; the card copy and states are covered by tests, and the remaining evidence gaps are accepted by the owner.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the ux AI finding as false positive, not applicable, or explicitly accepted for 93dbeef54e2e7bbd5583a5539710191ed68ec8fd.

Owner decision: no new screenshots for this PR; the card copy and states are covered by tests, and the remaining evidence gaps are accepted by the owner.

This decision applies only to this commit. A new push requires a new judgment.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • F1 Undo can erase a concurrent edit to the same crewmate: accepted residual, owner decision.

The window is the single await store.flush(strict=True) of the Undo's admission, a few milliseconds. Reaching it needs a second tab's Save to land inside that flush while the same owner clicks Undo in the first tab. Human reaction time is about 200 ms and the two buttons are in different tabs, so only a script sending both requests together can hit it.
The loss is that owner's own just-typed description, visible on the page and restored by editing it again. This is the same residual undo-time window the owner accepted for every in-place card (the Undo baseline is what the card wrote; a change seen before the Undo is refused with changed_since_apply). The replacement-crewmate case is closed by the member_id check under the config lock.

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 93dbeef: Owner decision, same finding as overridden on 1a98c8b: the race needs a second tab's save to land inside a few-millisecond admission flush while the same owner clicks Undo, which no human can do (about 200 ms reaction, two tabs); the loss is the owner's own visible edit, the residual undo-time window already accepted for in-place cards.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 93dbeef54e2e7bbd5583a5539710191ed68ec8fd.

Owner decision, same finding as overridden on 1a98c8b: the race needs a second tab's save to land inside a few-millisecond admission flush while the same owner clicks Undo, which no human can do (about 200 ms reaction, two tabs); the loss is the owner's own visible edit, the residual undo-time window already accepted for in-place cards.

This decision applies only to this commit. A new push requires a new judgment.

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.

2 participants