Skip to content

feat(acp): answer MCP elicitation on both ACP wires - #23271

Merged
CrysisDeu merged 1 commit into
mainfrom
feat/mcp-elicitation
Oct 24, 2026
Merged

CrysisDeu merged 1 commit into
mainfrom
feat/mcp-elicitation

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An MCP server that needs the person to confirm or fill something in mid tool call gets its answer from the person in the dashboard, instead of a silent cancel.

An MCP server may gate a tool on a human answer (MCP elicitation: a confirmation, a short form, a link to visit). The agent cannot answer it, so the harness turns it around as a server→client ACP request. Kiro Crew answered every such request -32601 method not found. On the default KAS backend the engine reports that to the MCP server as cancel, so every elicitation-gated tool failed with the server's refusal text and the agent could do nothing about it (#891 recorded the symptom; #23210 recorded that the engine now routes the request). Live probe in #23210: KAS sends _kiro/mcp/elicitation; a -32601 becomes {"action":"cancel"} at the server.

Why it matters

Servers adopt elicitation for exactly the operations a person must own (publish-to-public, delete, compliance gates). Until Crew answers it, every one of those tools is unusable from Crew, on the backend Crew itself owns, with no way for the user to say yes.

Not a goal

  • Rendering an elicitation on Slack, Discord or other channels: those consumers decline it (the server hears the person was not asked); a channel card is a follow-up.
  • Serving elicitation/complete beyond classifying it as a notification, or the request-scoped (requestId) elicitation outside a session.
  • Making kiro-cli's own v1/v2 engine route elicitations: it answers the MCP server -32601 itself and nothing reaches Crew.
  • Any trust tier, grant or hook that answers an elicitation for the person.

What changed (motivation → approach → change)

Goal: answer the ask with a human, never automatically, never leaving it hanging.

Approach: one module owns the wire shape, both drivers reach it, and a consumer must opt in before an event is yielded — so a consumer that predates the event kind can never leave the tool call open. Chosen over adding a branch to every event consumer (eight of them) because fail-closed-by-default is the property that matters.

  • acp/elicitation.py: parse_elicitation_request reads KAS's _kiro/mcp/elicitation (fields nested under params.elicitation) and the standard elicitation/create (fields flat) into one ElicitationRequest, fail-closed (unsupported property type, non-string enum, >32 fields, non-http(s) URL → ElicitationParseError). validate_form_content checks a person's answers against the requested fields. elicitation_response builds the identical answer for both wires.
  • acp/types.py: METHOD_ELICITATION_CREATE, METHOD_KAS_MCP_ELICITATION, EVENT_ELICITATION_REQUEST, AcpEvent.elicitation; clientCapabilities.elicitation = {form, url} declared again, now pinned to the handler. The key is what makes a standard harness forward a server's elicitation at all; it moves no tool approvals: codex-acp (@agentclientprotocol/codex-acp, CodexElicitationHandler.ts: createMcpElicitationContext / shouldUseAcpElicitation / canUsePermissionFallback) recognises a tool approval as a message-only form and routes it through session/request_permission whatever the client declared; only a form WITH fields and a URL ask consult clientCapabilities.elicitation.
  • Both classifiers (_dispatch.classify_notification, client_turn._process_message) return elicitation for a request on either method.
  • acp/session_handle_elicitation.py + acp/client_elicitation.py (new owners, same contract): unrenderable → decline; consumer without accepts_elicitation → decline; otherwise record pending, yield the event, answer_elicitation validates and sends; cancel_pending_elicitations at the per-turn reset, on session/cancel and at teardown. Providers forward accepts_elicitation / answer_elicitation like child_fidelity_aware.
  • Dashboard: chat_turn/elicitation_prompt.py renders an elicitation row (transient like permission), registers it in the slot's approval registry (Board Blocked lane, Continue 409, Stop all see it), waits the permission window, sends the answer. Only the elicitation route's own accept accepts: every permission-vocabulary resolution (a reject declines; a Stop, the generic approve route and the trust/yolo sweep cancel) is mapped so the server never hears accept for a confirmation nobody gave, the approve route refuses an elicitation id with 409 and the sweep skips those futures. Server-authored display text (message, URL, field titles/descriptions, option labels) is redacted; a request whose field name, option value or default would be rewritten is declined. minItems/maxItems on a multi-select are kept and enforced on both sides. The runner stamps the row it appended and the elicitation_resolved frame carries its mid, which the frontend matches strictly (no fallback to another row) and which display redaction keeps on the row, so a reused ACP request id cannot mark an earlier card. An elicitation row is transient but carved out of the unowed-window set and counted as answered like a permission row, so a bounded transcript read hands the open ask back. handlers/chat_elicitation.py serves POST /api/chat/slots/{slot}/elicitation: dashboard owner only (internal-secret and app callers 403), bound to the row the person read (request_mid must equal slot.approval_instance(request_id, row), so a stale card cannot answer a later ask that reused the ACP id), validates form content before resolving, writes the validated answer onto the row. The approve route's bare-approve fallback leaves elicitation futures out of its sole-pending pick, and its 409 is checked on the resolved owner slot after the session-sharing scan. agent_sdk/elicitation.py is the import surface application code reads the vocabulary from. ElicitationCard.tsx draws string/number/integer/boolean/enum/multi-select fields or the URL on the bg-card ring-1 ring-border notice surface; once resolved it retitles and shows the answer that was sent (accepted / declined / cancelled); a refused answer renders through the shared ErrorNotice, a required-field hint as status text. Strings in all 12 catalogs.
  • Every decision is SEL-audited as tool mcp_elicitation (outcome = action, reason = who decided) in both drivers and the dashboard runner; the pre-turn drain answers a stranded elicitation request cancel like a stranded permission instead of dropping it.
  • AcpProvider._to_llm_event forwards AcpEvent.elicitation (the field-parity test caught it being dropped, which would have handed the dashboard an empty card); the replay corpus gains one synthesized fixture per wire (kas/mcp-elicitation.jsonl, codex/mcp-elicitation.jsonl) and replay_frames an elicitation branch.
  • Fake backend: [[ELICIT:form|url]] raises the request on the launch shape's method and echoes the host's answer.

