Skip to content

fix: show and refuse agent harnesses this host cannot sandbox - #34147

Open
bolichen97 wants to merge 1 commit into
mainfrom
fix/33728-harness-host-support
Open

bolichen97 wants to merge 1 commit into
mainfrom
fix/33728-harness-host-support

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Settings > Agent Harness says which harnesses this host cannot run and why, and neither that page, a config PATCH nor a crewmate harness pin can save one.

On native Windows (and on Linux or macOS with agent.sandbox: "off"), Settings > Agent Harness offers Antigravity, Codex, Copilot, DeepSeek, Goose, MiMo Code, OpenCode, Pi and Strands as ordinary choices and saves them without a word. Every session started afterwards, crewmates pinned to that harness included, is then refused at launch with AcpToolGateUnroutable: ... cannot run on native Windows .... The user learns the choice was dead only after making it.

Why it matters

Anyone on native Windows who tries a non-Kiro harness ends up with a gateway whose every new chat fails until they find the setting again. The refusal itself is correct; the page offering the choice is the bug.

Not a goal

  • Making an enforced harness run on native Windows. That needs an OS sandbox backend there.
  • Changing the launch refusal or its sentence.
  • Refusing an agent.sandbox: "off" save while an enforced harness is selected. The row then shows the refusal and its reason.
  • kirocrew config set and hand edits of config.json. They write the file directly; the page then shows the stored harness as refused.
  • spawn_run(backend=...). It is a one-off request, and its own launch already answers it with the same sentence.
  • Hiding a refused harness from the crewmate harness picker or from a broken pin's suggested fixes. Saving that pin is refused with the launch's sentence.
  • First-run setup's picker. It already holds these harnesses back through sandbox_blocked_backends.

What changed (motivation → approach → change)

The launch refuses an enforced harness when its credential mask cannot be applied (enforce_sandbox_floor). That check ran only at session start. /api/acp-backends computed each row from build capability and policy alone, so the page, the PATCH allowlist and the crewmate pin check could not know.

The fix gives that check one shared form and has every save surface read it, so they cannot disagree with the launch:

Where Now
agent_sdk/tool_gate.py sandbox_floor_refusal(backend, mode) returns the sentence enforce_sandbox_floor raises (or ""); enforce_sandbox_floor raises it
GET /api/acp-backends row new sandbox_refusal: "host" (no sandbox backend, e.g. native Windows), "setting" (agent.sandbox leaves the host's sandbox off), or ""
Settings > Agent Harness a refused row keeps its place and shows first-run setup's badge and sentence for that cause (Host can't sandbox / Sandbox turned off) ahead of any install fact, because installing cannot help; Use is disabled, and neither Check again nor the "New sessions switch from … to …" line is shown. The row type in website/src/api/client/config.ts carries the field, acpBackend.ts reads it as a sandbox_refused state that blocks Use, and AgentStatusBadge takes it as refused
PATCH agent.acp_backend refused with 409 acp_backend_sandbox_refused and the launch's sentence
crewmate pin (PUT /api/agents/{name}, crewmate_harness.py) refused with the launch's sentence; the check runs off the event loop

The row reuses first-run setup's translated strings, so no locale file changes; their translator context in en.context.json names both screens. Specs (agent-host-contract.md, crew-mode.md) and the feature map describe the new row field and refusals.

Backwards compatibility

Breaking: PATCH agent.acp_backend and a crewmate acp_backend pin now refuse an enforced harness whose credential mask cannot apply on this host. Every such value already made each session start fail. Writer sweep on origin/main @ b85217a:

  • website/src/pages/developer/AgentBackendTab.tsx (patchMut): disables Use on that row first, so it never sends one.
  • website/src/components/KiroPrerequisiteGate.tsx (configuredBackendCanStart): first-run setup already holds these back through sandbox_blocked_backends.
  • website/src/pages/members/CrewProfileSettings.tsx (harness pick): gets the 400 invalid_acp_backend with the launch's sentence instead of a stored pin that refused every session.
  • website/src/components/allSettings/AllSettingsList.tsx (Settings > Advanced): writes no agent.acp_backend of its own; its row links to Settings > Agent Harness (_OWNING_PAGES in config_all_settings.py).

