Skip to content

fix(git): apply repo-exec neutralization to remaining host-side git callers - #24822

Merged
kyleseaman merged 1 commit into
mainfrom
fix/host-git-neutralize-sweep
Oct 28, 2026
Merged

kyleseaman merged 1 commit into
mainfrom
fix/host-git-neutralize-sweep

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: No host-side git call over a tree an agent can write runs a program that the repository's own config or attributes name.

An external report showed updates_check.py::_check_git_checkout running host git in an agent-writable checkout without the repo-exec neutralizers (update_governance.git_command_env, repo_exec_config_reason). A sibling PR fixes that file. This PR sweeps every OTHER host-side git caller. Several had the same hole: an agent that writes .git/config (core.fsmonitor, filter.<n>.clean), .git/hooks/* or a .gitattributes could get the dashboard, kirocrew update, the gateway's startup fingerprint or the auto-improvement app to run its program outside the sandbox, with the operator's privileges.

Why it matters

These calls run in the gateway/dashboard/CLI process, unsandboxed. A planted program there is a sandbox escape: it runs as the operator, with their credentials, on paths the agent cannot otherwise reach. The dashboard file diff and the startup fingerprint need no click at all beyond opening a file or starting the gateway.

Not a goal

  • dashboard/handlers/updates_check.py (sibling PR).
  • Resolving git off PATH at the sites that still spawn a bare "git" (a planted shim on PATH is a different vector from repo config; the update and fingerprint paths that already use trusted_git_bin keep it).
  • Closing check-then-use races in general. The update paths re-probe right before their destructive step; the remaining window is the same one the gateway apply path already accepts.
  • Sandboxed git callers (sandboxed_spawn_argv/wrap_argv): a program they reach runs inside the sandbox.

What changed (motivation → approach → change)

Measured on git 2.47.3 which subcommands run a planted program, then fixed every host-side caller whose command does (full table below). Two shared mechanisms, both already the project's own:

  • Fixed-name keys (core.fsmonitor, core.hooksPath, diff.external, core.pager, ...): git_command_env() pins them through GIT_CONFIG_*.
  • Repo-named drivers (filter.<n>.*, diff.<n>.textconv/command, hook.<n>.command): no key to pin, so the caller refuses first. Update paths use the existing repo_exec_config_reason. Read-only callers use a new narrower repo_exec_driver_reason (same probe without the fetch-only URL-rewrite / transport-trust / work-tree refusals, so a plain diff in a repo with url.<base>.insteadOf still works). It still refuses the transport keys (credential.<url>.helper, remote.<n>.vcs, core.gitProxy) and remote.<n>.uploadpack/receivepack: in a partial clone, a read-only archive/diff/show lazy-fetches missing blobs over the transport (tested end to end: a blob:none clone's git show in the file diff).
  • The dashboard dirty-tree check passes back the operator's core.excludesFile from git's effective view (--includes, global/system scope only), so a value set through a global include still ignores its files.
  • Refusal reasons name the offending key with URL userinfo and query strings replaced by <redacted> (before truncation), so a credentialed url.https://user:token@host/.insteadOf never reaches the gateway log or the 409 body.
  • Both probes now also walk initialized nested repos (gitlinks): status/diff/add start a child git there that runs the nested repo's own filter. This also closes that gap on the existing gateway auto-apply path.

Per site:

  • dashboard/handlers/updates_apply.py: refuse (409 repo_exec_config) before the first git call and again right before merge --ff-only; git_command_env on every spawn and on the floor read.
  • cli_server_update.py: same refusal before fetch and again right before reset --hard; one env on every spawn, the branch lookup and both divergence counts included (count_divergence[_sync] take env=), so an inherited GIT_DIR cannot make the guards judge a different repository than the reset.
  • code_fingerprint.hardened_git_env: now carries the git_neutralizer_env pins (it only silenced global/system config); _git_fingerprint falls back to the mtime rule on a driver.
  • frontend._write_build_source_fingerprint: env + driver refusal → no stamp (rebuild direction).
  • cloud/source.py: env on archive/ls-files/status; a driver sends packaging to the tracked-file tar path; archive writes plain tar (Python compresses it) because --format=tar.gz runs the repo's tar.tar.gz.command. A tree whose tracked files carry any filter attribute (LFS) packages the working files (minus export-ignore paths), since the isolated archive would ship raw blobs. Each ancestor directory is asked about export-ignore both bare and with a trailing /, so a directory-only pattern (docs/ export-ignore) is left out as git archive leaves it out.
  • Shared helper: gpg.ssh.program and gpg.x509.program are pinned beside gpg.program (an export-subst %G? in archive verifies an SSH-signed HEAD). remote.origin.uploadpack/receivepack pins are now the bare names (an absolute path is sent to an ssh server as the remote command and rejected). Git takes the first uploadpack it reads, the repository's, so repo_exec_config_reason now refuses remote.*.uploadpack/receivepack and both human-run fetches pass --upload-pack=git-upload-pack. For the FETCH of those two paths only, git_command_env(human_transport=True) keeps the operator's global config (as main's fetch already did, beside fix(git): keep agent-writable global git config out of host-side git #24824's isolation for every other call) and leaves credential.helper and core.sshCommand unpinned, so git reads the operator's own config natively (includes, includeIf, per-URL helpers, resets), and repo_exec_config_reason(..., human_transport=True) refuses the repository's own value of those two keys instead. Both probes take git= so they run the same binary as the caller (a host whose git is outside the trusted dirs is checked, not refused as unreadable).
  • dashboard/file_api/editor.py (api_file_diff): its -c flags left hooks and filters open; now git_command_env + driver refusal → status: "error". The listener, routes and auth are unchanged.
  • auto-improvement: the three git apply calls carried a bare argv; they now use require_pinned + GIT_SAFE_CONFIG + hook_off_args like every sibling. git_safety additionally pins commit.gpgSign=false/tag.gpgSign=false, log.showSignature=false, merge.verifySignatures=false and every signer program (gpg.program, gpg.ssh.program, gpg.x509.program) to a path that cannot exec, extends the attributes pin to * -filter diff merge (built-in merge driver, which is also the default for an unspecified path) with inert [attr]diff/[attr]merge macros defined first, so a repository macro of either name cannot expand back into filter=<n>, and require_pinned refuses a nested repo whose effective config (hasconfig: includes resolved) declares a driver, or whose own attributes bind a global/system driver by name (an unbound global filter.lfs or per-URL credential helper does not refuse; a nested repo that cannot be fully probed, including one whose .git/config was deleted, and any probe timeout, refuses instead of being skipped) (its spawn-free index check reads only a plain, single-link, size-capped file; a FIFO or device goes to the timed git probe).

The full audit table (file:line, cwd source, verdict) is under Sibling sweep.

Backwards compatibility

Breaking: POST /api/update and kirocrew update now refuse a checkout whose own .git/config (or a nested repo's) declares a repo-named driver, a URL rewrite, a transport-trust override or a remote.*.uploadpack/receivepack; the dashboard file diff answers status: "error" and the fingerprint/stamp/cloud paths fall back when it declares a driver. Because the shared probe now walks nested repos, the existing readers of repo_exec_config_reason also refuse a checkout whose SUBMODULE declares a driver (e.g. git lfs install --local inside a submodule): the gateway auto-apply (slack/gateway_runtime/update_apply.py) and the auto-route capability (platform/update_capability.py:553). The auto-improvement app refuses host git in a tree with a driver-declaring nested repo, and no longer signs commits (trade-off: an operator whose global commit.gpgSign=true gets unsigned auto-improvement commits, because the signer program is exactly what a repo-local gpg.program would replace). Writer sweep on origin/main @ a62012b: these refusals have no writers to update; the only callers of the changed functions are the routes/CLI themselves and the tests updated here. git lfs install writes filter.lfs.* to GLOBAL config, which none of the probes read, so a normal LFS checkout is unaffected.

Compatible for transport: the human-run update paths read the operator's credential helper and core.sshCommand exactly as before this PR (unpinned); a checkout whose OWN .git/config sets either is refused with a named reason. ssh fetches work again on the gateway auto-apply path, which pinned an absolute upload-pack on main.

Removes nothing: no route, key, field or function is removed or renamed; repo_exec_config_reason keeps its signature and verdicts for a repo without nested gitlinks.

Tests

  • test/test_host_git_repo_exec_neutralization.py: real repos with marker programs in repo-local config; each test first proves an unpinned git runs the marker, then drives the fixed caller and asserts it did not (fingerprint, build stamp, cloud tarball, file diff, dashboard apply end to end through status/fetch/count, CLI update end to end through fetch/status/reset, refusals, both re-probes, nested repos).
  • test/test_auto_improvement_host_git_apply_pins.py: materialize_queued_diff, _apply_argv (plain and --3way), _stage_winner, a signed commit, a merge.<n>.driver, a nested-repo filter.
  • Existing tests that fake subprocess.run stub the new probe (it cannot answer a fake); test_launch_engine_ref now asserts the pins are present.

Config keys tested: core.fsmonitor, core.pager, diff.external, .git/hooks/{post-index-change,reference-transaction,post-merge,post-checkout,pre-commit}, filter.pwn.clean, filter.pwn.smudge, diff.pwn.textconv (also planted during the CLI fetch, reaching the HEAD..target diff, now --no-textconv --no-ext-diff), merge.pwn.driver, commit.gpgSign+gpg.program, tar.tar.gz.command, remote.upstream.uploadpack, remote.origin.uploadpack, a nested repo's filter.*.clean (also behind a core.worktree redirect and with no trusted git), url.<base>.insteadOf, repo-local credential.helper/core.sshCommand (refused on human-run paths), and global credential.helper / credential.<url>.helper / core.sshCommand read natively (includes, includeIf, empty resets), plus probes on a host with no trusted git.

Run against origin/main's code, 39 of the 41 new tests fail. The two that pass on main: the _stage_winner wiring test, and the [attr]merge macro case (main's pin never sets merge; the case guards this PR's own pin).

Proof: PROVEN src/kiro_crew/apps/builtins/auto_improvement/tests/test_dogfood_learnings_commit.py::TestQueuedDiffTransport::test_patch_stdin_preserves_line_endings_and_non_utf8_bytes[\n], src/kiro_crew/apps/builtins/auto_improvement/tests/test_dogfood_learnings_commit.py::TestQueuedDiffTransport::test_patch_stdin_preserves_line_endings_and_non_utf8_bytes[\r\n], test/test_auto_improvement_host_git_apply_pins.py::test_materialize_queued_diff_apply_runs_no_planted_program, test/test_auto_improvement_host_git_apply_pins.py::test_commit_runs_no_repo_gpg_program, test/test_auto_improvement_host_git_apply_pins.py::test_nested_repo_driver_is_refused (head b35f3f0)

Manual verification

N/A — every fixed site is exercised by a test that runs real git against a poisoned repo; the measured command table was produced by standalone probe scripts on git 2.47.3.

Related Issues

Refs the external report on updates_check.py::_check_git_checkout (sibling PR fixes that file).

Sibling sweep

Swept: git grep -nE '"git"|trusted_git_bin|git_bin' -- src/kiro_crew plus an AST scan of every subprocess.run/Popen/check_output/create_subprocess_exec/create_subprocess_limited whose argv mentions git, then a fresh reviewer pass over the audit + diff.
Sibling: src/kiro_crew/dashboard/handlers/updates_apply.py -- changed here
Sibling: src/kiro_crew/cli_server_update.py -- changed here
Sibling: src/kiro_crew/code_fingerprint.py -- changed here
Sibling: src/kiro_crew/frontend.py -- changed here
Sibling: src/kiro_crew/cloud/source.py -- changed here
Sibling: src/kiro_crew/dashboard/file_api/editor.py -- changed here
Sibling: src/kiro_crew/apps/builtins/auto_improvement/backend/commit.py -- changed here
Sibling: src/kiro_crew/apps/builtins/auto_improvement/spine/driver_commit.py -- changed here
Sibling: src/kiro_crew/apps/builtins/auto_improvement/spine/git_safety.py -- changed here
Sibling: src/kiro_crew/slack/gateway_runtime/update_apply.py -- not affected -- already pinned and refused; nested-repo gap closed by the shared probe
Sibling: src/kiro_crew/dashboard/handlers/updates_check.py -- not affected -- fixed by the sibling PR for the original report

Full audit table (file:line, cwd source, verdict)

Host-side git audit

Scope: every place a HOST process (gateway, dashboard, CLI, update/apply, app backends, cron, hooks) spawns git with cwd/-C in a tree an agent can write. Base: origin/main @ aeb5c02c4b. dashboard/handlers/updates_check.py is excluded (a sibling PR fixes it).

Which subcommand runs a program named by repo-local config or attributes was MEASURED on git 2.47.3. Planted: core.fsmonitor, .git/hooks/*, filter.pwn.clean/smudge + .gitattributes, diff.pwn.textconv, diff.external, core.pager, merge.pwn.driver, commit.gpgSign + gpg.program, and a nested repo (gitlink) with its own filter.*:

command runs a planted program still runs with git_command_env pins
status, worktree diff fsmonitor, hooks, filter, nested repo's filter filter, nested filter
reset --hard, merge --ff-only fsmonitor, hooks, filter (smudge) filter
ls-files, fetch, apply fsmonitor (+hooks on fetch) none
add -A fsmonitor, hooks, filter, nested repo's filter filter, nested filter
archive filter; tar.<fmt>.command for a compressed format filter, compressor
fetch from a non-origin remote remote.<name>.uploadpack uploadpack (needs --upload-pack)
show <commit> textconv textconv (needs --no-textconv)
apply --3way, rebase merge.<n>.driver (pinned by attributes merge)
commit, rebase with commit.gpgSign gpg.program (pinned by commit.gpgSign=false)
rev-parse, rev-list, log --format, for-each-ref, symbolic-ref, config --get, ls-remote --get-url, worktree list, merge-base, show <rev>:<path>, tree-to-tree diff --quiet/--stat/--name-status, cat-file, var, remote none none

Fixed-name keys are closed by update_governance.git_command_env() (GIT_CONFIG_* pins). Repo-NAMED drivers cannot be pinned, so callers refuse first: update paths with repo_exec_config_reason, read-only callers with the new narrower repo_exec_driver_reason. Every repo-chosen name in these refusals (and in worktree._FILTER_KEY_RE) now matches an EMPTY name too: git runs [filter ""] bound by filter= (reproduced on git 2.47), and the old .+ let filter..clean through. Both now also walk every initialized nested repo the index records as a gitlink, joined onto git's effective work tree (core.worktree honoured). nested_repo_exec_driver_reason is the nested-only form git_safety uses; it probes with the same bare git the app runs, so a host without a trusted git is still checked.

file:line (main) git command cwd source verdict
dashboard/handlers/updates_apply.py:460,504,574,661 status, fetch, rev-parse, merge --ff-only KIROCREW_PROJECT_DIR VULNERABLE -> fixed: repo_exec_config_reason refusal (409 repo_exec_config) before the first git call AND again right before the merge (the fetch is a window), + git_command_env on every spawn and the floor read. The bare fetch follows the TRACKED remote, whose remote.<name>.uploadpack no env pin names, so it passes --upload-pack=git-upload-pack
cli_server_update.py:187,345,400 fetch, status, reset --hard KIROCREW_PROJECT_DIR VULNERABLE -> fixed: same refusal (exit 1) before the fetch, again before status, and again right before the reset (the fetch and the prompt are windows), + env on every spawn after the first probe
cli_server_update.py:153,215,236 rev-parse, tree-to-tree diff --quiet KIROCREW_PROJECT_DIR no exec vector (measured)
code_fingerprint.py:103 (_git_fingerprint) worktree diff HEAD package root (install checkout) VULNERABLE -> fixed: hardened_git_env silenced global/system config only; repo fsmonitor/hooks ran. Now carries the git_neutralizer_env pins; driver refusal -> mtime fallback
frontend.py:664 (_write_build_source_fingerprint) status -- website checkout root / Dev Fleet repo VULNERABLE -> fixed: env + driver refusal -> no stamp (the rebuild direction)
cloud/source.py:615,711,736 archive, ls-files, status repo_root() checkout VULNERABLE -> fixed: env on all three; driver refusal -> tracked-file tar path (only ls-files); archive --format=tar.gz ran the repo's tar.tar.gz.command, so git now writes plain tar and Python compresses it
dashboard/file_api/editor.py:527,539,552,563 (api_file_diff) show, diff HEAD, status, diff --no-index dirname of any file the dashboard opens (workspaces) VULNERABLE -> fixed: its -c flags pinned fsmonitor/textconv, not hooks (post-index-change ran) or filters. Now git_command_env + driver refusal -> status: error
apps/builtins/auto_improvement/backend/commit.py:169 apply --index - shared clone the agent edits VULNERABLE -> fixed: bare argv; now require_pinned + GIT_SAFE_CONFIG + hook_off_args like every sibling
apps/builtins/auto_improvement/spine/driver_commit.py:149,418 apply, apply --3way shared clone VULNERABLE -> fixed: same, via _apply_argv
apps/builtins/auto_improvement/spine/git_safety.py (all its callers: gate, driver_git, driver_publish, proposer, ...) add -A, status, commit, rebase, apply --3way clone + candidate worktrees PARTLY VULNERABLE -> fixed: nested-repo filters (require_pinned now refuses), merge.<n>.driver (attributes pin * -filter diff merge), gpg.program (commit.gpgSign=false, tag.gpgSign=false). Before this only the post-agent _repository_is_safe snapshot caught the last two
slack/gateway_runtime/update_apply.py git fetch fetch KIROCREW_PROJECT_DIR covered by #24808 (isolated scratch-dir fetch); not edited here
slack/gateway_runtime/update_apply.py (other calls) status/diff/reset KIROCREW_PROJECT_DIR already env + refusal; nested-repo gap closed through the shared probe; file not edited here
dashboard/stale_bundle_guard.py:113, cloud/ec2.py:638 rev-parse; ls-remote in trusted git dir package root; git's own dir no exec vector / not agent-writable; also get the pins through hardened_git_env
platform/update_governance.py:128, platform/update_capability.py:163 probes checkout already neutralized (env)
dep_sync.py:498 show <rev>:<path> checkout no exec vector; callers now pass the env
git_divergence.py:123,165 rev-list --count checkout no exec vector (measured)
env.py:838, dashboard/handlers/debug.py:685, pod/runtime.py:368, cli_doctor_parts/host_probes.py:104, auto_improvement/spine/scope.py:56 rev-parse, log -1 --format, worktree list, tree-to-tree diff --name-only checkout / package root / clone no exec vector (measured)
apps/builtins/md_notebook/git_ops.py:494 all notebook repos already neutralized
remote_session/workspace_tools.py::_git_status status remote guest already neutralized (filters blanked) and runs in the guest
apps/builtins/dev_fleet/repository.py:32 rev-parse registered repo already neutralized (env)
dashboard/handlers/worktree.py::_run_git, dashboard/file_api/git_panel.py::_run_git_bounded, project_tree.py:746,756, dashboard/handlers/themes.py:295, git_coord.py:834,873, dashboard/terminal_commands.py, file_explorer/server.py, design_critique/backend/routes.py, spec_builder/backend/repository_git.py, dev_fleet/runtime.py::_run_cmd (+worktree_ops*, fleet_state, npm_preflight sync step), ops_mission_control/backend/ledger_sync.py, papyrus/backend/gitops.py, registry_pipeline/* (incl. install_rollback.py), apps/routes_art.py various agent-writable sandboxed (sandboxed_spawn_argv/wrap_argv), so not host-side
builtin_skills/*/scripts/* (prepare-pr, pipeline-conductor, security-conductor) various worktree run by the agent in its own sandboxed shell, not by a host process
apps/registry_pipeline/checkout.py:553 init fresh dest not agent-writable yet
.git/commondir redirect (all repo_exec_config_reason callers) any checkout covered by #24808, not this PR

Shared-helper corrections the human-run update paths needed:

  • remote.origin.uploadpack/receivepack were pinned to an ABSOLUTE path, which over ssh is sent to the server as the remote command; GitHub/GitLab reject anything but the bare name, so every ssh fetch failed (already true of the gateway auto-apply on main). They are now pinned to the bare names; for a local transport git resolves those from its own exec-path first.
  • That pin never won anyway: git takes the FIRST uploadpack it reads, the repository's. repo_exec_config_reason now refuses remote.<any>.uploadpack/receivepack (covers all three update paths), and the dashboard and CLI fetches also pass --upload-pack=git-upload-pack, which does win.
  • git_command_env(human_transport=True) (the dashboard and CLI FETCH only; every other call keeps fix(git): keep agent-writable global git config out of host-side git #24824's home-config isolation) reads the operator's global config and leaves credential.helper and core.sshCommand unpinned, because the empty credential.helper pin clears git's whole helper list (per-URL entries included) and a human-run update to a private remote must keep the operator's own setup. The repository's own value of those two keys is refused instead (repo_exec_config_reason(..., human_transport=True)). The unattended gateway path keeps the pins.
  • The probes take git= and run the caller's own binary, so a host whose git is outside the trusted dirs gets a real answer instead of "unreadable git config".

Known limit (not new): every probe is check-then-use. An agent writing config between the probe and the call it guards can still win. The update paths re-probe right before the destructive step, as the gateway path already did.

Nested-repo probe (git_safety callers): reads git's scope-tagged effective view under a global-visible env and also counts a global/system filter.<n>/diff.<n> driver when the nested repo's own attributes bind <n> (check-attr, no driver run), because those host calls read agent-writable global config. An unbound global filter.lfs.* or credential helper does not refuse.

Pattern harvest

Rule candidate: review-prompt
Pattern: a host-side subprocess git call in an agent-writable tree without git_command_env() (or git_safety.git_argv) and a repo-named-driver refusal.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 27, 2026 09:07
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision b35f3f02553b833d82eb6cae2700a76e93e2d206 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 Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks. Each host-side git caller gets the project's existing git_command_env pins and either refuses or falls back when the repo names a driver, so the fix sits at the cause. The flipped filter..process assertion now matches what its test name says it checks: git runs empty-name drivers.

Notes

  • cloud/source.py now packages working files rather than HEAD blobs when any tracked file carries a filter attribute. On LFS trees that changes what ships (uncommitted edits can go into the tarball), and it rides along with a hardening PR. It should be stated plainly in the Backwards compatibility section, which is cut off in the captured description.
  • repo_exec_config_reason now walks nested repos, which widens refusals on the existing gateway auto-apply path. Operators whose submodules use LFS or textconv will start getting 409s from kirocrew update. The refusal reason should name the nested repo's path so they can tell which one to fix.

[DESIGN-REVIEWED] b35f3f0

Description read

[DESCRIPTION-READ] a4c753646b9ef2f6c7cf6a0498bb2cdf4d016ade816e919d8021927b979ab510

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

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b35f3f02553b833d82eb6cae2700a76e93e2d206 — 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 closes one root cause, host git running a program named by agent-writable repo config, across sibling callers. The shared mechanisms are reused rather than respelled.

Notes

  • Item 7 — rides along: "Refusal reasons name the offending key with URL userinfo and query strings replaced by <redacted>". This is new log and 409-body shaping on top of the neutralization fix. It is justified by the log boundary only because the new refusal text would otherwise echo credentials.

What this change ships

Inventory (10 items) — 9 justified

Intent: stop the dashboard, kirocrew update, the gateway fingerprint, cloud packaging and auto-improvement from running a planted git program outside the sandbox. This is a FIX.

  1. Dashboard update apply and kirocrew update now refuse a checkout that declares repo-named drivers, URL rewrites or uploadpack overrides — justified
  2. Dashboard file diff returns an error instead of running repo hooks or filters — justified
  3. Startup fingerprint and frontend build stamp fall back when a driver is present — justified
  4. Cloud packaging uses plain tar, and LFS-filtered trees package their working files — justified
  5. Auto-improvement git apply calls are pinned like their siblings; signers and merge drivers are neutralized — justified
  6. Both probes now walk nested repos (gitlinks), which also covers the existing gateway auto-apply path — justified
  7. Refusal reasons redact URL credentials — rides along
  8. Human-run fetches keep the operator's own credential and ssh config but refuse the repository's values of those keys — justified
  9. The dirty-tree check still honours the operator's global core.excludesFile — justified
  10. Divergence counts accept env= — justified

[FIRST-PRINCIPLES-REVIEWED] b35f3f0

Description read

[DESCRIPTION-READ] 94bf2b8b9f563c148d7c1ba0a98dbb2f890e803249dfa95110612a20a7d8c9bf

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 added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 6.1 flagged blocking issues on b35f3f02553b833d82eb6cae2700a76e93e2d206; Opus 5.5 adjudication downgraded every one of them. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

This comment is updated in place on each push.

Review details

BLOCKING -- src/kiro_crew/cloud/source.py:621 -- Preserve global export-ignore exclusions when packaging source

env=git_command_env(),
Trigger: A clean checkout contains tracked private.json, excluded by export-ignore in the operator’s global attributes file. Cloud launch calls ec2.deploy → upload_source → build_source_tarball → _use_git_archive; this environment disables global attributes.
Outcome: The previously excluded file enters the archive and is uploaded to S3; _refilter_archive’s filename exclusions do not remove private.json.
Anchor: defect
Fix: Resolve effective export exclusions with a non-executing attributes probe and apply them to both packaging paths, while retaining execution neutralization.
Sites: src/kiro_crew/cloud/source.py:715 also disables global attributes when _tar_fallback queries export-ignore, so fallback packaging loses the same exclusions.

[BLOCK-MERGE-DOWNGRADED] b35f3f0
[GPT-REVIEWED] b35f3f0

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — Harm: LOW. The archive path at src/kiro_crew/cloud/source.py:620-621 now runs git archive under git_command_env(). That env points core.attributesFile at the null device (update_governance.py:670-672), so git no longer applies the operator's global attributes. Three things must all hold for a file to slip through:

  • the file is tracked, so it is already committed to the repo;
  • only the operator's global attributes file marks it export-ignore, not the repo's own .gitattributes, which check-attr and archive still honour (source.py:817-841);
  • its name avoids every pattern in _exclude_filter (source.py:150-160).

When that happens, the file is uploaded to the operator's own S3 bucket and EC2 instance (ec2.py:885). That is a copy inside their own account. No other user gets access and no governance limit is bypassed. The fallback site at :715/:830 is new in this PR: before it, the fallback ignored export-ignore entirely, so that path got better, not worse.

The real fix costs more than that harm. It needs a second probe that reads the global attributes file, which the isolation design deliberately treats as agent-writable and refuses to read (update_governance.py:651-664). It also needs a new exclusion pass threaded through both packaging paths. That is a mechanism serving only this rare setup, plus a lasting exception to the isolation rule that every future reader has to understand.

[ADJUDICATION] b35f3f02553b833d82eb6cae2700a76e93e2d206 total=1 uphold=0 downgrade=1
DOWNGRADE F1 src/kiro_crew/cloud/source.py:621 reason=disproportionate-remedy
[GPT-ADJUDICATED] b35f3f02553b833d82eb6cae2700a76e93e2d206

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

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] b35f3f0

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

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

@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch from 966e701 to 9e3e529 Compare October 27, 2026 09:32
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch 3 times, most recently from 31a7cac to 18e11a0 Compare October 27, 2026 11:06
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch from 18e11a0 to 79e6f63 Compare October 27, 2026 12:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch 4 times, most recently from c35277d to 35d3c75 Compare October 27, 2026 15:16
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch 3 times, most recently from 8a252e0 to 403b8d4 Compare October 27, 2026 17:42
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch from c5b3254 to ba153bb Compare October 27, 2026 23:57
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 28, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch from ba153bb to 999de43 Compare October 28, 2026 06: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 Oct 28, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch from 999de43 to 6800d5f Compare October 28, 2026 07:03
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 28, 2026
@iamwhatever
iamwhatever force-pushed the fix/host-git-neutralize-sweep branch from 6800d5f to c7351a0 Compare October 28, 2026 07:38
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 28, 2026
…allers

Host-side git calls over agent-writable trees ran programs named by the repo's own config: core.fsmonitor and hooks (dashboard update apply, kirocrew update, code fingerprint, build-source stamp, cloud source tarball, dashboard file diff, auto-improvement git apply), repo-named filter drivers (same callers), nested-repo filters (every probe), merge drivers and gpg.program (auto-improvement). Pins every fixed-name key through git_command_env, refuses repo-named drivers (own and nested) before the call, and re-probes before the destructive update step.
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