Backwards compatibility

Compatible: every harness that never sends an elicitation is untouched; a harness that now sees the capability and sends elicitation/create gets decline (consumer not opted in) or a real answer, never the -32601 it got before. A new elicitation row role is transient and read by no existing reader.

Removes nothing: the change adds a method handler, a row role, a route and a card; no key, kind or path is renamed, hidden or removed.

Tests

  • test/test_acp_elicitation.py: both wires parse to one shape; the MCP default mode; URL mode, non-web URL refusal and a URL urlsplit itself rejects; unhashable mode/type/method values refused rather than raising; every unrenderable property shape refused (a bound past the float range and an over-long offered choice included); bounds; as_dict/from_dict round trip; content validation (type, range, length, enum, unknown field); response carries content only on accept; ftp://example.com/x refused as a non-web scheme; handle declines without a consumer, declines unrenderable even with one, yields and sends the validated answer, keeps a bad answer pending, cancels what is left; the same decline-without-consumer, text-only-path decline, yield and relay on AcpClient; and every exit that answers an open ask cancel, pinned on BOTH drivers: AcpSessionHandle.cancel and AcpClient.cancel_session (session/cancel first, then the open request), the per-turn reset in _run_turn / _dispatch_events (answered before the next prompt goes out), and AcpSessionHandle.destroy.
  • test/test_acp_elicitation_runtime.py: the REAL runtime (reader loop → session queue → classifier → handle) against the fake backend as a child, on both launch shapes: a form answer reaches the engine on elicitation/create and on _kiro/mcp/elicitation; a URL ask accepts without content; a consumer that cannot ask a person yields no event and the engine hears decline. A handle.cancel() issued instead of an answer reaches the engine as {"action":"cancel"} for the open ask.
  • test/test_dashboard_elicitation.py: the route through an aiohttp TestClient: valid form answer validated, written to the row, resolves; refused content is a 400 and the ask stays open; decline needs no content and a second answer is 404; URL accept; a permission id cannot be answered through this route; internal-secret and app callers 403; bad bodies 400; read_elicitation_answer maps every permission-vocabulary approval to cancel; the tool approve route refuses an elicitation id (409) and leaves the future pending, a bare approve with no id never picks the sole pending elicitation, and the owner scan refuses an elicitation held by a shared slot; switching the slot to trust or yolo resolves a sibling tool approval and leaves the pending elicitation future, its row and its registry entry untouched; an answer without request_mid is 400 and a stale card's request_mid is 404 while the live card's resolves; the app token's /api/approvals/{id}/{action} route reads an elicitation id as not found while the same grant still settles a tool approval; display redaction redacts labels and taints values and the server's opaque elicitation_id never reaches the row; the row in hand is stamped, not the oldest row with the id; the runner's SEL record reads resolved for a person's answer, window_expired for an unanswered window and stopped for a Stop (not fut.done() after wait_for cancelled it), a Stop's _approval_stopped mark is consumed, the asking server and tool are stamped from the turn's trusted identity, and an accepted answer rides the elicitation_resolved frame.
  • test/test_acp_client_capabilities.py: the capability is declared AND both classifiers route both methods (replaces the "not advertised without a handler" pin).
  • test/test_codex_session_mcp_approval.py::test_real_codex_acp_command_approval_stays_on_request_permission_with_elicitation_declared (Real Adapter lane): the pinned codex-acp 2.2.2, handshaken with CodexHarness().client_capabilities (the elicitation key declared), forwards a command approval as session/request_permission, sends no elicitation/create, and runs the command on allow_once; the frames are the live fixture codex/command-approval-elicitation-declared-live.jsonl. test_chat_persistence_inline_attachments.py: every _TRANSIENT_ROLES member is skipped by the persistence builder.
  • test/test_acp_runtime_pre_turn_drain.py: a stranded elicitation request is answered cancel by the drain. test/test_acp_frame_replay.py: both wires replay into the committed snapshots. test/test_acp_provider.py field parity now covers elicitation.
  • website/src/test/ElicitationCard.test.tsx: draft seeding and shaping (including minItems/maxItems; an untouched optional multi-select is omitted, a required empty one is sent and bounds-checked); the post carries request_mid; an enum choice whose value is '' submits while an unset enum is still caught; a date-time default renders as the text that will be sent; ChatSliceElicitation.test.tsx: resolveByApprovalId writes the frame's answer onto the row the mid names and no other; the card names the asking server and tool and the link's host, refuses an integer past the safe range and a fraction in an integer field with distinct hints, and hands an unset enum a value no option carries so '' stays a real choice; ChatSliceElicitation.test.tsx: an answered elicitation card survives a refresh whose page omits it, and a still-pending one the page no longer lists is retired as stale -- unless a live frame landed after the fetch was dispatched or the card is newer than the page's last row; chatRolesParity.contract.test.ts / appSdkEventScope.test.ts: the elicitation renderer lives in the shared createTranscriptRenderers and elicitation_resolved is in the SDK event-scope table; posts a validated answer; a required-field hint is status text, never an alert; declines; a refused answer renders through ErrorNotice and keeps the form; URL, resolved, declined and cancelled states with the answer summary; claimed by the default renderer registry (slot-less, disabled).
  • Bindings/composition inventories updated for the new owners and members (test_session_handle_bindings, test_client_bindings, test_acp_bindings, chat runner composition, config-dir async guard, redaction sink registry).

Manual verification

  • codex-acp, measured live (above) and read at the canonical TypeScript repo (agentclientprotocol/codex-acp; the pinned 2.2.2 dist): command approvals go handleCommandExecution → requestPermission → session/request_permission and never enter the elicitation handler; shouldUseAcpElicitation returns false for a message-only form (an MCP tool approval) and consults clientCapabilities.elicitation only for a form with fields or a URL ask. pi: test_real_pi_gated_bash_call_asks_through_request_permission already runs under Crew's own handshake with the key declared and is green on this PR. opencode 1.19.1: its ACP server routes tool permissions through requestPermission and never calls the SDK's unstable_createElicitation (one occurrence in the binary, its definition). claude-agent-acp and goose carry no elicitation code. So with the key declared, none of pi, opencode, claude-agent-acp or goose changes what it sends today; codex-acp sends elicitation/create only for an MCP server's form-with-fields or URL ask, and any harness that does send one is served by the same elicitation/create handler the fake-backend runtime tests drive (the kiro-cli launch shape).
  • Raw ACP driver against the real KAS engine (kiro-cli 2.33.1, bundle 2.29.0) with a dependency-free elicitation-gated MCP server: form and url modes round-trip; a -32601 answer becomes {"action":"cancel"} at the server; kiro-cli v2 never routes the request. Logged in #23210.
  • Crew's own AcpRuntime against the real KAS engine spawned and ran a session, but the probe MCP server could not be mounted under the Crew-bound agent (its tool allowlist), so the end-to-end "real engine + dashboard card" path is covered by the fake-backend runtime tests above rather than a live run.
  • Static gates: mypy, flake8, black gate, isort, agent-sdk boundary, tsc, eslint, restyle ratchet, i18n:check, docs lint, comment-history, brand, harness-parity, flake ratchet, acp-frame host-data — all green locally. local-gate.py's related set is green apart from test_acp_spawn_offload.py and the auto_improvement app tests, which fail identically on main on this host.

Screenshots / video

Form ask, URL ask (naming the asking server · tool and the link's host), answered / declined / not-answered rows, the required-field hint and a refused answer, each in dark and light. Captured from the isolated entry website/capture/elicitation-card.html via scripts/capture-elicitation-card.mjs.

Form ask, dark
Form ask, light
URL ask, dark
Answered, light

More states

URL ask, light
Answered, dark
Declined, dark
Declined, light
Not answered, dark
Not answered, light
Required-field hint, dark
Required-field hint, light
Refused answer, dark
Refused answer, light

Related Issues

Fixes #23210. Follow-up to #891.

Checklist

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

Contribution License Agreement

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

@CrysisDeu
CrysisDeu requested review from a team and KiroCrewCaptain as code owners October 23, 2026 00:59
@CrysisDeu
CrysisDeu requested a review from iamwhatever October 23, 2026 00:59
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @CrysisDeu posted a complete reasoning template for 6b94f5b.

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

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: a real tool-call failure, fixed fail-closed in one place that both drivers use, with rendered evidence of the card attached.

Notes

  • clientCapabilities.elicitation is now sent to all eight selectable backends, but test_codex_session_mcp_approval.py only measures codex. If claude, opencode, goose, pi or deepseek reads that key and moves tool approvals off session/request_permission, Slack, Discord and cron would decline those approvals, because those consumers don't opt in to elicitation. Consider declaring the capability per harness, or measuring one more harness.

[DESIGN-REVIEWED] 6b94f5b

Description read

[DESCRIPTION-READ] 83ab13113c6ce1af898049a55c253997b4ef3af9c3d2780959d4a92597896188

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The blind reader understood Submit, Decline and "I've finished" and what each one does. Every card state (asking, answered, declined, not answered, missing field, refused value) appears in light and dark screenshots.

Notes

  • acp/elicitation.py:600 sends back 'Keep a backup for (days)' is above its maximum. draftToContent never checks number bounds, so a person who types 50 makes a round trip and gets an error that never states the limit. The blind reader said: "nothing tells me what the maximum is, so I don't know what number to enter." Check minimum/maximum on the client and word the error as "{{field}} must be between {{min}} and {{max}}." Also show the range next to the field.
  • required_missing ("Reason is required.") shows as muted text-muted status text, while the refused-value error uses the red ErrorNotice. The reader found them "two error messages that look completely different" and found the grey one "easy to miss." Show the required-field hint through the same ErrorNotice, or at least give it error colouring and place it at the field.
  • resolved_decline / resolved_cancel ("Declined" / "Not answered") don't say what happened to the tool's action. The reader asked: "I can't tell whether the file was deleted or not." Say what the outcome means for the action, e.g. "Declined. The tool was told no."

[UX-REVIEWED] 6b94f5b

Description read

[DESCRIPTION-READ] e0de75b4f3c7cee161b5c859a863ad3585351c60c743698a249d169cea5a4f2c

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 6b94f5bf445fbb08fc5026fcc6941395ae5a1222 — 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 item comes from the -32601→cancel defect probed live in #23210, and the capability declaration comes back under the condition the deleted pin set for it.

Notes

  • Item 9 — inherited: the default card in app-sdk/messageRenderers.tsx renders "read-only (buttons disabled)" with slot={null}. The only harm it names is a host that doesn't replace the renderer, and no such host is named. Subtraction: delete the elicitation entry in defaultMessageRenderers and let ChatPage register its own.

What this change ships

Inventory (10 items) — 9 justified

Intent: a person in the dashboard answers an MCP server's mid-tool-call confirmation or form, so the tool no longer gets a silent cancel. ADDITION (restores a broken capability).

  1. KAS _kiro/mcp/elicitation and standard elicitation/create are answered instead of getting -32601 — justified
  2. Crew advertises clientCapabilities.elicitation {form,url} on every harness again; the deleted pin said "re-add the key in the same change that registers a handler", and this change does that — justified
  3. Chat shows a new card for an MCP server's form or URL ask, with an answered/declined/cancelled state — justified
  4. New POST /api/chat/slots/{slot}/elicitation route, open to the dashboard owner only — justified
  5. Open asks show in the Board Blocked lane and block Continue with 409, like permissions — justified
  6. Stop, reject, the generic approve route and the trust/yolo sweep never send accept — justified
  7. Slack, Discord and other non-dashboard consumers send decline instead of -32601 — justified
  8. Every decision is SEL-audited as mcp_elicitation; a stranded ask is cancelled at the pre-turn drain — justified
  9. app-sdk default renderer draws the card read-only — inherited, no named host consumer
  10. agent_sdk/elicitation.py vocabulary module (2 dashboard importers), fake-backend [[ELICIT]], CI real-adapter test line — justified

[FIRST-PRINCIPLES-REVIEWED] 6b94f5b

Description read

[DESCRIPTION-READ] 0e92e31daa85cea647821063ed4504a72f23f7aa66972c9478664aabebfcf8a8

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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 6b94f5bf445fbb08fc5026fcc6941395ae5a1222 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 6b94f5b

Verdict parsed from the review's SHA-scoped output markers for commit 6b94f5bf445fbb08fc5026fcc6941395ae5a1222.

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

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 6b94f5bf445fbb08fc5026fcc6941395ae5a1222 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 6b94f5b

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6b94f5bf445fbb08fc5026fcc6941395ae5a1222 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 Oct 23, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/mcp-elicitation branch from 4563f35 to d851b4c Compare October 23, 2026 06:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 23, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • Capability declared to every harness on an unverified codex premise span=56077c2499a2

Outcome: rebutted (premise verified false on codex-acp), with one follow-up fix to the PR's own wording.
Checked codex-acp main @ 296069e841 (2026-07-22), src/thread.rs and src/codex_agent.rs. codex-acp reads client_capabilities in exactly one place, supports_terminal_output, for _meta.terminal_output. It never reads clientCapabilities.elicitation and never sends elicitation/create to its client. Its MCP tool-approval elicitations (_meta kind mcp_tool_call, since #220 "Fix MCP approval flow", 2026-03-31) are routed through ACP session/request_permission unconditionally; every other MCP elicitation (a server's own form, or a url) is auto-declined inside codex-acp (Auto-declining unsupported MCP elicitation). So the declaration leaves codex's tool-approval prompts on session/request_permission, which is the clearing condition this finding names.
The declaration is needed for the goal as the user stated it ("also support the other ACP providers"): a standard-ACP harness that does honour clientCapabilities.elicitation (the schema's x-method: elicitation/create) will only forward a server's elicitation when the client declares it. KAS does not consult the capability, which is why it worked in the raw probe without it; the standard wire is what the key buys.
The PR's own comments repeat the repo's old (now disproven) sentence "codex-acp gates exactly that way on clientCapabilities.elicitation.form" in acp/types.py, acp-client.md and test_acp_client_capabilities.py. That is a defect in text this PR adds; it is being corrected in the next push to state the verified behaviour.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • Unattended sessions: cron, subagent, Slack and Discord never set accepts_elicitation span=5d41edb65318

Outcome: rebutted. This follows only if a harness moves its TOOL APPROVALS onto elicitation/create once the capability is declared. codex-acp main @ 296069e841 does not: it never reads clientCapabilities.elicitation, never sends elicitation/create, and routes MCP tool approvals through session/request_permission unconditionally (src/thread.rs, mcp_elicitation / build_supported_mcp_elicitation_permission_request). claude-agent-acp and goose carry no elicitation code at all. So an unattended consumer's tool approvals keep taking the trust/hook path they take on main; the only thing a non-opted-in consumer declines is a server's OWN elicitation, which on main was a -32601 (and on KAS a cancel) -- the same tool failure, now with the server told the person was not asked.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • Dashboard: trust, trust_reads and yolo no longer answer the approval span=0dd5b7315165

Outcome: rebutted, same evidence as span 5d41edb65318. Tool approvals still arrive as session/request_permission on every harness checked (codex-acp routes its MCP tool approvals there unconditionally; KAS, kiro-cli, claude-agent-acp, goose never send elicitation/create), so trust tiers answer exactly what they answered on main. "No trust tier answers it" applies to a SERVER's own elicitation -- a form or URL the MCP server itself asked the person to fill in -- which no trust tier ever answered before this PR either (it was a -32601). Auto-accepting a server's compliance gate from a trust flag is the one thing the design refuses on purpose (PR Not a goal).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • Policy hooks: the session/request_permission hook path never sees those calls span=828ad5ebb27c

Outcome: rebutted, same evidence as span 5d41edb65318. The hook path (auto_deny_tools, sensitive-path checks) runs on session/request_permission, and that is still where every harness checked sends its tool approvals with the capability declared. An elicitation is not a tool call: it is a question the server asks INSIDE a tool call that already passed the permission gate, so the hooks ran on that call before the server could ask anything. The answer a person gives is validated against the server's own schema (validate_form_content) and never carries a command or path the hooks would judge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 23, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/mcp-elicitation branch from d851b4c to 383d5de Compare October 23, 2026 07:37
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md, docs/system-specs/modules/learn-cron-dashboard.md and src/kiro_crew/security_posture.py since this head went green (2d5bb2f -> 241e39c); CI re-running on 383d5de, which also folds in the review fixes (approval-registry guard, display redaction, row-instance stamping, urlsplit refusal, ErrorNotice, agent_sdk import surface, codex wording).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 383d5de
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (56 passed on this head), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1521 passed), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

@buluoray thanks — the blocking item is the same race GPT flagged, and it is addressed on c9aff11688 (pushed before your review landed; it was on 2dbc7b2160):

  • c9aff11688: absence-based retirement runs only when no live frame reduced into the view since the fetch was dispatched (liveFrameSeqAtDispatch, the guard the reducer already uses for stream state). Test: the same page retires the card with no live frame in between and keeps it actionable when one landed.
  • Your pageNewest bound is also in, staged for the next push (I'm holding it until the round on c9aff11688 finishes so the lanes run once): a card is judged only when pageOldest <= ts <= pageNewest. Test: a card newer than the page's last row, with no live frame counted, stays actionable.

I'll ping you when that head is green.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at c9aff11688c277b4e6e2cc90c622d2ff1fbb6c81.

My blocking item from 2dbc7b2160 is fixed. slotRefresh.ts now retires a pending elicitation card only when no live frame reduced into the view after the fetch was dispatched (liveFrameSeq === liveFrameSeqAtDispatch). That reuses the guard the refresh walk already trusts, so a card delivered over the stream during the round trip stays actionable. ChatSliceCoverageSecondPass.test.tsx pins both the retired case and the raced case. Locally: that file and ElicitationCard.test.tsx pass (130), and tsc is clean.

I am not approving yet, because both review lanes block this head with fresh findings that need your answer (fix or rebut on the PR):

  • GPT 6.1 (2 of 2 upheld): slotRefresh.ts:601, a background warmSlotCache snapshot keeps only resolved and drops the submitted answer values; and transcript_rows.py:488 with the frontend CLIENT_ONLY_ROLES, where an answered elicitation row shifts the history cursor because the two sides disagree on whether the role is persisted.
  • Opus 5.5: several, including a decision path with no SEL record and no elicitation_resolved broadcast (the card stays actionable and a later permission reusing that id gets 409), a blocking file write on the gateway loop where the twin module offloads it, a Stop path that answers decline where the module's own vocabulary says cancel, and asks that used to reach Slack/Discord as session/request_permission now being declined there.

My request-changes stays in place until those are answered.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Push note: head c9aff11688 → 9de1d51ec5, still one commit on main@74e66024.

CI on c9aff11688 — Backend/Frontend Lint red (and the Coverage Gate failing closed behind it): this PR's added tests pushed website/src/test/ChatSliceCoverageSecondPass.test.tsx past the 2,000-line cap. The elicitation reducer tests moved whole into a new sibling, website/src/test/ChatSliceElicitation.test.tsx (no baseline row).

@buluoray's review on 2dbc7b2160 — the suggested ts <= pageNewest bound is in: a pending card is retired only when pageOldest <= ts <= pageNewest and no live frame reduced since dispatch. Test: a card newer than the page's last row stays actionable with no live frame counted.

Opus on c9aff11688 (span=aa9e230a99d2) acp/session_handle_turn.py: the per-turn cancel_pending_elicitations() ran after _turn_done.clear() and outside the turn guard, so a cancellation during that write left the handle turn-active for good. Moved above _turn_done.clear(). Test: test_a_turn_cancelled_while_answering_the_left_over_ask_leaves_the_handle_idle.

GPT on c9aff11688

  • F1 (span=8d3da0b34990) store/chat/slotRefresh.ts warm path: copied only meta.resolved from a locally decided row, dropping the elicitation's meta.answer. Now both are kept. Test in ChatSliceElicitation.test.tsx.
  • F2 (span=c6de1a6e1b48) store/chat/transcript.ts: CLIENT_ONLY_ROLES lacked elicitation, which the backend never persists (_TRANSIENT_ROLES), so serverRowCount shifted the paging cursor by one per kept card. Added. Test: store/chat/transcript.clientOnlyRoles.test.ts.

Local: backend related set 571 passed (+ test_acp_elicitation.py 44), src/store 660 passed; mypy, tsc, eslint, line-cap, black, comment-history, wait-discipline and flake-pattern ratchets clean.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 9de1d51
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@CrysisDeu

CrysisDeu commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Push note: head 9de1d51ec5 → 1ee69a2bff, still one commit on main@74e66024.

GPT on 9de1d51ec5 (span=8dfe96e371ee, upheld) dashboard/handlers/chat_elicitation.py: the route refused internal-secret and app callers but admitted any empty-app-claim session, so a non-owner dashboard session (a Telegram/Teams/Webex allowlist link) could accept the owner's elicitation. Fixed: after the internal/app refusal the route calls require_owner_dashboard_request (403 owner_only, SEL-audited), the same owner predicate the sibling approve route enforces through deny_non_dashboard_caller. Test: test_a_non_owner_dashboard_session_cannot_answer_the_owners_ask (403, future stays pending). Spec sentence in acp-client.md updated.

Local: test_dashboard_elicitation.py + route/composition/posture contracts 385 passed; mypy, black, isort, flake8, comment-history, line-cap, docs-lint, wait/flake ratchets clean.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 1ee69a2
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Push note: head 1ee69a2bff → eb9de30167, still one commit on main@74e66024.

GPT on 1ee69a2bff (span=d39fff206f9a, upheld) acp/elicitation.py / dashboard/chat_turn/elicitation_prompt.py: a string field's format was kept as free text (only truncated) and is not a display-redacted key, so a server could carry a credential-shaped string onto the row and the live frame. Fixed at the parser: format is kept only when it is one of the MCP schema's string formats (STRING_FORMATS = email, uri, date, date-time, the four the card reads) and dropped otherwise, on both parse_elicitation_request and ElicitationField.from_dict. Test: test_a_string_format_outside_the_spec_set_is_dropped. Spec sentence in acp-client.md added.

Local: elicitation, dashboard, replay and posture tests 204 passed; mypy, black, isort, flake8, comment-history, line-cap, agent-sdk boundary, docs-lint clean.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: eb9de30
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Push note: head eb9de30167 → 7fb84bc6d8, still one commit on main@74e66024.

CI on eb9de30167 — Backend Tests (Windows) (8): test/test__shared_handlers_facade.py::test_only_the_family_imports_an_owner failed because dashboard/handlers/chat_elicitation.py imported require_owner_dashboard_request straight from _shared_access instead of the _shared facade that re-exports it. Fixed: the import goes through kiro_crew.dashboard.handlers._shared. No behaviour change.

GPT and Opus were clean on eb9de30167; every other check had passed.

Local: test__shared_handlers_facade.py + test_dashboard_elicitation.py 38 passed; mypy, black, isort, flake8 clean.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 7fb84bc
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Rebased: feat/mcp-elicitation onto main@d3e9ab34 (was 74e66024); head 7fb84bc6d8 → 172aec7891, still one commit.

One conflict, in dashboard/chat_runner.py, from #23528 moving the chat turn's finally into phases and collapsing the file_changes re-export: took main's side of both hunks, re-added this PR's _on_elicitation_request import, and moved this PR's turn-end reset of accepts_elicitation into chat_turn/turn_entry.py beside the child_fidelity_aware reset it mirrors (same place in the same order). The EVENT_ELICITATION_REQUEST dispatch branch and the opt-in in turn_admission.py merged cleanly. No behaviour change.

7fb84bc6d8 had GPT and Opus clean and no CI red before main moved.

Local: runner plumbing, composition, elicitation and posture tests 469 passed; local-gate.py related set shows only the 36 failures main shows locally (test_acp_spawn_offload.py, auto_improvement/tests); mypy, isort, flake8, black, comment-history, line-cap, docs-lint clean.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 172aec7
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • Primary answer button reads as an unnamed action span=8d01bfbf49b1

Disposition: not changed in this PR; the label is unchanged since the UX lane passed it on every earlier head.

  • The card's button text is identical on every head this lane has read, from cc79dc6c40 to 7fb84bc6d8, and the lane passed it each time. On ac9eafe99b it named the same hesitation and attributed it to the fixture: "Its reluctance to press Submit came from the example's 'cannot be undone' wording, which is meant to make a person stop and think." This head changes no card copy. The only change since 7fb84bc6d8 is a rebase over refactor(dashboard): move the chat turn's finally into phases #23528.
  • The card cannot name the server's action. An elicitation is a generic form an MCP server sends. The card does not know whether answering deletes anything, so a button saying "Delete" would claim more than the client knows. The server's own question above the fields names the action, and in the fixture it says the action cannot be undone. Submit sends the answers to that question. Decline refuses it.
  • "Submit" is the verb MCP clients use for an elicitation form, and the dashboard uses it for its other forms (en.json has three more submit: "Submit" keys). Renaming it here touches 12 catalogues and invalidates the 14 attached screenshots, for a wording question the lane did not raise until this rebase-only head.

"Send answer" is a reasonable wording follow-up, along with the three Notes (the required hint shown at the field, the bound named in the above-maximum error, and what "Not answered" means for the action). It is not a defect in what this PR ships.

@CrysisDeu

CrysisDeu commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Push note: head 172aec7891 → 5ecd270112, still one commit on main@d3e9ab34. CI on 172aec7891 was green (every test shard, lint, coverage); this push answers the reviewer lanes only.

Opus (span=37a38476072a, acp/elicitation.py): a titled multi-select written the MCP way, items.anyOf: [{const, title}], was declined as unrenderable because _enum_options read only oneOf/enum. It now reads the titled list under oneOf (single-select) or anyOf (a multi-select's items), with the same string-const rule. Test: test_a_titled_multi_select_in_the_mcp_spelling_is_rendered (renders, validates a pick, refuses a non-string const).

GPT (span=3efda54743d5, pages/chat/ElicitationCard.tsx): an answer the gateway accepted settled the card only through the elicitation_resolved frame, so a socket dropped during the post left it actionable and a later refresh retired it as "Not answered". After a successful post the card now dispatches resolveByApprovalId for its own row (mid, action, submitted content), through the optional store context Lightbox.tsx already uses, so an embed without the dashboard store still renders. Test: stamps its own row once the gateway accepts the answer, without waiting for the frame.

UX (span=8d01bfbf49b1): unchanged, see the disposition above.

Local: elicitation, dashboard, replay tests 151 passed; card + reducer + ownership tests 31 passed; mypy, tsc, eslint, restyle ratchet, comment-history, line-cap clean.

@CrysisDeu

CrysisDeu commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 5ecd270
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

An MCP server that gates a tool on a human answer sends its agent an
elicitation; the harness turns it around as a server-to-client request
that only a client with a person can answer. Kiro Crew answered every
such request -32601, which the KAS engine reports to the server as a
cancel, so every elicitation-gated tool failed silently on the default
backend.

acp/elicitation.py owns the wire shape on both methods: KAS's
_kiro/mcp/elicitation (fields nested under params.elicitation) and the
standard elicitation/create (fields flat), read fail-closed into one
request and validated on answer. Both drivers classify the request and
answer it themselves with decline unless the consumer declared it can
put the ask to a person; otherwise the event is yielded, answered
through answer_elicitation, and whatever is still pending is cancelled
at the turn boundary. No trust tier answers an elicitation: it is the
server's requirement, not Crew's tool gate.

The dashboard chat runner renders the ask as a card (a form from the
requested schema, or a URL to visit) and answers it through
POST /api/chat/slots/{slot}/elicitation, dashboard owner only. The
elicitation client capability is declared again, pinned to the handler.
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Push note: head 5ecd270112 → 6b94f5bf44, still one commit on main@d3e9ab34. CI on 5ecd270112 was green and GPT/Opus clean; this push answers the Opus items @buluoray listed from the c9aff11688 round.

  • Decision path with no SEL record and no elicitation_resolved (dashboard/chat_turn/elicitation_prompt.py): when an answer did not fit its form, the decline that replaced it was awaited unguarded inside the finally, and the SEL write was unguarded too; either raising skipped the row stamp and the resolution frame, leaving the card actionable and its id pending against a later permission (409). Both are now guarded, so every exit stamps the row and broadcasts. Test: test_a_failed_audit_or_fallback_write_still_settles_the_card.
  • Blocking file write on the gateway loop (acp/client_elicitation.py): the client's audit called sel() inline, where the session handle's twin offloads it. It is now one bounded off-loop hop with the accessor inside it, the shape _audit_cancelled_approvals uses. Test: test_the_clients_audit_resolves_sel_off_the_event_loop.
  • Stop answered decline: a Stop is nobody refusing the server, so the runner now sends MCP's cancel when it reads the Stop's _approval_stopped mark, as every other turn boundary does. Test updated (test_a_stop_rejection_clears_the_stopped_mark_and_audits_as_stopped now expects cancel); spec and PR body say so.
  • Asks that used to reach Slack/Discord as session/request_permission are declined there: by design, not changed. Before this PR codex answered a URL ask through session/request_permission, where a trust tier could approve a link nobody opened; with elicitation declared it sends the ask itself, and a consumer that cannot put it to a person (a channel, a cron) declines it. No trust tier answers an elicitation. acp-client.md's capability row records this, and rendering an elicitation on a channel is under Not a goal as a follow-up.

The card-reuse question (ChangeCard shell + QuestionCard controls) stays open as a follow-up, as you noted.

Local: elicitation, dashboard and bindings tests 625 passed; mypy, black, isort, flake8, comment-history, line-cap, docs-lint, wait/flake ratchets clean.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 6b94f5b
  • What rule changed: src/kiro_crew/security_posture.py gains one entry, dashboard/chat_turn/elicitation_prompt.py, in the list of modules whose redactor calls are counted as output-boundary sinks (the _REDACTION_SINKS paths composed into dashboard/chat_runner.py). No redactor, pattern, allowlist or policy rule changes; the entry registers the new owner so its redact_credentials / redact_exfiltration_urls calls are classified rather than left unaccounted.
  • Before -> after (what was allowed/blocked, now): before, the new module's redactor calls were unclassified and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed closed; after, they are registered sinks counted by the Security posture panel. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the panel would over- or under-count redaction sinks by one module. It cannot leak a secret (the entry adds redaction coverage, removes none), cannot break a command and cannot lock anyone out.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (passed on this head as part of the 173-test elicitation/posture set), including the omission-detection test that walks every module for redactor calls and requires each to be registered or allowlisted; test/test_dashboard_elicitation.py::test_display_redaction_touches_labels_and_taints_values proves the new module's redaction runs on server-authored labels and refuses tainted values.
  • No regression:
    • Tools still work (which tools/commands were run, result): targeted pytest set (1943 passed on this head across the elicitation, body-guard, bounded-write, frame-replay, provider, facade, composition-contract, bindings, ws-scope, flake-ratchet and posture sets), mypy clean, agent-sdk boundary gate pass, black/isort/flake8 clean, npx tsc clean, restyle ratchet at baseline.
    • Backward compatible (old config / old data / old callers still work, how checked): the list is read-only metadata for the posture panel and the census test; no config key, stored data or caller shape changes. test_security_posture.py passed unchanged apart from recognising the new module.
    • Existing tests (which suites passed on this head): test_security_posture, test_acp_elicitation, test_acp_elicitation_runtime, test_dashboard_elicitation, test_session_handle_bindings, test_client_bindings, chat runner and chat handlers composition contracts, test_no_config_dir_in_async, test_ws_event_scoping_audit, test_approval_decide_owner_bound, test_chat_mode_security.
  • How to undo: remove the single "dashboard/chat_turn/elicitation_prompt.py", line from _REDACTION_SINKS in src/kiro_crew/security_posture.py (and the module it names, which this PR adds).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

@buluoray 6b94f5bf44 is green (all checks and every AI lane: GPT, Opus, Design, First Principles, UX) and carries your pageNewest bound plus the fixes for the GPT/Opus items you listed (push notes above). Could you re-review?

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 6b94f5bf445fbb08fc5026fcc6941395ae5a1222.

  1. Active change request. buluoray's CHANGES_REQUESTED review is still in force. The later COMMENTED review keeps it open until the GPT/Opus items are answered. You answered them at this head and asked for a re-review, so this clears when buluoray re-reviews.
  2. Reserved for human review. This adds an owner-consent route, POST /api/chat/slots/{slot}/elicitation. It adds a NON_EGRESS_REDACTION_MODULES row (security_posture.py#L633). It also changes how human approvals flow by advertising elicitation to every backend (acp/types.py#L350). bolichen97 has asked for a maintainer design review, including a dashboard-only opt-in. The Design lane notes that only codex is measured, so another harness that moves approvals off session/request_permission would have them declined on Slack, Discord and cron.
  3. Follow-ups need issues. "A channel card is a follow-up" (Not a goal) and the ElicitationCard reuse of ChangeCard/QuestionCard ("stays open as a follow-up") have no linked issue. Please open one issue per item and link it in the description.

All AI lanes pass at this head, and CI is green.

— crew-pr-reviewer (r124)

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 6b94f5bf445fbb08fc5026fcc6941395ae5a1222. Everything I left open at 2dbc7b2160 and c9aff11688 is answered at this head. I checked each item in source and backed every guard with a mutation that turns a named test red:

  • slotRefresh.ts retire-stale race: a pending card is retired only when no live frame reduced since dispatch and pageOldest <= ts <= pageNewest. Dropping either condition turns ChatSliceElicitation.test.tsx › "a PENDING elicitation card … is retired as stale" red.
  • GPT, warm path: warmSlotCache now keeps meta.answer beside meta.resolved. Keeping only resolved turns "a background warm keeps the answer an elicitation card sent" red.
  • GPT, history cursor: CLIENT_ONLY_ROLES in transcript.ts now includes elicitation, matching _TRANSIENT_ROLES in transcript_rows.py:488. Removing it turns transcript.clientOnlyRoles.test.ts red.
  • Opus, unsettled decision path: the fallback decline and the SEL write in elicitation_prompt.py are each guarded, so the row stamp and elicitation_resolved always run. Unguarding either one turns test_a_failed_audit_or_fallback_write_still_settles_the_card red.
  • Opus, blocking write: client_elicitation.py resolves sel() and writes inside one bounded executor call. Inlining it turns test_the_clients_audit_resolves_sel_off_the_event_loop red.
  • Opus, Stop vocabulary: a Stop now answers cancel. Reverting turns test_a_stop_rejection_clears_the_stopped_mark_and_audits_as_stopped red.
  • Opus, channel declines: I accept the rebuttal. Only the dashboard turn opts in (turn_admission.py:1244, reset in turn_entry.py). No trust tier answers an elicitation, which closes the old path where a tier could approve a URL ask nobody opened.
  • Also pinned: the per-turn cancel now runs before _turn_done.clear(); moving it back turns test_a_turn_cancelled_while_answering_the_left_over_ask_leaves_the_handle_idle red. The owner-only check on the answer route: removing it turns test_a_non_owner_dashboard_session_cannot_answer_the_owners_ask red.

Run locally on this head: test_acp_elicitation*.py, test_dashboard_elicitation.py and test_chat_runner_turn_plumbing.py (128 passed); ElicitationCard.test.tsx, ChatSliceCoverageSecondPass.test.tsx, ChatSliceElicitation.test.tsx and transcript.clientOnlyRoles.test.ts (133 passed); tsc is clean. Every AI lane passes on this head and CI has no failures.

Follow-ups (non-blocking):

  • clientCapabilities.elicitation goes to every backend, but only codex is measured. The Design lane raises the same point. Declaring it per harness, or measuring one more harness, would settle whether another backend moves approvals off session/request_permission. That would get them declined on Slack, Discord and cron.
  • In elicitation_prompt.py, a turn cancellation that lands while the finally block is awaiting answer_elicitation skips the row stamp and the frame. I found this from source and did not reproduce it. The id is already unregistered, so it cannot cause a 409, but the card would stay actionable until a refresh.
  • Please open one issue each for the channel card and the ChangeCard/QuestionCard reuse, and link them in the description.
  • The UX lane's three notes: the number bound in the error text, the required-field hint style, and what "Not answered" means for the action.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: answer KAS _kiro/mcp/elicitation so elicitation-gated MCP tools work

4 participants