Reader: src/kiro_crew/acp/launch.py:_sandbox_preflight -- chat -- unchanged: enforce_sandbox_floor raises the same sentence through sandbox_floor_refusal; test_acp_tool_gate.py
Reader: src/kiro_crew/dashboard/agent_admin/crew_update.py:api_kirocrew_agent_update -- crew page -- "", KAS, Claude Code and a host that can sandbox still save; test_crewmate_harness.py::TestCrewmateHarnesses::test_the_save_accepts_exactly_the_offered_list
Reader: src/kiro_crew/dashboard/handlers/core_config_patch.py:api_kirocrew_config_patch -- chat -- every non-enforced harness and "" still save; test_config_patch.py::test_picking_kiro_cli_stores_kiro_and_the_response_says_kiro

Tests

  • test_config_patch.py::test_a_harness_the_launch_refuses_on_this_host_is_not_saved: the PATCH answers 409 with the launch's sentence and writes nothing.
  • test_crewmate_harness.py::TestCrewmateHarnesses::test_a_harness_the_launch_refuses_on_this_host_is_not_saved: the crewmate pin is refused with the same sentence; KAS still saves. The neighbouring "save accepts exactly the offered list" test now pins a host that can sandbox, so it no longer depends on the test machine.
  • test_agent_sdk_backend_install.py::...::test_the_status_row_says_when_the_launch_refuses_the_harness_here: the row says "host" or "setting" by the host's sandbox backend, and "" for Kiro CLI; the pinned row shape carries the field.
  • acpBackend.eligibility.test.ts: sandbox_refused blocks Use and outranks a missing install and a failed check.
  • AgentBackendTab.test.tsx: a refused row's Use is disabled, and each cause shows its own badge and sentence with no Check again and no "New sessions switch" line, even when the harness is not installed.

Determinism: on Ubuntu 24.04 the three changed backend test files passed twice (504 tests, the second run in reversed file order on 3 workers), and the two changed frontend test files with sixteen neighbouring Agent Harness, Settings, Kiro account, Kiro sign-in, first-run setup and crewmate-profile test files passed twice (633 tests, the second run with --sequence.shuffle).

Proof: PROVEN test/test_agent_sdk_backend_install.py::TestEndpointPayloadShape::test_owner_gets_one_row_per_backend_in_the_pinned_shape (head d2ff40172fa1)

Manual verification

Ran on a Linux cloud host (Ubuntu 24.04) against an isolated gateway with agent.sandbox: "off". On main, the rows carry no sandbox_refusal and PATCH agent.acp_backend to goose answers 200 and stores it. On this change:

GET /api/acp-backends      antigravity, codex, copilot, deepseek, goose, mimocode, opencode, pi, strands: "sandbox_refusal": "setting"; kiro, kas, claude: ""
PATCH agent.acp_backend    goose -> HTTP 409, code acp_backend_sandbox_refused, the launch's sentence; config.json unchanged
PATCH agent.acp_backend    antigravity -> HTTP 409, same; kiro -> HTTP 200, stored
PUT /api/agents            crewmate pin codex -> HTTP 400, invalid_acp_backend with the launch's sentence; no pin stored; kas -> HTTP 200, stored

Captured Settings > Agent Harness from this change through the repo's capture entry (website/capture/settings-agent-harness.html) on a Vite dev server, with fixture rows for both causes, and checked that Use is disabled in each. Not run on a native Windows host (none here): the Windows sentence is the launch's existing branch, and the PATCH and pin tests compare against sandbox_floor_refusal whichever branch the host takes.

Screenshots / video

Native Windows (sandbox_refusal: "host"): every enforced harness reads Host can't sandbox. OpenAI Codex is checked and not installed: the row shows why it cannot run instead of an install command, Use is disabled, and no "New sessions switch" line promises a switch.

Agent Harness on a host with no sandbox backend, light

agent.sandbox: "off" on a host that has a sandbox (sandbox_refusal: "setting"): Sandbox turned off, with the setting's own sentence and a disabled Use.

Agent Harness with agent.sandbox off, light

Dark theme

Agent Harness on a host with no sandbox backend, dark

Related Issues

Closes #33728

Sibling sweep

Swept: git grep -nE "sandbox_blocked_backends|credential_mask_applies(" -- src/kiro_crew website/src
Sibling: src/kiro_crew/kiro_prerequisite_service.py -- not affected -- first-run setup already reads credential_mask_applies for sandbox_blocked_backends before it offers a harness
Sibling: src/kiro_crew/stt/codex.py -- not affected -- Codex dictation already checks credential_mask_applies before it offers itself
Sibling: src/kiro_crew/dashboard/messaging_api/spawn.py -- not affected -- a spawn is a one-off request and its own launch answers it with the same sentence; nothing is saved to fail later

Pattern harvest

Rule candidate: review-prompt
Pattern: a refusal that only runs at launch, with a save path (settings page, PATCH, pin) that offers the same choice without asking 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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 22:04
@bolichen97
bolichen97 requested a review from Zedmor November 9, 2026 22:04
@bolichen97
bolichen97 enabled auto-merge (squash) November 9, 2026 22:18
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/agent_sdk/tool_gate.py

  • @bolichen97 posted a complete reasoning template for 9d4b08f.

@bolichen97
bolichen97 force-pushed the fix/33728-harness-host-support branch from 82cea47 to a445ede Compare November 10, 2026 13:34
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9d4b08f459b2eccec761a11e125b42fe845eae54 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9d4b08f

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

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: every save surface and the rows now read the launch's own predicate, the rendered evidence shows the refused rows, and the listed breaking change only refuses values that already failed every session start.

Notes

  • The "host"/"setting" split depends on sandbox.detect_backend(), which is a second probe next to credential_mask_applies. If the two ever disagree (for example, a host whose backend is present but unusable), the badge will name the wrong fix while Use stays correctly disabled.

[DESIGN-REVIEWED] 9d4b08f

Description read

[DESCRIPTION-READ] 4308795bb4d44527fe445cdfd534755f08f1ed7d5e7a3d143f65c23b4236c186

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. Both refusal states appear in the screenshots, in light and dark themes. The blind reader read the faded "Use … →" button as switched off. The pill and detail text are existing first-run setup strings, now reused here.

Notes

  • sandbox_off_agent_detail on this page says "Turn it back on" with no link, and the blind reader asked where to go: "(agent.sandbox) looks like code… There's no button to 'turn it back on' from here." Add a link next to the line that opens the agent.sandbox row in Settings > Advanced.
  • In the list, "Host can't sandbox" and "Sandbox turned off" look the same: same warn colour, same triangle icon. The reader could not tell which one they could fix "without opening a row". Give the setting pill a different icon (for example a toggle-off icon) so the fixable cause stands out.

[UX-REVIEWED] 9d4b08f

Description read

[DESCRIPTION-READ] df3d2261366c6ec88b800b719099fddb98aca7fa1df7fe120e0a5e30e8377cff

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 9d4b08f459b2eccec761a11e125b42fe845eae54 — 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

Every item traces to a refusal the launch already makes (enforce_sandbox_floor). The PR only moves that answer forward to the surfaces that offer and save a harness. The notes are a sibling the PR leaves unfixed and one added duplication.

Notes

  • Item 1 — symptom-level sibling: first-run setup's sandbox_facts (kiro_prerequisite_service.py:502-507) still works out the same verdict on its own from credential_mask_applies and is_enforced, not from sandbox_floor_refusal. That leaves two spellings of the launch's verdict, which can drift apart. Subtraction: replace blocked's inline computation with sandbox_floor_refusal(backend, mode) per registered backend.
  • Item 4 — oversized: the steps "backend_from_stored + configured_sandbox_mode() + sandbox_floor_refusal" are written out 3 times (grepped sandbox_floor_refusal( with configured_sandbox_mode() in the diff): _acp_backend_sandbox_refusal, the end of harness_pin_rejected, and _sandbox_refusal. Subtraction: delete the two dashboard copies and call one helper that takes the stored value.

What this change ships

Inventory (6 items) — 4 justified

Intent: stop Settings and the save paths from accepting a harness every session start then refuses on this host. FIX.

  1. The Agent Harness row says "Host can't sandbox" or "Sandbox turned off" with first-run setup's sentence, and Use is disabled — symptom-level: first-run's verdict is still a separate spelling
  2. Check again and "New sessions switch…" are hidden on a refused row — justified
  3. PATCH agent.acp_backend answers 409 acp_backend_sandbox_refused with the launch's sentence — justified
  4. A crewmate harness pin save is refused with the launch's sentence — oversized: the same three steps are repeated in three places
  5. New sandbox_refusal field on /api/acp-backends rows ("host" / "setting" / "") — justified
  6. enforce_sandbox_floor now raises through the new public sandbox_floor_refusal — justified

[FIRST-PRINCIPLES-REVIEWED] 9d4b08f

Description read

[DESCRIPTION-READ] 156480f531602e4e3b445003c1db6a56fb30bcfd762e1f564e8f77f52b05825a

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9d4b08f459b2eccec761a11e125b42fe845eae54 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9d4b08f

Verdict parsed from the review's SHA-scoped output markers for commit 9d4b08f459b2eccec761a11e125b42fe845eae54.

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

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 10, 2026
@bolichen97
bolichen97 force-pushed the fix/33728-harness-host-support branch from a445ede to 99e57ce Compare November 11, 2026 14:15
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/developer/AgentBackendTab.tsx, src/kiro_crew/dashboard/handlers/core_config_patch.py, src/kiro_crew/dashboard/handlers/core.py, src/kiro_crew/agent_sdk/tool_gate.py, src/kiro_crew/crewmate_harness.py, src/kiro_crew/dashboard/agent_admin/crew_update.py, website/src/api/acpBackend.ts, website/src/i18n/en.context.json and the three spec/feature-map docs since this head went green (69d3a9a -> 63b9e03); CI re-running.

GitHub reported a merge conflict in AgentBackendTab.tsx: main's per-row screen-reader sentence (#33206) made status() return { text, named }, so the refusal line now returns named: true (both refusal sentences already name the agent). Every other file merged as is.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 11, 2026

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

Request changes on 99e57ce. The product logic is still correct after the rebase. Two small fixes are needed before merge. A refused harness row still tells the user "New sessions switch from Kiro CLI to OpenAI Codex.", which can never happen on that host; the UX lane BLOCK on this point holds. Separately, the PR's +20 test lines push test/test_config_patch.py over the line cap on main, so both Ratchets lanes are red. Decisive lines: website/src/pages/developer/AgentBackendTab.tsx:1698-1705 (switch sentence still shown on a refused row), test/test_config_patch.py (2,016 lines once merged with main, over the 2,000-line cap)

@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 11, 2026
@bolichen97
bolichen97 force-pushed the fix/33728-harness-host-support branch from 99e57ce to 1d46ca1 Compare November 11, 2026 22:05
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/dashboard/handlers/core_config_patch.py, src/kiro_crew/dashboard/handlers/core.py, test/test_config_patch.py, website/src/i18n/en.context.json and the three spec/feature-map docs since this head's CI ran (63b9e03 -> a0bf0ca); CI re-running.

The rebase takes main's split of test/test_config_patch.py (#35214), which keeps that file under the 2,000-line cap with this PR's test in it (1,930 lines). It applied with no conflict, and the PR's own patch is unchanged apart from the fix answering the review on 99e57ce.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=1fcab7daefb3 Switch promise shown on a harness that can't be used

fixed in 1d46ca1: a row whose probe carries sandbox_refusal no longer renders the "New sessions switch from … to …" line, so a refused harness's detail shows only its refusal sentence and the disabled Use button.
Regression: AgentBackendTab.test.tsx (a %s sandbox refusal names its cause on the row and in the detail) asserts the line is absent for both causes; with the production hunk reverted both cases fail on "New sessions switch from Kiro CLI to Claude Code."
The description's screenshots are re-captured from 20c9116f88, whose patch is identical to this head's (main changed none of the files that render this panel).

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] @buluoray thanks, both are in 1d46ca1:

  • Switch sentence on a refused row: fixed. The "New sessions switch from … to …" line is not rendered when the row carries sandbox_refusal, and the refusal test asserts it is absent for both causes. Screenshots in the description are re-captured from 20c9116f88, the same patch as this head.
  • test/test_config_patch.py over the line cap: main split that file in fix: keep update-popup skips per version across snoozes #35214 after this PR's base. Rebased onto a0bf0ca, it is 1,930 lines with this PR's test in it, and check_file_line_cap.py passes locally; both Ratchets lanes re-run on the new head.

The Sensitive Change Review check still needs a maintainer's filled template in an Approve review on the new head.

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto current main to resolve the merge conflict in docs/feature-map/README.md and website/src/pages/developer/AgentBackendTab.tsx.

@bolichen97
bolichen97 force-pushed the fix/33728-harness-host-support branch from 9c2a117 to 2f38d4c Compare November 17, 2026 21:31
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md and website/src/pages/developer/AgentBackendTab.tsx (both conflicting with the previous head) and in 12 more of this PR's files, src/kiro_crew/dashboard/handlers/acp_backend_status.py, src/kiro_crew/dashboard/handlers/core_config_patch.py and website/src/i18n/en.context.json among them, since this head went green (f6a144e -> 3b772f5); CI re-running.

This head is rebased onto current main and resolves both merge conflicts. In the feature map it keeps main's text in the agent row and re-applies this PR's two badge words and its sandbox-line clause. In the Agent Harness tab it keeps main's new Kiro CLI condition (no switch while new sessions run on Kiro Agent and a Kiro CLI pick would too) next to this PR's condition for a harness this host refuses, so the "New sessions switch" line stays hidden in both cases. Every other line of the patch is unchanged. Nothing else needed fixing: on the previous head every check was green apart from the merge conflict and the Sensitive Change Review, which still needs a maintainer's filled template in an Approve review on this head. The gates, the related tests, a smoke on a real gateway and the three screenshots were re-run on this head's patch.

[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/33728-harness-host-support branch from 2f38d4c to d06c164 Compare November 19, 2026 14:16
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The Backend Tests (3.12, 1) and Backend Tests (Windows) (4) reds on d06c164 are main's, not this PR's. test/test_process_cache_floor_ratchet.py::test_every_new_module_level_cache_has_a_per_test_reset fails on subagent_persistence.py::_NOT_DUE_MEMO, a file this PR does not touch, and the same node id is red on main's push run for 8301e68: https://github.com/kirodotdev/KiroCrew/actions/runs/44543577290

The fix is #39479 (tracked in #39478 and #39487). This PR rebases onto it once it merges; no push and no override for these reds until then.

Backend Tests (Windows) (5) failed on test_the_pass_fix_is_exported_to_the_pr_queue, the known Windows flake in #39485, also in a file this PR does not touch. Coverage Gate fails closed on those shards.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md, the agent host contract and crew mode specs, src/kiro_crew/crewmate_harness.py and website/src/i18n/en.context.json since this head's base (3b772f5 -> ae93f16); CI re-running.

The reds on d06c164 came from main, not from this change: the module-cache reset ratchet flagged a tombstone-sweep memo with no per-test reset (Backend Tests 3.12 shard 1 and Windows shard 4; fixed on main by #39479), and a Windows-only watcher timing test timed out (Windows shard 5; fixed on main by #39545). Coverage Gate and PR Readiness only fold those shards. The patch itself is unchanged: the rebase moved context lines only. On the new head the related backend tests (1668) and the two Agent Harness frontend test files (90) pass, and type check, lint, formatting and the diff-scoped static analysis rules are clean.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97]

Sensitive change review

  • Head commit: f82ce16
  • What rule changed: No rule changed. The session-start refusal for an enforced harness whose credential mask cannot apply on this host (enforce_sandbox_floor) now builds its sentence through a new predicate, sandbox_floor_refusal, and still raises the same error with the same text. The Agent Harness rows, the agent.acp_backend config PATCH and a crewmate harness pin save read that same predicate before any session starts.
  • Before -> after (what was allowed/blocked, now): Before, Settings offered, and a config PATCH or a crewmate pin save stored, a harness that every session start then refused on this host. After, the row shows the reason and its Use button is disabled; the PATCH answers 409 acp_backend_sandbox_refused and the pin save answers 400, both with the launch's own sentence, and nothing is stored. Session start refuses exactly the same set of harnesses as before.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): A harness that could really run here is refused at save time, so the user cannot switch to it from Settings until the predicate is fixed. Nothing is loosened: the session-start refusal is the same code and still runs on every launch, so no harness can start unsandboxed that could not before.
  • Evidence checked (which sandbox result proves it): An isolated gateway on Ubuntu 24.04 (Linux 7.0) with agent.sandbox set to off: GET /api/acp-backends marked every enforced harness "setting" and Kiro CLI, Kiro Agent and Claude Code ""; PATCH agent.acp_backend with goose and with antigravity answered 409 and left config.json byte-identical (same sha256), while kiro answered 200 and was stored; a crewmate pin PUT of codex answered 400 and stored no pin, while kas answered 200 and was stored. The patch has not changed since that run; later rebases moved context lines only.
  • No regression:
    • Tools still work (which tools/commands were run, result): Kiro CLI, Kiro Agent and Claude Code stay unrefused, and saving kiro or kas succeeded in the run above. The per-call tool gate path is not touched by this change, so ordinary tool calls behave as before.
    • Backward compatible (old config / old data / old callers still work, how checked): A config that already names a refused harness still loads; only a new save of one is refused, and its session start is refused exactly as before. The sandbox_refusal row field is additive on the existing endpoint, so an older client that ignores it keeps working; the endpoint shape test pins it.
    • Existing tests (which suites passed on this head): The tool gate, config patch, crewmate harness, backend install, host sandbox refusal and module-cache ratchet tests (1668 passed), the two Agent Harness frontend test files (90 passed), type check, lint, formatting and the diff-scoped static analysis rules; the full CI suite is re-running on this head.
  • How to undo: Revert this commit. The session-start refusal stays in force, because enforce_sandbox_floor keeps raising the same error with or without the new predicate.

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

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The Bundle Size Gate red on f82ce16 is main's, not this PR's. Main's own push run for ae93f16 (this head's base) fails the same check the same way: first-load-2 is 1.9 KB over its 1.15 MB budget (https://github.com/kirodotdev/KiroCrew/actions/runs/44655884934/job/136026129826). #39727 re-measures that ceiling (#39726). This PR waits for it and takes it in once it lands; no other check on this head has failed so far.

@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 20, 2026
Settings > Agent Harness offered every enforced harness (Antigravity,
Codex, Copilot, DeepSeek, Goose, MiMo Code, OpenCode, Pi, Strands) on
hosts where the launch always refuses them, such as native Windows or
agent.sandbox off, and saved the choice without a warning. Every later
session then failed.

The launch's refusal is now one shared predicate,
tool_gate.sandbox_floor_refusal, read by each /api/acp-backends row
(sandbox_refusal: host or setting), the agent.acp_backend PATCH and the
crewmate harness pin. The page shows a refused row with first-run
setup's badge and sentence for its cause and disables Use; the two saves
refuse with the launch's own sentence.

Closes #33728
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md, the agent host contract and crew mode specs, src/kiro_crew/crewmate_harness.py, test/test_crewmate_harness.py and website/src/i18n/en.context.json since this head's base (ae93f16 -> b85217a); CI re-running.

The only red on f82ce16 was the Bundle Size Gate, and it was red on main too (a first-load chunk over its budget). Main's fix #39727 has merged, and this head sits on top of it. The patch is unchanged: the rebase moved context lines only, next to main's #38927, which made Pi a crewmate-capable harness.

On this head's patch, on Ubuntu 24.04: all 66 local gates ran. The bundle-size gate is green (first load 9.26 MB of its 9.43 MB budget). The only two reds fail the same way on a clean main checkout: one auto-tier label ranking test, and the Electron shell tests on a machine without the Electron binary. The three changed backend test files (504 tests) and 18 Agent Harness and Settings frontend test files (633 tests) passed twice, the second run reordered. 3503 neighbouring backend tests passed, semgrep and the flake-pattern ratchet are clean, and the proof is still PROVEN. A smoke on a real gateway with agent.sandbox: "off" held: every enforced harness row says "setting", the PATCH answers 409 and stores nothing, and a crewmate pin of Codex or Pi is refused with the launch's sentence while KAS saves. With the sandbox back at its default, a Pi pin saves. The three screenshots were re-captured from this head.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97]

Sensitive change review

  • Head commit: 9d4b08f
  • What rule changed: No rule changed. The session-start refusal for an enforced harness whose credential mask cannot apply on this host (enforce_sandbox_floor) now builds its sentence through a new predicate, sandbox_floor_refusal, and still raises the same error with the same text. The Agent Harness rows, the agent.acp_backend config PATCH and a crewmate harness pin save read that same predicate before any session starts.
  • Before -> after (what was allowed/blocked, now): Before, Settings offered, and a config PATCH or a crewmate pin save stored, a harness that every session start then refused on this host. After, the row shows the reason and its Use button is disabled; the PATCH answers 409 acp_backend_sandbox_refused and the pin save answers 400, both with the launch's own sentence, and nothing is stored. Session start refuses exactly the same set of harnesses as before.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): A harness that could really run here is refused at save time, so the user cannot switch to it from Settings until the predicate is fixed. Nothing is loosened: the session-start refusal is the same code and still runs on every launch, so no harness can start unsandboxed that could not before.
  • Evidence checked (which sandbox result proves it): An isolated gateway on Ubuntu 24.04 (Linux 7.0) running this head's patch, on a host whose sandbox backend is Linux user namespaces, with agent.sandbox set to off: GET /api/acp-backends marked every enforced harness (Pi included) "setting" and Kiro CLI, Kiro Agent and Claude Code ""; PATCH agent.acp_backend with goose and with antigravity answered 409 and left config.json byte-identical (same sha256), while kiro answered 200 and was stored; a crewmate pin PUT of codex and of pi answered 400 with the launch's sentence and stored no pin, while kas answered 200 and was stored. After a restart with agent.sandbox back at its default, every row's sandbox_refusal was "" and a pi pin answered 200 and was stored.
  • No regression:
    • Tools still work (which tools/commands were run, result): Kiro CLI, Kiro Agent and Claude Code stay unrefused, and saving kiro or kas succeeded in the run above. The per-call tool gate path is not touched by this change, so ordinary tool calls behave as before.
    • Backward compatible (old config / old data / old callers still work, how checked): A config that already names a refused harness still loads; only a new save of one is refused, and its session start is refused exactly as before. The sandbox_refusal row field is additive on the existing endpoint, so an older client that ignores it keeps working; the endpoint shape test pins it.
    • Existing tests (which suites passed on this head): All 66 local gates on this head's patch, including the scoped backend run over 2175 related test files and the bundle-size gate; its only two reds (one auto-tier label ranking test, and the Electron shell tests without the Electron binary) fail identically on a clean main checkout. The three changed backend test files (504) and 18 Agent Harness and Settings frontend test files (633) passed twice, 3503 neighbouring backend tests passed, and semgrep and the flake-pattern ratchet are clean; the full CI suite is re-running on this head.
  • How to undo: Revert this commit. The session-start refusal stays in force, because enforce_sandbox_floor keeps raising the same error with or without the new predicate.

@bolichen97
bolichen97 force-pushed the fix/33728-harness-host-support branch from f82ce16 to 9d4b08f Compare November 20, 2026 06:57
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 20, 2026

This branch has not been deployed

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

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Harness page lets native Windows users select harnesses that are refused at every session start

3 participants