Skip to content

fix(config): adopt the windows unsandboxed-exec default once on load - #29261

Merged
buluoray merged 1 commit into
mainfrom
crew/slack/windows-drop-stale-sandbox-false
Nov 4, 2026
Merged

buluoray merged 1 commit into
mainfrom
crew/slack/windows-drop-stale-sandbox-false

Conversation

@buluoray

@buluoray buluoray commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A Windows install that still stores the pre-0.6.0 agent.sandbox_allow_unsandboxed_exec: false runs its agent sessions again after upgrading, without the owner editing config.

Since 0.11, Windows users who installed before 0.6.0 see every KAS agent spawn refused with "Sandbox backend unavailable and agent.sandbox_allow_unsandboxed_exec is set to false on this host ... Probe detail: not Linux." None of them set the key.

Root cause:

  • Builds before 0.6.0 had sandbox_allow_unsandboxed_exec: bool = False and wrote asdict(agent) on every full save, so false landed in config.json on every host.
  • feat(sandbox): resolve the no-backend exec default per platform #9758 (0.6.0) made the Windows default true for an undeclared key, but _agent_key_declared (src/kiro_crew/config/loader_document.py) counts the stored false as declared, and nothing removed it.
  • Through 0.10, Windows spawns went to kiro-cli's own sandbox (delegate_to_kiro, src/kiro_crew/sandbox_wrap.py), so the value was never read.
  • 0.11 defaults to KAS (feat(acp): default new installs to KAS #20359), and _kiro_cli_sandbox_owns_relay (src/kiro_crew/acp/harness/kas.py) is macOS-only, so every Windows KAS spawn hits the "declared false" refusal.

Owner decision: "Ray (buluoray), 2026-11-03: auto-fix on Windows. On 0.11 (KAS default) a stored agent.sandbox_allow_unsandboxed_exec: false on Windows refuses every agent spawn, so Crew is completely unusable, whether the value was auto-written by a pre-0.6.0 build or set on purpose; there is no working state to protect. User reports (granlauk, devmacke, 11-03) are all 'Crew broke after the update'. Removing it gives the posture every Windows install created since 0.6.0 already has (#9758). Windows has no real OS sandbox for KAS spawns (#25154 measured it), so the false never bought isolation on 0.11." It supersedes the earlier decisions on this PR (drop silently, then a user-confirmed restore command).

Why it matters

Every session on an affected Windows host fails at spawn, and the error tells the owner they chose it. #29253 explains the cause in the refusal and in doctor; this PR removes the stale value once on Windows, through the existing superseded-defaults adoption, so the host works without a manual config edit.

Not a goal

What changed (motivation → approach → change)

Symptom: every Windows KAS session refused by a stored false. Cause: a value an old build saved on every write, which outranks the Windows default once stored, and which on 0.11 leaves no session able to start. Change: one auto-adopting row in the existing superseded_defaults registry, the mechanism that already handles materialized old defaults (kirocrew config defaults, doctor, the adoption ledger). No new command, no new record file.

  • src/kiro_crew/config/superseded_defaults.py: a SupersededDefault row for agent.sandbox_allow_unsandboxed_exec (false -> true, auto_adopt=True). applies is true only where unsandboxed_exec_platform_default() allows (sys.platform == "win32") and never in a pod (KIROCREW_POD=1), whose seed floor (pod.runtime._force_seed_agent_security) writes that false on purpose. The row's note states the cost: without the false, agent subprocesses on this Windows host run without OS isolation, the same as on new installs. adoption_summary (doctor's "adopted" line and config defaults) now appends a row's note.
  • src/kiro_crew/config/windows_exec_adoption.py (new) and src/kiro_crew/config/migration.py: before the ledger record and the removal, the migration writes the same critical SEL tool_invocation event kirocrew setup writes when it grants unsandboxed execution (tool_name=sandbox_allow_unsandboxed_exec, tool_kind=config, outcome=allowed, critical=True). If that write fails, the key leaves the drop set: the false stays on disk and in memory, no ledger entry is written, a warning says why, and a later load retries.
  • src/kiro_crew/config/windows_exec_adoption.py (close_when_nothing_stale): on a Windows load (outside pods) that finds the key absent or true, there is nothing stale to drop, so it records false as acknowledged once (the same record config set, Settings and setup write). Any false written later, a hand edit included (as the no-isolation warning in sandbox_wrap.py suggests), is then kept. Single-shot lock. Only a busy lock defers the close: it returns False and the loader does not cache that document, so the next load retries it. An unreadable ledger or a failed write returns True, because the next load would fail the same way and the config cache would stay off for good; nothing is dropped meanwhile, since an unreadable ledger also stops adoption.
  • src/kiro_crew/cli_config.py (config defaults --adopt): for an auto_adopt row it now records the key in the adoption ledger before removing it, the same marker-first order the load path uses. Before, --adopt only dropped the ack, which erased the close record, so a false written back by hand was auto-dropped on the next load. This also closes the same gap for the other auto_adopt rows (the KAS row included).
  • src/kiro_crew/config/loader_pipeline.py: calls close_when_nothing_stale on each load with a base file, and follows the existing adoption log line with the row's note.
  • src/kiro_crew/config/migration.py (_adopt_in_memory): this field is set to the platform default rather than the dataclass default (False), so the run that migrates already starts sessions.
  • src/kiro_crew/cli_setup.py: setup's consent step acks the value it writes (ack_explicit_write), as config set and Settings saves already do, so a lockdown chosen in setup is never adopted.
  • Docs: the auto-adoption table in docs/system-specs/modules/config.md and the platform-default paragraph in docs/system-specs/modules/security.md.

