Skip to content

feat(memory): let an app manage Crew's memory with the owner's consent - #37498

Draft
bolichen97 wants to merge 1 commit into
mainfrom
feat/memory-provider-governance
Draft

bolichen97 wants to merge 1 commit into
mainfrom
feat/memory-provider-governance

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An installed memory app can manage Crew's memory for the owner (browse, edit, plan moves and benchmarks, and ask to switch providers), while every switch, move and benchmark run is still approved only by the owner, on one clear host-drawn card.

The owner-only provider API (#37218) gives Crew a memory provider seam, but only the owner's own dashboard can use it. A memory manager app cannot read or tidy memory, and it has no way to ask the owner to switch or move memory. The confirm sheets and the Settings card that went with that work were hard to read: long sentences, a stack of checkboxes, and grey disabled buttons with no reason.

Why it matters

Memory apps are how users bring their own memory to Crew. Without an app grant they cannot do their job, and without a clear sheet the owner cannot tell what a switch does before pressing it. The sheet is the one place a switch or move is approved, so it has to say plainly what changes, where memory is kept, and that the app cannot press it.

Not a goal

  • Merging before feat(memory): let an app serve, replace or receive Crew's memory #37218. This PR is stacked on feat/memory-provider-api and stays a draft until that lands and its base is main.
  • A built-in memory app. The consumer is an external App Kit app, kept out of this repo by no-new-builtin-apps.
  • New agent-facing MCP tools or CLI verbs.
  • Letting an app switch, run a move, roll one back or start a benchmark itself.

What changed (motivation → approach → change)

An app needs a grant the owner can see and revoke, a narrow path to memory routes, and a way to ask for the owner's press. So:

Part What it does
permissions.memoryAdmin One manifest flag. It is staged and approved like an api entry (point_grants.py, token_auth_app_scope.py); handlers check it again and audit each call with the app's name. The trust prompt, re-approval row and permissions card (trustGrants.ts, TrustAppModal.tsx) show it as one plain line that leads with the outcome: "Read and edit Crew's memory and the instructions your Bots follow", then each Bot's rules, long-term goals and personality, and the standing instructions for every chat.
/api/memory/provider/host/<rest> A facade (memory_app_host.py) with an allowlist of memory reads and edits. Anything else answers 404; no grant answers 403. The grant rides in server-side request state, never a header. Every JSON answer relayed to an app is redacted, and an app cannot save back a document it only saw redacted (409); chat_steering.py lets the grant reach the owner's chat steering.
SDK verbs requestMemoryProviderChange, requestMemoryMove, requestMemoryBench open host sheets. The app only gets back what happened.
Owner memory routes GET /api/memory/context-stack, Dreaming's queue GET/POST /api/memory/review (memory_dream.py records each cited row's updated_at; a proposal whose rows changed answers 409 and stays listed, and one leaves the list only after its edits succeed) and GET/PUT /api/members/{slug}/soul (contained, size-capped, redacted read). src/kiro_crew/memory_edit.py filters records by tier, source and status and adds bulk re-tier and unforget; context_blocks.py gives the app's prompt preview its block spans.
Dashboard wiring App.tsx mounts the three sheet hosts; hooks/websocket/serverState.ts re-reads the provider caches on the memory_provider frame; api/client/memory.ts adds the calls; app-sdk/memoryProviderChange.ts, memoryMove.ts, memoryBench.ts and public/vendor/kirocrew-app-sdk.mjs carry the verbs; AppDetailPage.tsx and appDetailPageStagedGrants.ts show the grant for approval; MemoryTab.tsx mounts the card.
Supporting edits adoption_pin.py counts memoryAdmin at App Kit level 8; config help, CLI hints and user docs (memory_sections.py, config-baseline.json, cli_memory_provider.py, src/kiro_crew/docs) point at Settings instead of a raw route; capabilities.memory_provider (platform/governance_parts/catalog.py, baseline.py, read by memory_provider/resolver.py) lets a policy keep every store on Crew memory; security_posture_sinks_gateway.py registers the facade; catalogs in website/src/i18n for all 12 languages; coverage tests in website/src/test; eval/bench/provider_run.py keeps benchmark plans and runs in separate budgets, so an app's plans never evict an owner's run. eval/bench/own_memory.py honours include_documents: true reads the store's documents through Crew's own provider read and screens them like other items; false leaves them out.
Sheets and Settings Redesigned (below).
Preview switch, default off The whole memory provider feature, including what #37218 shipped, sits behind one switch (memory_provider/preview.py, routes_preview.py), which binds the Shared Crew switch's own mechanism (PreviewSwitch, gate and the GET/PUT handlers, moved into shared_crew/preview.py and shared_crew/routes_preview.py with no Shared Crew behavior change): KIROCREW_MEMORY_PROVIDER_PREVIEW=1, or the owner's memory_provider_preview.json keystone written by the owner-only PUT /api/memory/provider-preview and read once at start (a READONLY sandbox leaf in sandbox_leaves.py, sandbox_precreate.py and security/paths_lists.py). Off: the resolver answers Crew memory whatever config says (and the native-memory pin, which reads the same answer, sends nothing), every /api/memory/provider/* route answers 404, memoryAdmin is never granted, and the card, sheets and SDK verbs (not_enabled) stay out. A row in Settings > Feature previews turns it on.

Each sheet is now one card (memorySheetParts.tsx). The switch sheet asks "Switch to ?", says in one line what happens, then answers four rows from the provider's handshake: where memory lives (warning colour when it leaves the device), read, write and delete, whether existing memory is copied first, and switching back. With the copy ticked, the copy into a provider runs to its end before the switch is sent; a failed copy or a sheet closed mid-copy switches nothing, and a remote target's consent rides on that copy (egress_consent on the owner's move start). Any consent it needs sits in one warning box. One full-width Switch button, a quiet Cancel under it, and a closing line saying only the owner can approve. The copy and bench sheets use the same card; the copy sheet asks for a remote target's consent before its run, and its plan needs none. Settings shows the memory in use (mark, name, health dot, mode, "Switch back"), then "Other providers", one row each with one line and a "Switch" link. Theme tokens only; readable at 320px in light and dark (an ask-the-agent link on the card wraps under its error on a phone). Specs: app-kit-platform.md and the feature map.

Backwards compatibility

Compatible: the feature is off until the owner turns its preview on, so an existing install behaves as before #37218 whatever its config says; with it on, every new path needs a manifest flag no shipped app declares.

Removes nothing: the catalog keys this diff drops were added by this branch for the old sheets and never shipped.

Tests

  • test_memory_app_host.py: a granted app reaches a listed route and is audited; no grant gives 403; an unlisted route gives 404; a direct owner-route call stays refused.
  • test_memory_provider_routes_auth.py: the grant admits only provider routes and needs its own approval; an app plans a benchmark but never runs one; no app or agent can switch.
  • MemoryProviderSheet.test.tsx: only the owner's press switches; a remote provider needs consent; the copy runs before the switch and closing mid-copy switches nothing (fails on the old order); a copy that skipped a kind the provider does not hold (documents aside) switches nothing; Close waits while the switch after a finished copy is on its way; a failed copy back into Crew memory still reports the switch; each row answers from the handshake and the copy tick; the sheet keeps naming the provider it switched away from after the switch lands (fails with the freeze removed). 10 of 10 shuffled runs of the three sheet files pass.
  • MemoryMoveSheet.test.tsx, MemoryBenchSheet.test.tsx: plan, run, undo and acknowledgement paths.
  • test_memory_app_host_review.py: a merge whose keeper is gone or whose folded row was corrected is refused and stays listed; an edit that fails leaves the proposal listed; a SOUL.md link out of the workspace (a credential file, /dev/zero) is refused; an oversized one answers 413; the read is redacted.
  • serverState.memoryProvider.test.ts: the memory_provider refresh frame re-reads the provider overview and the move list (fails without the refresh target).
  • MemoryMoveSheet.test.tsx: a move list that cannot be read shows an error. A copy that left a conflicting item (edited on both sides) is reported, not closed silently.
  • test_memory_provider_routes_auth.py: a catalog row carries memoryAdmin so the install prompt can name it.
  • test_memory_app_host.py: a steering file read through the facade comes back redacted. Both host test files cover the facade, review-queue, SOUL and context-stack branch (97% of memory_app_host.py). A goals read through the facade is the owner's record its goal writes edit; the dashboard re-reads the preview switch on reconnect. With the preview off the app page holds no memoryAdmin grant for approval (appDetailPageStagedGrants.test.ts).
  • test_chat_steering_plan.py: the facade grant reads the owner's chat steering; another app still gets 404.
  • test_memory_edit.py: a source filter finds a V1 experience by its listed source (fails with the fix reverted); a malformed tier filter is a 400, not a 500.
  • test_memory_provider_routes_auth.py: an app reads a bench run the owner started, not another app's plan.
  • MemoryMoveSheet.test.tsx: a rolled-back move answers cancelled.
  • test_memory_app_host.py: an app's PUT over a document holding a secret is refused; a clean one is written.
  • AppHostCoverage.test.tsx: an app with memoryAdmin gets the /api/memory/provider scope in its own UI (AppHost.tsx).
  • MemoryBenchSheet.test.tsx: the egress acknowledgement names the app version, not the handshake version.
  • test_memory_edit.py: a malformed status filter is a 400. A live record listed under status=any selects for a bulk edit without a stale-preview refusal.
  • test_memory_app_host_review.py: a SOUL.md holding a secret is not replaced by its masked copy; a Bot on the default workspace with no workspaces entry finds its SOUL.md folder like its chat does, and an unknown workspace name still finds none (fails on the old lookup). A SOUL.md that makes the Bot's context too big is refused and the old file is put back.
  • TrustAppModalHostApi.test.tsx: memoryAdmin shows as the plain line, never the raw prefix, and that line names every instruction-writing row of HOST_ROUTES.
  • test_memory_provider_migration.py: a plan never sends memory to the target, whether an app or the owner's copy sheet started it.
  • MemoryBenchSheet.test.tsx: the bench sheet says what Run scores, names the test set without its licence, and hides a zero call estimate.
  • MemoryMoveSheet.test.tsx: a finished copy says so with its counts and offers no undo when nothing was copied. MemoryProviderSheet.test.tsx: the add-source sheet's note names adding a source.
  • test_memory_provider_resolver.py: a provider check made with no session is judged by the host governance profile.
  • test_memory_app_host_review.py: accepting a merge or tier proposal over a lesson stored as plain text is refused (409) before any edit, and the proposal stays listed.
  • MemoryMoveSheet.test.tsx: closing the copy sheet while the copy runs answers started; closing right after Undo answers cancelled; closing right after Resume answers started.
  • test_memory_app_host.py: an app's text-replace preview over a stored credential is refused; a clean replace still previews. test_memory_provider_bench.py: many benchmark plans never evict a real run's record or ledger.
  • test_memory_provider_preview.py: with the switch off the resolver answers Crew memory, a saved replace sends no native-memory pin, a provider route answers 404 and memoryAdmin is refused; with it on (env or stored) they work. MemoryProviderSheetHosts.test.tsx: off mounts no sheet and the verbs answer not_enabled. test_memory_provider_bench.py: include_documents decides whether Global V1 documents join the own-memory set (fails on the old code).
  • test_memory_app_host.py: a member document's check reads the member the PUT body names; a goal rewrite is checked against the stored goal; the member roster is not reachable.
  • test_memory_provider_routes_auth.py: an app cannot replace a provider item it only saw redacted.
  • test_memory_edit.py: a tier change keeps an inferred lesson's source and confidence.
  • MemoryMoveSheet.test.tsx: an unknown provider shows its own id, Copy waits for the overview, and a failed connect is said once on Settings.
  • MemoryProviderSheet.test.tsx: the stop-reading sheet describes the leaving source on every row (read only, and where it keeps memory).

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Smoke run on an isolated gateway (own data home, never the live one), all passing: install and trust the Memory App and read its memory line; the facade answers listed reads, and 404s config, members and a .. path; the Memory App's SDK calls open the switch, add-source, stop-reading, copy and benchmark sheets, and each answers switched, moved or cancelled only after the owner's press; Settings switches back through the same sheet. Light, dark and 320px; no page errors and no failed memory-provider calls. Not run: a benchmark run (it needs model calls) and an app-token call (covered by the backend tests).

Screenshots / video

All from a smoke run of this revision's build on an isolated gateway (its own data home), with the Memory App calling the SDK verbs and the fixture provider app from test/fixtures/memory_provider_app.

Install trust prompt with the plain memory line (light, 320px):

Trust prompt

Trust prompt 320px

Switch sheet opened by the app (light, dark, 320px):

Switch sheet

Switch sheet dark

Switch sheet 320px

Settings card with a provider in use (light), Crew memory in use (dark), and 320px:

Settings

Settings dark

Settings 320px

Add a read-only source, then stop reading it:

Add source

Stop reading

Copy sheet: the plan (light, 320px) and the finished copy:

Copy plan

Copy plan 320px

Copy done

Benchmark sheet plan (light, dark, 320px):

Bench plan

Bench plan dark

Bench plan 320px

Related Issues

Part of #36572

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

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 7fa3df6
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/sandbox_leaves.py

  • src/kiro_crew/sandbox_precreate.py

  • src/kiro_crew/security/paths_lists.py

  • src/kiro_crew/security_posture_sinks_gateway.py

  • @bolichen97 posted a complete reasoning template for 502d084.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 502d0844ff8f80574b26fa462fc79ecb6033c2ba — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the app grant is narrow, the owner can see and revoke it, and every switch, move or run still needs the owner's own press.

Notes

  • The preview switch now hides features feat(memory): let an app serve, replace or receive Crew's memory #37218 already merged to main. Anyone who set memory.provider there falls back to Crew memory with no message after upgrading (resolver._chosen answers builtin "whatever config says"). Getting it back takes the Settings row plus a restart (restart_required). Flagging this in the release note would help, because the provider's writes stop being read without warning.
  • memoryAdmin covers more than memory. Through chat_steering.py and PUT /api/members/{slug}/soul, an app can rewrite each Bot's personality and the standing instructions for every chat. The trust line says so. Still, splitting it into its own flag would let an owner grant memory tidying without handing over the prompt itself.
  • Several separable concerns ride in one PR: the preview gate over a shipped feature, the Shared Crew PreviewSwitch extraction, the bench budget split, the own_memory include_documents change and the sheet redesign. Splitting the gate and the extraction out would make each easier to revert.

[DESIGN-REVIEWED] 502d084

Description read

[DESCRIPTION-READ] 3a32b841a069e648cc87ecf055bf2f858494c8fe51f7f37ff71c8e644732f40a

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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of 502d0844ff8f80574b26fa462fc79ecb6033c2ba — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the Settings › Feature previews "Memory providers" toggle and the App detail permissions card with the new memory grant. No screenshot shows either one, and every sheet depends on the toggle.

Evidence gaps

  • "Memory providers" toggle in FeaturePreviewsSection.tsx. No screenshot shows it, its description ("Apps that serve, replace or manage Crew's memory"), its restart notice with the Restart button, its env-override line, or its inline load/save/restart errors. The fix is a screenshot of this row in both states (off, and "on, restart needed").
  • AppDetailPage.tsx grant chips. The permissions card and the re-approval row now show apiGrantLabel(p) prose in place of <code> paths. No screenshot shows either one. The fix is a screenshot of the App detail page for an app with memoryAdmin staged.
  • Switch sheet with a remote provider. No screenshot shows the warning-colour "where memory lives" row or the consent warning box. The fix is a screenshot of the switch sheet for a provider that keeps memory off this machine.

Notes

  • Copy sheet, finished state: the preview said "Would be copied 7", and the result says "0 copied, 7 already there". The reader said: "It doesn't say why." Add one line that says why, or count the items that are already in the destination before the copy runs.
  • Copy sheet buttons: the copy and bench sheets use "Close" where the switch and add-source sheets use "Cancel". The reader wasn't sure "Close" wouldn't keep something going. Before the copy runs, label it "Cancel".
  • Settings card: the reader could not tell "Memory store" from "Memory provider" and "wouldn't touch the dropdown". Give the provider card a heading or helper line that says it picks where memory is kept.

[UX-REVIEWED] 502d084

Description read

[DESCRIPTION-READ] fce821ac4eec39e202d49df2fe1455db026725d8dd743131c5f16138284d3d16

That sha256 names everything this verdict read: the PR description, plus the 19 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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 502d0844ff8f80574b26fa462fc79ecb6033c2ba — 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 does not.

First-Principles-Verdict: PASS

Nothing blocks. Every new path sits behind a preview switch that is off by default. Three items reach past the Goal, or have no consumer in this repo.

Notes

  • Item 4 — zero consumers: none of GET /api/memory/context-stack, GET/POST /api/memory/review or GET/PUT /api/members/{slug}/soul has a caller in this repo. Grepping website/src and src/ finds only the facade allowlist (memory_app_host.py:72-92). The description says the user is "an external App Kit app" but never names its repository. Subtraction: hold these three route groups back until that app's repo is named.
  • Item 7 — rides along: hiding feat(memory): let an app serve, replace or receive Crew's memory #37218's provider feature, which is on base and not yet released, behind a switch that defaults off is not in the frozen Goal. Subtraction: none; it makes the feature smaller.
  • Item 9 — oversized: the own_memory.py handling of "include_documents: true reads the store's documents…" is a benchmark-content change, and the Goal does not ask for it. Subtraction: move it to its own PR.

What this change ships

Inventory (10 items) — 6 justified

Intent: let an installed memory app browse and edit Crew's memory, and ask for switches, moves and benchmarks, which only the owner approves. ADDITION.

  1. A new manifest grant memoryAdmin, shown as one line on the trust prompt — justified
  2. A /api/memory/provider/host/* facade with an allowlist and redaction — justified
  3. Three SDK verbs that open sheets for the owner to approve — justified
  4. New owner routes: context stack, Dreaming review queue, a Bot's soul — zero consumers in this repo
  5. Bulk re-tier and unforget in memory_edit.py — justified
  6. The switch, copy and bench sheets plus the Settings card, redesigned — justified
  7. The whole provider feature hidden behind a Feature-preview switch, off by default — rides along
  8. A capabilities.memory_provider governance scope — justified
  9. Bench reads documents when asked — oversized
  10. Plan and run budgets split; the Shared Crew preview mechanism moved out so both switches use it — justified

[FIRST-PRINCIPLES-REVIEWED] 502d084

Description read

[DESCRIPTION-READ] 901d1ed2044762763379d49db00e0439082241f89265d059d84d55adca6691a2

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ human override accepted

Reviewed 502d0844ff8f80574b26fa462fc79ecb6033c2ba — this comment is updated in place on each push.

Human judgment by @bolichen97 overrides the Opus 5.5 finding for 502d0844ff8f80574b26fa462fc79ecb6033c2ba; the recorded reason is authoritative for this commit.

[OPUS-OVERRIDE] 502d084

Verdict recorded from an authorized human decision for commit 502d0844ff8f80574b26fa462fc79ecb6033c2ba.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 502d0844ff8f80574b26fa462fc79ecb6033c2ba false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 502d0844ff8f80574b26fa462fc79ecb6033c2ba and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 502d084

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 502d0844ff8f80574b26fa462fc79ecb6033c2ba false-positive: <reason, 20 to 500 characters>

@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 Nov 15, 2026
@bolichen97
bolichen97 force-pushed the feat/memory-provider-api branch from 8007f4b to 1051917 Compare November 15, 2026 08:43
@bolichen97
bolichen97 force-pushed the feat/memory-provider-governance branch from 7fa3df6 to 41178d2 Compare November 15, 2026 08:49
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 41178d2
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt, re-approval row and permissions card show the grant as one plain line naming each instruction surface it opens (each Bot's rules, long-term goals and SOUL.md, steering files and each chat's steering). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@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 Nov 15, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

span=b89b7833a437

  • The memory grant reaches prompt-instruction routes

fixed in 41178d2: the trust prompt, re-approval row and permissions card show memoryAdmin as one plain line naming each instruction surface (each Bot's rules, long-term goals and SOUL.md, steering files, each chat's steering), never the raw prefix.
TrustAppModalHostApi.test.tsx pins that line against every instruction-writing row of HOST_ROUTES, so a new row without a label change fails.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=e3d56c0010f6

  • The add-source sheet says it switches

fixed in 41178d2: augment mode is titled 'Add as a read-only source?' and its primary button is 'Add source'.
MemoryProviderSheet.test.tsx asserts the title and button for augment.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=5064bb70960c

  • The switch-back sheet doesn't say which way the copy goes

fixed in 41178d2: the Existing memory row names the source ('Copied from first' / not copied from ), and the Switching back row is dropped when the target is Crew memory.
MemoryProviderSheet.test.tsx covers the switch-back sheet rows.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=ad9c68ef8d87

  • The review queue repeats existing routes

fixed in 41178d2: /api/memory/review now serves only Dreaming proposals; the conflicts and replaced branches, _dismiss and DISMISSED_KEY are deleted. Retired experiences and bulk edits stay on their own allowlisted routes.
test_memory_app_host_review.py: an unknown or non-dream item id answers 404.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=3445fc3cf8eb

  • SOUL.md GET follows symlinks with no cap

fixed in 41178d2: the read goes through member_essential_context._read (real path inside the workspace, no final-link follow, byte cap); over SOUL_MAX_CHARS answers 413 soul_too_large.
test_memory_app_host_review.py: a SOUL.md link to a file outside the workspace and to /dev/zero is refused; an oversized file answers 413.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=e4d2681dae11

  • SOUL reads bypass response redaction

fixed in 41178d2: the SOUL read response goes through _redact_memory_field, the same redaction every memory read uses.
test_memory_app_host_review.py: the SOUL read is redacted.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=e4d2681dae11

  • A stale merge forgets the last surviving lesson

fixed in 41178d2: accepting a Dreaming proposal re-reads every cited row inside the transaction that removes it; a stale one answers 409 review_item_stale and stays listed.
test_memory_app_host_review.py: a merge whose keeper is gone is refused and remains listed; rejecting a stale one removes it.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=fa18895f3940

  • Fresh installs grant memory administration without disclosing it

fixed in 41178d2: trustGrants discloses memoryAdmin (disclosedApi), so the install/enable trust prompt and the installed permissions card show it.
TrustAppModalHostApi.test.tsx: registry and installed manifests with memoryAdmin:true both show the grant line; a non-literal true does not.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=2bf646d1f905

  • Switching between external providers copies the wrong memory

fixed in 41178d2: the copy source is the replacing provider while one is active, else Crew memory, frozen with its name on confirm.
MemoryProviderSheet.test.tsx: switching from provider A to B copies from A.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=e45aa13d3310

  • Error hand-offs leave the host modal covering chat

fixed in 41178d2: every askAgent ErrorNotice in the switch, move and bench sheets passes the sheet's close as onHandoff.
MemoryBenchSheet.test.tsx and MemoryMoveSheet.test.tsx: the hand-off settles the sheet.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=25b31a8c2fe7

  • A failed provider health check displays as working

fixed in 41178d2: the dot is green only when the provider is available and active.health.ok is not false.
MemoryProviderSheet.test.tsx: a table of health and availability cases.

@bolichen97
bolichen97 force-pushed the feat/memory-provider-api branch from 1051917 to 6689ab4 Compare November 15, 2026 09:15
@bolichen97
bolichen97 force-pushed the feat/memory-provider-governance branch from 41178d2 to 13821d0 Compare November 15, 2026 09:15
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 13821d0
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt, re-approval row and permissions card show the grant as one plain line naming each instruction surface it opens (each Bot's rules, long-term goals and SOUL.md, steering files and each chat's steering). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 2023292 owner-decision: agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=ae25990c24ef

  • "Ask the agent" is cut off on a phone

rebutted, stale evidence: shot-08 was captured on an earlier head, before the picker's ask-the-agent notices got actionPlacement="below-on-phone" (MemoryProviderPicker.tsx lines 124, 226, 269 on 41fd945). With it, below sm the notice is flex-wrap and its message takes basis-[calc(100%-2rem)], so the link drops to its own line; the notice sits in the row's min-w-0 flex-col cell, which stretches it to the cell width. The evidence gaps are screenshots only; nothing in the code they name changed behaviour.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override ux 2023292 owner-decision: agent: rebutted in #37498 (comment). shot-08 predates actionPlacement="below-on-phone" on the picker notices, which wraps the ask-the-agent link under its error below sm. Override authorized by bolichen97.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the ux AI finding on 20232927e23fc3b83daae01cebc890a739309b7f.

agent: rebutted in #37498 (comment). shot-08 predates actionPlacement="below-on-phone" on the picker notices, which wraps the ask-the-agent link under its error below sm. Override authorized by bolichen97.

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

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: UX Review. Re-run the lane's latest workflow run for 20232927e23fc3b83daae01cebc890a739309b7f manually from the Actions tab.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: your repository permission could not be READ (the collaborator-permission API did not answer after 3 attempts). This is not a permission denial -- re-issue the command once the API is healthy.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 2023292 owner-decision: agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the fable AI finding on 20232927e23fc3b83daae01cebc890a739309b7f.

agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

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

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 3c41320
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions, and not the member roster, which carries each Bot's last message). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt (fed from the catalog row, which now carries memoryAdmin: official_catalog._DISCLOSED_PERMISSIONS), re-approval row and permissions card show the grant as one plain line that leads with the outcome ("Read and edit Crew's memory and the instructions your Bots follow") and names each surface in plain words (each Bot's rules, long-term goals and personality, and the standing instructions for every chat). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. Every JSON answer the facade relays to an app goes through _redact_memory_field (_redacted_for_app), and a chat steering route reached through it checks the facade grant instead of the app's own-slot rule (chat_steering._chat_rows), and a goals read reached through it takes the owner branch (member_goals.api_member_goals_get), not the trimmed Bots view; an app holding the grant reads bench runs the owner started. A SOUL.md PUT is refused (409 document_holds_secret) when the stored file holds a secret, since every SOUL read is redacted. A saved SOUL.md that makes the Bot's essentials overflow is reverted (413 soul_over_budget). An app's full-document PUT through the facade is refused (409 document_holds_secret) when the stored document's read changes under the redaction, so a masked copy never overwrites the owner's text; that read targets the write's own member (from the body) and refuses (409 document_unchecked) on any failed read other than a 404. An app's PATCH /api/memory/provider/items/{id} is refused (409 document_holds_secret) when the stored item changes under the redaction. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves. The switch sheet copies into a provider before it switches, so the owner's non-dry-run POST /api/memory/provider/migrations (owner only; every app token is refused a run) accepts "egress_consent": true and records it with consent.grant_egress for a remote target before resolving it, the same record the switch PUT writes. A dry-run plan into a remote target without consent is answered (it sends that target no memory); the copy sheet shows the consent box for such a target and its run carries egress_consent. The whole memory provider feature now sits behind one preview switch, default off: KIROCREW_MEMORY_PROVIDER_PREVIEW=1 or the owner's memory_provider_preview.json keystone (READONLY sandbox leaf, written only by the owner-only PUT /api/memory/provider-preview, read once at start); off, the resolver answers Crew memory, every /api/memory/provider/* route answers 404 and memoryAdmin is never granted.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py::test_an_app_cannot_save_back_a_document_it_only_saw_redacted, test_memory_app_host.py::test_a_member_document_is_checked_for_the_member_the_body_names, test_memory_provider_routes_auth.py::test_an_app_cannot_replace_an_item_it_only_saw_redacted, test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=3445fc3cf8eb

  • An app holding memoryAdmin can recover a credential stored in Crew's memory through search and preview oracles

rebutted, not a defect under the app trust model: an app reaches the facade only after the owner trusted it, and that prompt (shown in this PR's screenshots) says the app runs its own code inside Kiro Crew with the same access Kiro Crew has, including saved credentials, and that "Kiro Crew cannot limit it to less". Such an app's backend and UI can already read memory without guessing, so a character-by-character search oracle gives it nothing it lacks.
The facade's redaction keeps credentials out of what an app is handed by default, so they do not land in its logs, UI or provider by accident; it is not a boundary against a hostile trusted app. Matching the owner's search on redacted text would also break search for every legitimate app, which is out of proportion to an attacker that already holds equivalent access.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 3c41320 owner-decision: agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the fable AI finding on 3c413203ff123c764b265c9a4dbd6734acd7ce37.

agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

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

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 3c41320 infra-failure: the lane failed, not the PR. Both GPT passes hit 429 Too Many Requests past the retry limit on two runs of https://github.com/kirodotdev/KiroCrew/actions/runs/44244180199, so no [GPT-REVIEWED] marker was written. Authorized by bolichen97.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override scope 3c41320 infra-failure: the lane failed, not the PR. The first run of https://github.com/kirodotdev/KiroCrew/actions/runs/44244180213 found the trusted scope harness absent and failed closed; the rerun is held at that floor and classified nothing. Authorized by bolichen97.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a infra-failure release (class infra-failure) for the scope AI finding on 3c413203ff123c764b265c9a4dbd6734acd7ce37.

the lane failed, not the PR. The first run of https://github.com/kirodotdev/KiroCrew/actions/runs/44244180213 found the trusted scope harness absent and failed closed; the rerun is held at that floor and classified nothing. Authorized by bolichen97.

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

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a infra-failure release (class infra-failure) for the gpt AI finding on 3c413203ff123c764b265c9a4dbd6734acd7ce37.

the lane failed, not the PR. Both GPT passes hit 429 Too Many Requests past the retry limit on two runs of https://github.com/kirodotdev/KiroCrew/actions/runs/44244180199, so no [GPT-REVIEWED] marker was written. Authorized by bolichen97.

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

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 6317105
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions, and not the member roster, which carries each Bot's last message). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt (fed from the catalog row, which now carries memoryAdmin: official_catalog._DISCLOSED_PERMISSIONS), re-approval row and permissions card show the grant as one plain line that leads with the outcome ("Read and edit Crew's memory and the instructions your Bots follow") and names each surface in plain words (each Bot's rules, long-term goals and personality, and the standing instructions for every chat). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. Every JSON answer the facade relays to an app goes through _redact_memory_field (_redacted_for_app), and a chat steering route reached through it checks the facade grant instead of the app's own-slot rule (chat_steering._chat_rows), and a goals read reached through it takes the owner branch (member_goals.api_member_goals_get), not the trimmed Bots view; an app holding the grant reads bench runs the owner started. A SOUL.md PUT is refused (409 document_holds_secret) when the stored file holds a secret, since every SOUL read is redacted. A saved SOUL.md that makes the Bot's essentials overflow is reverted (413 soul_over_budget). An app's full-document PUT through the facade is refused (409 document_holds_secret) when the stored document's read changes under the redaction, so a masked copy never overwrites the owner's text; that read targets the write's own member (from the body) and refuses (409 document_unchecked) on any failed read other than a 404. An app's PATCH /api/memory/provider/items/{id} is refused (409 document_holds_secret) when the stored item changes under the redaction. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves. The switch sheet copies into a provider before it switches, so the owner's non-dry-run POST /api/memory/provider/migrations (owner only; every app token is refused a run) accepts "egress_consent": true and records it with consent.grant_egress for a remote target before resolving it, the same record the switch PUT writes. A dry-run plan into a remote target without consent is answered (it sends that target no memory); the copy sheet shows the consent box for such a target and its run carries egress_consent. The whole memory provider feature now sits behind one preview switch, default off: KIROCREW_MEMORY_PROVIDER_PREVIEW=1 or the owner's memory_provider_preview.json keystone (READONLY sandbox leaf, written only by the owner-only PUT /api/memory/provider-preview, read once at start); off, the resolver answers Crew memory, every /api/memory/provider/* route answers 404 and memoryAdmin is never granted.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py::test_an_app_cannot_save_back_a_document_it_only_saw_redacted, test_memory_app_host.py::test_a_member_document_is_checked_for_the_member_the_body_names, test_memory_provider_routes_auth.py::test_an_app_cannot_replace_an_item_it_only_saw_redacted, test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 309c05a
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions, and not the member roster, which carries each Bot's last message). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt (fed from the catalog row, which now carries memoryAdmin: official_catalog._DISCLOSED_PERMISSIONS), re-approval row and permissions card show the grant as one plain line that leads with the outcome ("Read and edit Crew's memory and the instructions your Bots follow") and names each surface in plain words (each Bot's rules, long-term goals and personality, and the standing instructions for every chat). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. Every JSON answer the facade relays to an app goes through _redact_memory_field (_redacted_for_app), and a chat steering route reached through it checks the facade grant instead of the app's own-slot rule (chat_steering._chat_rows), and a goals read reached through it takes the owner branch (member_goals.api_member_goals_get), not the trimmed Bots view; an app holding the grant reads bench runs the owner started. A SOUL.md PUT is refused (409 document_holds_secret) when the stored file holds a secret, since every SOUL read is redacted. A saved SOUL.md that makes the Bot's essentials overflow is reverted (413 soul_over_budget). An app's full-document PUT through the facade is refused (409 document_holds_secret) when the stored document's read changes under the redaction, so a masked copy never overwrites the owner's text; that read targets the write's own member (from the body) and refuses (409 document_unchecked) on any failed read other than a 404. An app's PATCH /api/memory/provider/items/{id} is refused (409 document_holds_secret) when the stored item changes under the redaction. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves. The switch sheet copies into a provider before it switches, so the owner's non-dry-run POST /api/memory/provider/migrations (owner only; every app token is refused a run) accepts "egress_consent": true and records it with consent.grant_egress for a remote target before resolving it, the same record the switch PUT writes. A dry-run plan into a remote target without consent is answered (it sends that target no memory); the copy sheet shows the consent box for such a target and its run carries egress_consent. The whole memory provider feature now sits behind one preview switch, default off: KIROCREW_MEMORY_PROVIDER_PREVIEW=1 or the owner's memory_provider_preview.json keystone (READONLY sandbox leaf, written only by the owner-only PUT /api/memory/provider-preview, read once at start); off, the resolver answers Crew memory, every /api/memory/provider/* route answers 404 and memoryAdmin is never granted.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py::test_an_app_cannot_save_back_a_document_it_only_saw_redacted, test_memory_app_host.py::test_a_member_document_is_checked_for_the_member_the_body_names, test_memory_provider_routes_auth.py::test_an_app_cannot_replace_an_item_it_only_saw_redacted, test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: a8b4c98
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions, and not the member roster, which carries each Bot's last message). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt (fed from the catalog row, which now carries memoryAdmin: official_catalog._DISCLOSED_PERMISSIONS), re-approval row and permissions card show the grant as one plain line that leads with the outcome ("Read and edit Crew's memory and the instructions your Bots follow") and names each surface in plain words (each Bot's rules, long-term goals and personality, and the standing instructions for every chat). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. Every JSON answer the facade relays to an app goes through _redact_memory_field (_redacted_for_app), and a chat steering route reached through it checks the facade grant instead of the app's own-slot rule (chat_steering._chat_rows), and a goals read reached through it takes the owner branch (member_goals.api_member_goals_get), not the trimmed Bots view; an app holding the grant reads bench runs the owner started. A SOUL.md PUT is refused (409 document_holds_secret) when the stored file holds a secret, since every SOUL read is redacted. A saved SOUL.md that makes the Bot's essentials overflow is reverted (413 soul_over_budget). An app's full-document PUT through the facade is refused (409 document_holds_secret) when the stored document's read changes under the redaction, so a masked copy never overwrites the owner's text; that read targets the write's own member (from the body) and refuses (409 document_unchecked) on any failed read other than a 404. An app's PATCH /api/memory/provider/items/{id} is refused (409 document_holds_secret) when the stored item changes under the redaction. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves. The switch sheet copies into a provider before it switches, so the owner's non-dry-run POST /api/memory/provider/migrations (owner only; every app token is refused a run) accepts "egress_consent": true and records it with consent.grant_egress for a remote target before resolving it, the same record the switch PUT writes. A dry-run plan into a remote target without consent is answered (it sends that target no memory); the copy sheet shows the consent box for such a target and its run carries egress_consent. The whole memory provider feature now sits behind one preview switch, default off: KIROCREW_MEMORY_PROVIDER_PREVIEW=1 or the owner's memory_provider_preview.json keystone (READONLY sandbox leaf, written only by the owner-only PUT /api/memory/provider-preview, read once at start); off, the resolver answers Crew memory, every /api/memory/provider/* route answers 404 and memoryAdmin is never granted.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py::test_an_app_cannot_save_back_a_document_it_only_saw_redacted, test_memory_app_host.py::test_a_member_document_is_checked_for_the_member_the_body_names, test_memory_provider_routes_auth.py::test_an_app_cannot_replace_an_item_it_only_saw_redacted, test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: e5a441b
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions, and not the member roster, which carries each Bot's last message). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt (fed from the catalog row, which now carries memoryAdmin: official_catalog._DISCLOSED_PERMISSIONS), re-approval row and permissions card show the grant as one plain line that leads with the outcome ("Read and edit Crew's memory and the instructions your Bots follow") and names each surface in plain words (each Bot's rules, long-term goals and personality, and the standing instructions for every chat). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. Every JSON answer the facade relays to an app goes through _redact_memory_field (_redacted_for_app), and a chat steering route reached through it checks the facade grant instead of the app's own-slot rule (chat_steering._chat_rows), and a goals read reached through it takes the owner branch (member_goals.api_member_goals_get), not the trimmed Bots view; an app holding the grant reads bench runs the owner started. A SOUL.md PUT is refused (409 document_holds_secret) when the stored file holds a secret, since every SOUL read is redacted. A saved SOUL.md that makes the Bot's essentials overflow is reverted (413 soul_over_budget). An app's full-document PUT through the facade is refused (409 document_holds_secret) when the stored document's read changes under the redaction, so a masked copy never overwrites the owner's text; that read targets the write's own member (from the body) and refuses (409 document_unchecked) on any failed read other than a 404. An app's PATCH /api/memory/provider/items/{id} is refused (409 document_holds_secret) when the stored item changes under the redaction. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves. The switch sheet copies into a provider before it switches, so the owner's non-dry-run POST /api/memory/provider/migrations (owner only; every app token is refused a run) accepts "egress_consent": true and records it with consent.grant_egress for a remote target before resolving it, the same record the switch PUT writes. A dry-run plan into a remote target without consent is answered (it sends that target no memory); the copy sheet shows the consent box for such a target and its run carries egress_consent. The whole memory provider feature now sits behind one preview switch, default off: KIROCREW_MEMORY_PROVIDER_PREVIEW=1 or the owner's memory_provider_preview.json keystone (READONLY sandbox leaf, written only by the owner-only PUT /api/memory/provider-preview, read once at start); off, the resolver answers Crew memory, every /api/memory/provider/* route answers 404 and memoryAdmin is never granted.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py::test_an_app_cannot_save_back_a_document_it_only_saw_redacted, test_memory_app_host.py::test_a_member_document_is_checked_for_the_member_the_body_names, test_memory_provider_routes_auth.py::test_an_app_cannot_replace_an_item_it_only_saw_redacted, test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles e5a441b owner-decision: product shape decided by the owner in #37498 (comment) : the memory provider feature sits behind a default-off preview; #37218 is in no release tag yet. Override authorized by bolichen97.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=06901b7026f4

  • A first-time owner can't tell what the copy result means

rebutted, stale evidence: shot-11 and shot-13 come from a smoke store that already held those 7 items from an earlier copy run, so the run correctly found them present. The plan counts what it would write before the run starts; the run checks the target again and counts what is already there. The two counts follow from that and are labelled separately ("Would be copied" vs "Already there now"). No code path writes during a plan.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override ux e5a441b owner-decision: agent: rebutted in #37498 (comment) : the copy-result shots come from a smoke store that already held the 7 items, and the plan and run counts are labelled apart. Override authorized by bolichen97.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the first-principles AI finding on e5a441bbb30d7dcdb5bfb481755bb9eecb25aae6.

product shape decided by the owner in #37498 (comment) : the memory provider feature sits behind a default-off preview; #37218 is in no release tag yet. Override authorized by bolichen97.

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

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the ux AI finding on e5a441bbb30d7dcdb5bfb481755bb9eecb25aae6.

agent: rebutted in #37498 (comment) : the copy-result shots come from a smoke store that already held the 7 items, and the plan and run counts are labelled apart. Override authorized by bolichen97.

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

Builds on the owner-only memory provider API. An app whose manifest
declares permissions.memoryAdmin reaches the /api/memory/provider routes
once the owner approves that exact grant; the handlers re-check the
flag, audit every call with the app's name, and keep switching, running
or rolling back a move, and starting a benchmark run, the owner's. An
app token names only Crew's own memory, the store's active provider or
a provider its own manifest declares. Policy can forbid external
providers with capabilities.memory_provider.

A memory manager app reaches Crew's owner memory routes only through
/api/memory/provider/host/<rest>: an allowlist of memory reads and
edits, re-checked for the owner or an approved memoryAdmin grant and
audited, with the grant in server-side request state. It adds the
context stack, Dreaming's review queue (a stale proposal is refused
and stays listed) and a member's SOUL.md (read through the essentials
builder's contained, size-capped read, and redacted), record filters by tier, source and status, and bulk
re-tier and unforget.

The App SDK gains requestMemoryProviderChange, requestMemoryMove and
requestMemoryBench, each opening a host-rendered sheet where only the
owner's press acts. Each sheet is one card: what happens in one line,
then plain rows (where memory lives, what the provider can read, write
and delete, whether existing memory is copied first, switching back),
one primary button, and a closing line saying an app can only ask.
The trust prompt and permission cards show memoryAdmin as one plain
line naming every instruction surface it opens.
Settings gains the memory provider card: the memory in use with a
health dot, then the other providers, each with a switch link.
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 502d084
  • What rule changed: an app manifest gains permissions.memoryAdmin. apps/point_grants.py and dashboard/token_auth_app_scope.py turn it into the one API prefix /api/memory/provider, so install, update staging and owner approval hold it like any api entry; an update that adds it waits for the owner. The memory app host facade /api/memory/provider/host/<rest> (dashboard/handlers/memory_app_host.py) lets the owner, or an app whose approved grant carries memoryAdmin, reach only the (method, route) pairs on HOST_ROUTES (memory reads and edits; nothing that changes config, members, apps or sessions, and not the member roster, which carries each Bot's last message). _caller re-checks the grant and audits each call with the inner path; the inner request carries MEMORY_ADMIN_GRANT in server-side request state, which require_owner_dashboard_request and members_access._deny_app_caller admit and audit. security_posture_sinks_gateway.py registers the facade as a redaction sink. Governance adds the capabilities.memory_provider scope (default on; off in the managed baseline, like other egress capabilities). The trust prompt (fed from the catalog row, which now carries memoryAdmin: official_catalog._DISCLOSED_PERMISSIONS), re-approval row and permissions card show the grant as one plain line that leads with the outcome ("Read and edit Crew's memory and the instructions your Bots follow") and names each surface in plain words (each Bot's rules, long-term goals and personality, and the standing instructions for every chat). The SOUL.md read goes through member_essential_context._read (contained in the workspace, no final-link follow, size-capped) and its response is redacted. Every JSON answer the facade relays to an app goes through _redact_memory_field (_redacted_for_app), and a chat steering route reached through it checks the facade grant instead of the app's own-slot rule (chat_steering._chat_rows), and a goals read reached through it takes the owner branch (member_goals.api_member_goals_get), not the trimmed Bots view; an app holding the grant reads bench runs the owner started. A SOUL.md PUT is refused (409 document_holds_secret) when the stored file holds a secret, since every SOUL read is redacted. A saved SOUL.md that makes the Bot's essentials overflow is reverted (413 soul_over_budget). An app's full-document PUT through the facade is refused (409 document_holds_secret) when the stored document's read changes under the redaction, so a masked copy never overwrites the owner's text; that read targets the write's own member (from the body) and refuses (409 document_unchecked) on any failed read other than a 404. An app's PATCH /api/memory/provider/items/{id} is refused (409 document_holds_secret) when the stored item changes under the redaction. The App SDK verbs requestMemoryProviderChange, requestMemoryMove and requestMemoryBench open host-rendered sheets; they never call a write route themselves. The switch sheet copies into a provider before it switches, so the owner's non-dry-run POST /api/memory/provider/migrations (owner only; every app token is refused a run) accepts "egress_consent": true and records it with consent.grant_egress for a remote target before resolving it, the same record the switch PUT writes. A dry-run plan into a remote target without consent is answered (it sends that target no memory); the copy sheet shows the consent box for such a target and its run carries egress_consent. The whole memory provider feature now sits behind one preview switch, default off: KIROCREW_MEMORY_PROVIDER_PREVIEW=1 or the owner's memory_provider_preview.json keystone (READONLY sandbox leaf, written only by the owner-only PUT /api/memory/provider-preview, read once at start); off, the resolver answers Crew memory, every /api/memory/provider/* route answers 404 and memoryAdmin is never granted.
  • Before -> after (what was allowed/blocked, now): before, an app token reached no /api/memory/provider route (feat(memory): let an app serve, replace or receive Crew's memory #37218 answers 403 owner_only). After, an app with the approved memoryAdmin grant can browse, search, edit, delete, plan a move, export and plan an import on the provider routes, and reach the allowlisted owner memory routes through the facade. An unlisted route, an unmatched path or a .. segment answers 404; an app without the approved grant gets 403 memory_admin_required; a direct app-token call to an owner route stays refused. No header or cookie can set the grant. Switching provider, running, resuming or rolling back a move, starting, resuming or cancelling a benchmark run and building an own-memory eval set still refuse every app token; only the owner's press on the host sheet does them. A policy with capabilities.memory_provider off keeps every store on Crew memory and the resolver reports the provider unavailable, with no silent fallback.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the facade allowlist were wrong, an approved memory app could edit one more memory route than intended; config, apps, sessions and credentials are not on the list and stay unreachable. If the grant check were wrong, an app without approval could read or edit memory, which the 403 tests pin. No command, credential path or sandbox leaf changes.
  • Evidence checked (which sandbox result proves it): test_memory_app_host.py::test_an_app_cannot_save_back_a_document_it_only_saw_redacted, test_memory_app_host.py::test_a_member_document_is_checked_for_the_member_the_body_names, test_memory_provider_routes_auth.py::test_an_app_cannot_replace_an_item_it_only_saw_redacted, test_memory_app_host_review.py (a SOUL.md link to a credential file or /dev/zero is refused, oversize answers 413, the read is redacted, a stale Dreaming merge is refused and stays listed), TrustAppModalHostApi.test.tsx (the grant line names every instruction-writing row of HOST_ROUTES), test_memory_app_host.py (granted app reaches a listed route and is audited, 403 without the grant, 404 for an unlisted route, a direct owner-route call stays refused), test_memory_provider_routes_auth.py::test_memory_admin_admits_the_provider_routes_only, ::test_memory_admin_needs_its_own_approved_grant, ::test_install_approval_carries_the_memory_admin_entry, ::test_no_app_and_no_agent_can_switch, ::test_an_app_plans_a_benchmark_but_never_runs_one, test_security_posture.py (every redactor call site is a registered sink), test_sandbox_governance_mask.py (unchanged leaves).
  • No regression:
    • Tools still work (which tools/commands were run, result): the provider card, switch, switch-back and copy sheets driven on the built dashboard against an isolated gateway with the fixture memory app (screenshots in the PR body).
    • Backward compatible (old config / old data / old callers still work, how checked): no shipped app declares memoryAdmin, so no token gains a route; the owner routes of feat(memory): let an app serve, replace or receive Crew's memory #37218 are unchanged (test_the_owner_switches_and_back, test_the_owner_browses_and_edits_the_active_provider).
    • Existing tests (which suites passed on this head): test_memory_app_host.py, test_memory_provider_*.py, test_memory_edit.py, test_json_object_body_guard.py, test_security_posture.py, test_chat_send_echo_scope.py, test_sandbox_governance_mask.py (1,197 passed together with test_memory_provider_*.py); the full matrix runs in CI on this head.
  • How to undo: revert this commit; no stored data depends on it, and an installed app keeps only an unused manifest flag.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=3445fc3cf8eb

  • An app holding memoryAdmin can recover a credential stored in Crew's memory through search and preview oracles

rebutted, not a defect under the app trust model: an app reaches the facade only after the owner trusted it, and that prompt (shown in this PR's screenshots) says the app runs its own code inside Kiro Crew with the same access Kiro Crew has, including saved credentials, and that "Kiro Crew cannot limit it to less". Such an app's backend and UI can already read memory without guessing, so a character-by-character search oracle gives it nothing it lacks.
The facade's redaction keeps credentials out of what an app is handed by default, so they do not land in its logs, UI or provider by accident; it is not a boundary against a hostile trusted app. Matching the owner's search on redacted text would also break search for every legitimate app, which is out of proportion to an attacker that already holds equivalent access.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 502d084 owner-decision: agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the fable AI finding on 502d0844ff8f80574b26fa462fc79ecb6033c2ba.

agent: rebutted in #37498 (comment). Only a trusted app reaches the facade, and its trust prompt says it runs with the same access Kiro Crew has, saved credentials included, which Crew cannot limit. A search oracle gives such an app nothing it lacks; redaction is a default, not a boundary against it. Override authorized by bolichen97.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant