Repository navigation
fix(config): adopt the windows unsandboxed-exec default once on load - #29261
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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
[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 |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of 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
What this change shipsInventory (8 items) — 6 justifiedIntent: Windows installs upgraded from before 0.6.0 can start agent sessions again without anyone editing config by hand. FIX.
[FIRST-PRINCIPLES-REVIEWED] 46bb5b2 Description read[DESCRIPTION-READ] 000ccffaa2fdfd80567985b222051befa20b9b81cdaa942c10472c14a02a5e10 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ human override acceptedReviewed Human judgment by @buluoray overrides the Opus 5.5 finding for [OPUS-OVERRIDE] 46bb5b2 Verdict recorded from an authorized human decision for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
bbae430 to
dc90753
Compare
|
Dispositions for the reviews of
|
|
Dispositions for the notes on
|
dc90753 to
13c9dc1
Compare
13c9dc1 to
ddd0df0
Compare
|
Dispositions for the blocks on
Mutation checks on |
ddd0df0 to
5c11ca9
Compare
|
Rework at
|
5c11ca9 to
14f1192
Compare
|
Owner decision: keep option A on this PR (head On the second one: it needs a Why:
Option B (gating on |
|
/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) |
Human judgment recorded@buluoray recorded a owner-decision release (class
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.
62700a5 to
46bb5b2
Compare
|
Owner decision: accept and override the Opus finding on head The trigger: a fresh Windows home with no Why it is accepted:
|
|
/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) |
Human judgment recorded@buluoray recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
bolichen97
left a comment
There was a problem hiding this comment.
[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
falsewritten later by setup,config setor a Settings save is acknowledged and kept. Afalsein theconfig.local.jsonoverlay 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
falsestays.
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_keepwrites the "allowed" event beforerecord_adoptions. If the ledger write then fails, the audit log shows a grant that did not happen._adopt_in_memoryinconfig/migration.pyhard-codes this key. A per-row resolver onSupersededDefaultwould keep the registry the single source.close_when_nothing_stalereads only the base document. A test should pin the case wherefalseexists only in the overlay.
AI-assisted, approved by bolichen97
…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
left a comment
There was a problem hiding this comment.
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.
Problem / Motivation
Goal: A Windows install that still stores the pre-0.6.0
agent.sandbox_allow_unsandboxed_exec: falseruns 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:
sandbox_allow_unsandboxed_exec: bool = Falseand wroteasdict(agent)on every full save, sofalselanded inconfig.jsonon every host.truefor an undeclared key, but_agent_key_declared(src/kiro_crew/config/loader_document.py) counts the storedfalseas declared, and nothing removed it.delegate_to_kiro,src/kiro_crew/sandbox_wrap.py), so the value was never read._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: falseon 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
falsethere is still the default and is never touched.true, or any other key.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 existingsuperseded_defaultsregistry, 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: aSupersededDefaultrow foragent.sandbox_allow_unsandboxed_exec(false -> true,auto_adopt=True).appliesis true only whereunsandboxed_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 thatfalseon purpose. The row'snotestates 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 andconfig defaults) now appends a row's note.src/kiro_crew/config/windows_exec_adoption.py(new) andsrc/kiro_crew/config/migration.py: before the ledger record and the removal, the migration writes the same critical SELtool_invocationeventkirocrew setupwrites 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: thefalsestays 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 ortrue, there is nothing stale to drop, so it recordsfalseas acknowledged once (the same recordconfig set, Settings and setup write). Anyfalsewritten later, a hand edit included (as the no-isolation warning insandbox_wrap.pysuggests), 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 anauto_adoptrow it now records the key in the adoption ledger before removing it, the same marker-first order the load path uses. Before,--adoptonly dropped the ack, which erased the close record, so afalsewritten back by hand was auto-dropped on the next load. This also closes the same gap for the otherauto_adoptrows (the KAS row included).src/kiro_crew/config/loader_pipeline.py: callsclose_when_nothing_staleon 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), asconfig setand Settings saves already do, so a lockdown chosen in setup is never adopted.docs/system-specs/modules/config.mdand the platform-default paragraph indocs/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
falsewritten after that first load, by any writer, is kept. Residual: the ledger and acks live insuperseded_acked.json, which the file-edit gate does not protect. Adding an entry only keeps afalse(stricter). Removing one lets a later unacked hand-editedfalsebe adopted once more; doing that needs a process that can write the data home, which on Windows (no OS sandbox) can equally rewriteconfig.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
falsewith 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_consentacks it in this PR;pod/runtime._force_seed_agent_securityis excluded byKIROCREW_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 bytest_windows_drops_the_stale_false_once_and_logs_itReader: 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_declaredReader: 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 storedfalse-> dropped on disk,truein memory on the same load, ledger set, adoption line plus its note; afalseset after the adoption is kept; linux/darwinfalsekept and not reported; win32truekept; an ackedfalsekept; key absent ortrue-> load -> hand-editedfalse-> load ->falsekept; 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; afalsewritten afterconfig defaults --adoptis kept; nothing recorded off Windows; only this key dropped; a Windows pod keeps its seed-floorfalse; the drop writes the setup grant's critical SEL event; a failed SEL write keeps thefalsewith 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-falsecases 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_stalecall each turns at least one test red; so does deferring on an unreadable ledger, or skipping the--adoptadoption 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.pyalone (host memory limit): 16 passed, and caching despite a deferred close turns the retry test red; after the ledger and--adoptchange,test_config_windows_stale_exec_false.py,test_config_load_pipeline.pyandtest_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.platformpinned towin32through 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_defaultsregistry; this PR adds a row to it.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.