Revert is the existing command the notice and doctor print: kirocrew config set agent.sandbox_allow_unsandboxed_exec false (or the Settings page). That write is acked and the ledger already names the key, so it is never adopted again.

Security note. On an affected Windows host this loosens confinement: agent subprocesses run without OS isolation, as on every Windows install created since 0.6.0. A deliberate lockdown already stored when the host first loads this build is dropped once; on 0.11 such a host could not start any session. A false written after that first load, by any writer, is kept. Residual: the ledger and acks live in superseded_acked.json, which the file-edit gate does not protect. Adding an entry only keeps a false (stricter). Removing one lets a later unacked hand-edited false be adopted once more; doing that needs a process that can write the data home, which on Windows (no OS sandbox) can equally rewrite config.json.

Coordination with #29253. That PR's stale-false note should point at this adoption notice and the doctor "adopted" line instead of the manual edit; whichever PR merges second makes that wording change. This PR does not edit #29253's files.

Backwards compatibility

Breaking: on Windows outside pods, a stored false with no ack and no ledger entry is removed once and resolves to the Windows default (true), including a lockdown written before this build. Writer sweep on origin/main @ b44d1d0 (git grep -n '"sandbox_allow_unsandboxed_exec"\] = '): cli_setup._setup_sandbox_consent acks it in this PR; pod/runtime._force_seed_agent_security is excluded by KIROCREW_POD; kirocrew config set (cli_config._ack_explicit_config_write) and the Settings PATCH (core_config_patch) already ack. Every other value, key and platform loads as before.

On Windows a fresh home now also holds superseded_acked.json (+ .lock), written by the one-time close; the golden list is updated for Windows.

Reader: src/kiro_crew/config/loader_builders.py:_build_agent_config -- entry: chat|cron|subagent|app -- the absent key resolves through unsandboxed_exec_platform_default(), pinned by test_windows_drops_the_stale_false_once_and_logs_it
Reader: src/kiro_crew/config/loader_document.py:unsandboxed_exec_declared -- entry: chat|cron|subagent|app -- reads absence as undeclared, the state #9758 intended for this host
Reader: src/kiro_crew/config/loader_config.py:KiroCrewConfig.save -- entry: chat|cron|subagent|app -- strips the undeclared key, so the removal is not re-materialized; test_save_omits_the_exec_permission_when_it_was_never_declared
Reader: src/kiro_crew/cli_setup.py:_setup_sandbox_consent -- entry: release -- an undeclared key re-offers the lockdown prompt on the next interactive setup
Reader: src/kiro_crew/sandbox_unavailable.py:unsandboxed_exec_permitted_by -- entry: chat|cron|subagent|app -- now names the platform rather than an operator grant, which is accurate

Tests

  • test/test_config_windows_stale_exec_false.py (new): win32 stored false -> dropped on disk, true in memory on the same load, ledger set, adoption line plus its note; a false set after the adoption is kept; linux/darwin false kept and not reported; win32 true kept; an acked false kept; key absent or true -> load -> hand-edited false -> load -> false kept; a close deferred by a busy ack lock is retried on the next load of the unchanged file; an unreadable ledger leaves the config cache on; a false written after config defaults --adopt is kept; nothing recorded off Windows; only this key dropped; a Windows pod keeps its seed-floor false; the drop writes the setup grant's critical SEL event; a failed SEL write keeps the false with no ledger entry; the log line and doctor summary name the isolation cost and the restore command.
  • test/test_sandbox_unsandboxed_exec_consent.py: setup's lockdown write is acked and not adoptable.
  • test/test_config_superseded_defaults.py: registry adopting set and spec-table pin; the row's end is the Windows platform default.
  • test/test_config_loader_agent_section.py, test/test_windows_fail_closed_optin.py: their declared-false cases record the one-shot first.

Mutation checks: removing the audit call, the fail-closed branch, the pod exclusion, the setup ack, the note line, or the close_when_nothing_stale call each turns at least one test red; so does deferring on an unreadable ledger, or skipping the --adopt adoption record.

Proof: PROVEN test/test_config_superseded_defaults.py::test_only_unpinned_broken_budgets_adopt_themselves, test/test_config_windows_stale_exec_false.py::test_windows_drops_the_stale_false_once_and_logs_it, test/test_config_windows_stale_exec_false.py::test_a_false_set_after_the_adoption_is_kept, test/test_config_windows_stale_exec_false.py::test_an_acked_false_on_windows_is_kept, test/test_config_windows_stale_exec_false.py::test_only_this_key_is_dropped (head bbae430, same production row; the SEL, pod and note parts are pinned by the mutation checks above at 14f1192)

Local: the new file plus the config, sandbox and doctor test files: 862 passed, 7 skipped; after the retry change, test_config_windows_stale_exec_false.py alone (host memory limit): 16 passed, and caching despite a deferred close turns the retry test red; after the ledger and --adopt change, test_config_windows_stale_exec_false.py, test_config_load_pipeline.py and test_cli_config_defaults.py: 121 passed. mypy, flake8, black gate, comment-history, brand, harness-parity, line-cap, flake-ratchet and docs-lint pass.

Manual verification

Not run on a real Windows host: the path is driven with sys.platform pinned to win32 through the real loader and real files; the real-win32 suite (test_windows_fail_closed_optin.py) runs on the Windows CI lanes.

Related Issues

Option A (wording and doctor row): #29253. Default change this follows up: #9758. KAS default: #20359. Windows KAS sandbox measurement: #25154.

Sibling sweep

Swept: git grep -n '"sandbox_allow_unsandboxed_exec"] = ' -- src/
Sibling: src/kiro_crew/cli_setup.py -- changed here
Sibling: src/kiro_crew/pod/runtime.py -- not affected -- its seed-floor false is excluded by the KIROCREW_POD check in superseded_defaults

Pattern harvest

Not generalizable: the general class (a materialized old default outranking a new one) already has its mechanism, the superseded_defaults registry; this PR adds a row to it.

Checklist

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

Contribution License Agreement

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

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 3, 2026 17:49
@buluoray
buluoray requested a review from dodgeblaster November 3, 2026 17:49
@buluoray
buluoray enabled auto-merge (squash) November 3, 2026 17:49
@buluoray
buluoray disabled auto-merge November 3, 2026 17:49
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the fix reuses the existing one-shot superseded-defaults ledger, applies only on Windows outside pods, records an audit event before it drops anything, and follows a dated owner decision.

Notes

  • The ## Backwards compatibility section is cut off by the description truncation, so the reader sweep past core_config_patch could not be checked. Any reader listed past the cut was not reviewed.
  • Every Windows load outside a pod now writes superseded_acked.json the first time, even on a fresh install, which is a new home-dir artifact. The test_memory_v1_golden update shows it is intended; anything else that inventories home-dir files on Windows should expect it.

[DESIGN-REVIEWED] 46bb5b2

Description read

[DESCRIPTION-READ] b0926c6c68f669967859f2a0b9b32a4095e3d1fa638dbf400877a52c82d0c4ce

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 3, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65 — 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

This fixes a reported spawn refusal on Windows, using the existing superseded-defaults registry. Whether a one-time loosening of a stored lockdown counts as product shape is a judgement call, so it is a note here, not a blocker.

Notes

  • Item 1 — inherited: the owner decision exists only as a quote in the description ("Ray (buluoray), 2026-11-03: auto-fix on Windows"). No RFC on the base commit records it, and no /ai-review override first-principles covers this head. It also drops "a deliberate lockdown already stored when the host first loads this build". Restoring the pinned feat(sandbox): resolve the no-backend exec default per platform #9758 Windows default reads as a fix, so this is not trigger (c).
  • Item 7 — one consumer, generalized: adoption_summary and persist_write_back now append entry.note for any auto-adopt row, but the new row is the only auto-adopt row that has a note (I grepped note= and auto_adopt=True in superseded_defaults.py; that row is at lines 610–611). Subtraction: none needed. The generic form costs one line, so this is recorded and nothing more.

What this change ships

Inventory (8 items) — 6 justified

Intent: Windows installs upgraded from before 0.6.0 can start agent sessions again without anyone editing config by hand. FIX.

  1. On Windows outside pods, a stored unacked sandbox_allow_unsandboxed_exec: false is removed once on load — justified
  2. That removal first writes a critical SEL audit event, and keeps the false if the write fails — justified
  3. A fresh Windows load with the key absent or true acks false once, so a false written later is kept — undeclared side effect: new superseded_acked.json on every fresh Windows home
  4. If the ack lock is busy, the loaded document is not cached, so the next load retries — justified
  5. config defaults --adopt now records every auto-adopt row in the ledger before removing it — rides along (also changes the KAS and memory rows)
  6. The run that migrates holds the Windows platform default in memory — justified
  7. The adoption log and doctor's "adopted" line now print the row's isolation-cost note — one consumer, generalized
  8. kirocrew setup acks the lockdown value it writes — justified

[FIRST-PRINCIPLES-REVIEWED] 46bb5b2

Description read

[DESCRIPTION-READ] 000ccffaa2fdfd80567985b222051befa20b9b81cdaa942c10472c14a02a5e10

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 3, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ human override accepted

Reviewed 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65 — this comment is updated in place on each push.

Human judgment by @buluoray overrides the Opus 5.5 finding for 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65; the recorded reason is authoritative for this commit.

[OPUS-OVERRIDE] 46bb5b2

Verdict recorded from an authorized human decision for commit 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65.

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

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 46bb5b2

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

@buluoray
buluoray force-pushed the crew/slack/windows-drop-stale-sandbox-false branch from bbae430 to dc90753 Compare November 3, 2026 18:05
@buluoray

buluoray commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the reviews of bbae4306bc, addressed in dc9075355f:

  • SAST (Semgrep) test-autouse-shared-monkeypatch: fixed. The autouse fixture in test/test_config_windows_stale_exec_false.py now patches through _floor_monkeypatch.
  • First Principles note / Opus BLOCK, pod seed floor (pod/runtime.py:_force_seed_agent_security): fixed. The row's applies returns false when KIROCREW_POD=1, so a pod's seed-floor false is never adopted. Pinned by test_a_windows_pod_keeps_its_seed_floor_false (red with the check removed).
  • Design note, comment wording: fixed. The registry comment now says the drop covers a lockdown written before this build's acks, and that this is the accepted cost.
  • Design note / Opus BLOCK, deliberate unacked falses (hand edit after the SECURITY warning, or a setup / config set / Settings lockdown from a build before this one): not changed, by owner decision. Those bytes are identical to the pre-0.6.0 auto-write, so no stored field tells them apart. The suggested _meta build-stamp proof would miss the affected users: any settings save from 0.6 through 0.11 keeps a declared false and restamps the document. The PR body's Backwards compatibility section now lists this as Breaking: with the writer sweep. The removal is logged and listed by doctor with its restore command, and every writer this build ships acks its false.

@buluoray

buluoray commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the notes on dc9075355f (all lanes PASS; no code change):

  • First Principles item 2, key named inside _adopt_in_memory: kept. The helper's dataclass path is wrong for this key: AgentConfig.sandbox_allow_unsandboxed_exec defaults to False, so the dataclass path leaves the migrating run refusing every spawn (test_windows_drops_the_stale_false_once_and_logs_it goes red without the branch). Using entry.new_default instead goes against the helper's documented rule that both sides of a registry row are history, which matters if this default moves again. The branch reads the same resolver the loader uses for an absent key, so memory and disk agree.
  • First Principles item 1, decision record: the owner decision is quoted in the description. If a lane asks for a recorded override, the maintainer will post it.
  • Design note, manual verification: the description's Manual verification section says the real-win32 suite (test_windows_fail_closed_optin.py) runs on the Windows CI lanes. No real Windows host upgrade was run.

@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 3, 2026
@buluoray
buluoray force-pushed the crew/slack/windows-drop-stale-sandbox-false branch from dc90753 to 13c9dc1 Compare November 3, 2026 21:08
@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 3, 2026
@buluoray
buluoray force-pushed the crew/slack/windows-drop-stale-sandbox-false branch from 13c9dc1 to ddd0df0 Compare November 3, 2026 21:40
@buluoray

buluoray commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the blocks on 13c9dc17eb, addressed in ddd0df0a6d (owner decision: fix both, no override):

  • Opus BLOCK, a deliberate false on an install with nothing stale is dropped: fixed. On Windows (outside pods), a load that finds the key absent or true acks false once (config/windows_exec_adoption.py:close_when_nothing_stale). That is the same ack kirocrew setup, config set and Settings saves write, and the drift filter skips an acked false, so any false written later (by hand, setup, Settings or config set) is kept. Pinned by test_a_windows_install_with_nothing_stale_keeps_a_later_false[None|True]. The PR body's claim is corrected: the one remaining drop is an unacked false already stored when the install first loads this build, which is the owner's accepted trade.
  • GPT BLOCK (security-class), no SEL record of the grant: fixed. Before the drop, the migration writes the same critical SEL tool_invocation event kirocrew setup writes when it grants unsandboxed execution (tool_name=sandbox_allow_unsandboxed_exec, tool_kind=config, outcome=allowed, critical=True). If that write fails, the key leaves the drop set: the stored false stays on disk and in memory, no ledger entry is written, a warning names the failure, and the next load retries. Pinned by test_the_drop_writes_the_setup_grant_audit_event and test_a_failed_audit_keeps_the_false.

Mutation checks on ddd0df0a6d: removing the close call, the audit call, or the fail-closed branch each turns at least one of these tests red.

@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 3, 2026
@buluoray
buluoray force-pushed the crew/slack/windows-drop-stale-sandbox-false branch from ddd0df0 to 5c11ca9 Compare November 3, 2026 22:19
@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 3, 2026
@buluoray buluoray changed the title fix(config): drop the stale pre-0.6.0 unsandboxed-exec false on windows fix(config): let windows owners restore the default unsandboxed exec Nov 3, 2026
@buluoray

buluoray commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Rework at 5c11ca9893, by owner decision (Ray, 2026-11-03): a user-confirmed restore replaces the silent drop.

  • Opus BLOCK on ddd0df0a6d, agent-writable ack sidecar: resolved by removal. The load-path drop, the superseded_defaults row, config/windows_exec_adoption.py and every dependency on superseded_acked.json are gone; nothing removes the stored false on load.
  • New: kirocrew config restore-windows-default removes it only on an explicit yes at a terminal (stdin and stdout), after writing the same critical SEL event kirocrew setup writes for an exec grant, and refuses to write if that event fails. Off Windows it exits 1.
  • PR body: the owner-decision line in Problem and one sentence in Why it matters were edited because Ray asked for the body to match the new design; the Goal line and Not a goal are unchanged.

@buluoray
buluoray force-pushed the crew/slack/windows-drop-stale-sandbox-false branch from 5c11ca9 to 14f1192 Compare November 3, 2026 22:40
@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 4, 2026
@buluoray

buluoray commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Owner decision: keep option A on this PR (head 62700a5b0bad7f075a9c1a48b2b3af2987f795f3) and override GPT's record-file findings: "Transient acknowledgement failures leave later lockdowns adoptable" (an earlier head) and "A broken acknowledgement ledger prevents an explicit lockdown" (cli_setup.py:1437, this head).

On the second one: it needs a superseded_acked.json that cannot be parsed, which the code's own writer never produces (it writes a temp file and renames it into place). When it does happen, setup refuses loudly and tells the operator to set false by hand. The host stays at the Windows default it already had, so nothing is weakened. The Opus adjudication flagged it as an edge case for the same reasons.

Why:

  1. Narrow trigger. Every step has to happen: a Windows install outside a pod; the key absent or true; the one-time close write failing transiently (disk full, or a sharing violation); no later reload retrying it; and then the owner hand-writing false. A restart or any other config write retries the close.
  2. No real boundary is crossed. On 0.11 with KAS as the default, a stored false on Windows refuses every agent spawn, so Crew cannot start any session. KAS has no OS sandbox on Windows (fix(kas): delegate the kiro-cli relay route to kiro-cli's sandbox on macOS #25154 measured it), so that false never bought isolation there. Dropping it gives the posture every Windows install created since 0.6.0 already has (feat(sandbox): resolve the no-backend exec default per platform #9758). The drop also writes a critical SEL event first, and keeps the false if that event cannot be written.
  3. The reviewers ask for opposite things. Opus blocked an earlier head because a lasting failure of the same write kept retrying forever and disabled the config cache. GPT now blocks because a short-lived failure is not retried. The code cannot reliably tell the two apart, so each patch to this record reopens the other finding.

Option B (gating on meta.lastTouchedVersion) was tried and withdrawn. It adds a stamp-hold and setup changes for the same rare case.

@buluoray

buluoray commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 62700a5 owner-decision: Needs Windows plus a superseded_acked.json the code cannot write (it renames atomically), so only a hand edit or outside corruption. Setup then refuses loudly and says to set false by hand; the host stays at the Windows default, not weaker. On 0.11 Windows a stored false already breaks every session (no KAS sandbox, #25154). Reviewers ask opposite things of this record. Decision: #29261 (comment)

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray recorded a owner-decision release (class owner-decision) for the gpt AI finding on 62700a5b0bad7f075a9c1a48b2b3af2987f795f3.

Needs Windows plus a superseded_acked.json the code cannot write (it renames atomically), so only a hand edit or outside corruption. Setup then refuses loudly and says to set false by hand; the host stays at the Windows default, not weaker. On 0.11 Windows a stored false already breaks every session (no KAS sandbox, #25154). Reviewers ask opposite things of this record. Decision: #29261 (comment)

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

With KAS the default, a stored agent.sandbox_allow_unsandboxed_exec:
false refuses every agent spawn on Windows, so Crew cannot start any
session. Builds before 0.6.0 saved that false on every write, and
kiro-cli confines no KAS process on Windows, so it buys no isolation.

Add an auto-adopting superseded_defaults row, Windows outside pods only.
The load path drops the false once, after writing the critical SEL
event kirocrew setup writes for an exec grant (the false stays when
that write fails), records it in the adoption ledger, and logs a note
that agent subprocesses now run without OS isolation; doctor lists it
with the restore command. A false set afterwards is kept, and setup
now acks the false it writes, as config set and Settings saves do.
Owner decision by the repo maintainer, 2026-11-03.
@buluoray
buluoray force-pushed the crew/slack/windows-drop-stale-sandbox-false branch from 62700a5 to 46bb5b2 Compare November 4, 2026 07:42
@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 Nov 4, 2026
@buluoray

buluoray commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Owner decision: accept and override the Opus finding on head 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65 ("The Windows one-shot close only runs when config.json loaded", src/kiro_crew/config/loader_pipeline.py:440).

The trigger: a fresh Windows home with no config.json, where the owner then writes config.json by hand with "sandbox_allow_unsandboxed_exec": false before Crew has written the file. The next load drops that false.

Why it is accepted:

  1. Only a by-hand first file hits it. kirocrew setup, kirocrew config set and the Settings page all acknowledge a false they write, so that false is kept.
  2. No real boundary is crossed. On 0.11 with KAS as the default, a stored false on Windows refuses every agent spawn, so no session can start. KAS has no OS sandbox on Windows (fix(kas): delegate the kiro-cli relay route to kiro-cli's sandbox on macOS #25154), so that false buys no isolation there. The drop writes a critical SEL event first and keeps the false if that event cannot be written.
  3. Same class as the earlier ruling. This is the same acknowledgement-record edge already ruled on for this PR: fix(config): adopt the windows unsandboxed-exec default once on load #29261 (comment)

@buluoray

buluoray commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 46bb5b2 owner-decision: Needs a fresh Windows home with no config.json, then a false written by hand before any Crew write. kirocrew setup, config set and Settings all ack a false they write, so only a by-hand first file hits it. On 0.11 Windows a stored false already breaks every session (no KAS sandbox, #25154). Same record-file class as the earlier ruling. Decision: #29261 (comment)

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray recorded a owner-decision release (class owner-decision) for the fable AI finding on 46bb5b28cfa50e1e5fe0fba7b598fa4e292eef65.

Needs a fresh Windows home with no config.json, then a false written by hand before any Crew write. kirocrew setup, config set and Settings all ack a false they write, so only a by-hand first file hits it. On 0.11 Windows a stored false already breaks every session (no KAS sandbox, #25154). Same record-file class as the earlier ruling. Decision: #29261 (comment)

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

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 4, 2026

@bolichen97 bolichen97 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.

[operator: bolichen97] Reviewed at 46bb5b2. I am leaving a comment, not an approval, because one point needs a maintainer decision.

The mechanics look right:

  • The adoption is recorded in the ledger before the key is removed, and an unreadable ledger adopts nothing, so the drop runs at most once.
  • A false written later by setup, config set or a Settings save is acknowledged and kept. A false in the config.local.json overlay is never touched.
  • The removal goes through the existing locked migration and removes only this one key.
  • Pods and Linux/macOS are excluded, the enterprise floor still applies at the sandbox gate, and the audit event is written before the drop. If that write fails, the false stays.

Open question (scope of the one-time drop). The recorded rationale, that there is no working state to protect, holds where KAS is the backend. On a Windows host that has moved back to the Kiro CLI backend and set false on purpose, that false is still a working choice. It keeps unconfined script crons, hooks, app backends, third-party MCP probes and provider CLIs refused. This PR drops it once, with only a warning log and the doctor line. Should _stale_unsandboxed_exec_false_applies also require that the effective backend (overlay included) is KAS? If the broader drop is intended, please name this case in the row's note and in the security spec's trade-off paragraph.

Minor, non-blocking:

  • audit_or_keep writes the "allowed" event before record_adoptions. If the ledger write then fails, the audit log shows a grant that did not happen.
  • _adopt_in_memory in config/migration.py hard-codes this key. A per-row resolver on SupersededDefault would keep the registry the single source.
  • close_when_nothing_stale reads only the base document. A test should pin the case where false exists only in the overlay.

AI-assisted, approved by bolichen97

@buluoray
buluoray enabled auto-merge (squash) November 4, 2026 19:27
@buluoray
buluoray merged commit fd14faf into main Nov 4, 2026
97 of 98 checks passed
@buluoray
buluoray deleted the crew/slack/windows-drop-stale-sandbox-false branch November 4, 2026 19:31
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 4, 2026
buluoray added a commit that referenced this pull request Nov 4, 2026
…29261) (#29896)

Forward-port of #29261 to release/0.12.0. On Windows, a stored
agent.sandbox_allow_unsandboxed_exec: false left by builds before
0.6.0 refuses every agent spawn under KAS, so Crew cannot start any
session. The load path now drops that false once, after writing the
critical SEL event, records it in the adoption ledger and logs a note;
a false set afterwards is kept.

Conflict: test/test_memory_v1_golden.py. Kept the release branch's
seeded-home file set (no config-provenance entry, which is main-only)
and added only this fix's Windows superseded_acked files.

(cherry picked from commit fd14faf)

@bolichen97 bolichen97 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.

Maintainer decision (security sign-off): accepted. Adopting the Windows unsandboxed-exec default once on load is accepted under the rule that we do not raise security strictness; this change restores the Windows default rather than adding a restriction.

Reviewed at 46bb5b2. I read the Opus finding your override covers ("The Windows one-shot close only runs when config.json loaded", in the loader pipeline). It describes a hand-written false on a fresh Windows home being dropped on the next load. That is an objection about keeping a stricter setting, not a functional bug: setup, config set and Settings saves all acknowledge the false they write, the drop writes a critical SEL event first and keeps the false if that write fails, and pods and non-Windows hosts are excluded. So it does not block under this decision.

Gates at this head: all 98 checks pass with none red or pending, no new regex in product code, and no other change request is open. Approving. Thank you for working through all the review rounds on this one.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants