Repository navigation
fix(kas): relay an MCP server's boolean env flags, never its secrets - #25331
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ human override accepted@buluoray overrode this lane for |
First Principles Review (Opus 5.5) — ✅ human override accepted@buluoray overrode this lane for |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ human override acceptedHuman judgment by @buluoray overrides the GPT 6.1 finding for [GPT-OVERRIDE] 22b1554 This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
6e8357a to
b3ef92b
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: dispositions for the review of
The residual stays as stated in |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: sensitive change review for the current head. Sensitive change review
|
b3ef92b to
453177f
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: dispositions for the review of
Residual, stated in |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: sensitive change review for the current head. Sensitive change review
|
453177f to
4391838
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: dispositions for the review of
Residual, stated in |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: sensitive change review for the current head. Sensitive change review
|
4391838 to
bc645bc
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: disposition for the review of
|
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: sensitive change review for the current head. Sensitive change review
|
1970c2e to
22b1554
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: reply to the Opus 5.5 finding (run-together
|
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: sensitive change review for the current head. Sensitive change review
|
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: disposition for the Design and First Principles BLOCKs on Both lanes ran at 19:56Z and read the description from before this head. The description was rewritten at 19:59Z to match the bool-only rule:
Both jobs have been re-run against the current description. One sentence is still out of date: the Goal line ("the same settings it gets on kiro-cli"). That section is frozen for agents, so I have not edited it. Its scope is now a boolean flag only, and the "Not a goal" section says so explicitly. The owner can reword the Goal if they want it to match. |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: disposition for the First Principles note on Kept, by owner ruling. The ruling keeps the shared The GPT 6.1 Review check and the Sensitive Change Review check failed on this head because GitHub's primary API rate limit was hit. That is not a lane defect. Each will be re-run once after the hourly reset. |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: Owner decision, posted at @buluoray's direction. I accept the residual GPT 6.1 flagged on head 22b1554. A value is relayed to KAS only when it is exactly Every other value stays withheld and is named in the log. #25362 (local launcher, env never on the wire) owns the full fix, including this residual. Releasing the GPT lane as the owner. |
|
/ai-review override gpt 22b1554 owner-decision: Bool-only relay; the residual is a password literally true/false (at most one bit). Full fix tracked in #25362. Owner decision: #25331 (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. |
|
/ai-review override design 22b1554 evidence-supplied: The earlier BLOCK sample read a stale PR description; the re-run on the current body passes: https://github.com/kirodotdev/KiroCrew/actions/runs/40758711702/job/123072972813 |
|
/ai-review override first-principles 22b1554 evidence-supplied: The earlier BLOCK sample read a stale PR description; the re-run on the current body passes: https://github.com/kirodotdev/KiroCrew/actions/runs/40758711830/job/123072982553 |
Human judgment recorded@buluoray recorded a evidence-supplied release (class
This decision applies only to this commit. A new push requires a new judgment. |
Human judgment recorded@buluoray recorded a evidence-supplied release (class
This decision applies only to this commit. A new push requires a new judgment. |
CrysisDeu
left a comment
There was a problem hiding this comment.
Approve at 22b15548. Maintainer sign-off on the three self-overrides included below.
Rule as shipped: a third-party server's env value crosses the KAS wire only when it is the string true or false (case and edge whitespace ignored), the key is not credential-shaped, and the redactor leaves it alone. Everything else is withheld, so it fails closed. We ran 33 adversarial values through the real function (on, yes, 1, 0x1, secret://, ${}, empty, token-shaped keys): every result matched the rule. Residual leak is one bit (a password that is literally true/false). KAS gets strictly less than kiro-cli reads from disk. Sensitive Change Review and Security Scope green with the template for this head; security.md, acp-client.md, agent-spec-fields.md updated.
Self-overrides on this head, accepted as maintainer: GPT (owner decision on the one-bit residual: accepted); Design and First Principles (they read the stale body; re-runs on the current body pass). Next time ping a maintainer instead of self-signing; see #24692.
Nits: withheld key names now appear in INFO logs, including opaque ones, and main never logged them on purpose, so drop or downgrade that line; normalise the boolean before relay rather than sending whitespace as written; decide whether JSON true (not a string) should count, and say so in the docs.
Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.
Backports these main PRs to release/0.11.0, in pick order. Each was a `git cherry-pick -x` of its squash commit on main: - fix(memory): read memory.db off the writer lock, split background pool (#24290) (cherry picked from commit fed830c) - fix(dashboard): bound the pre-prompt build's wait to enter the memory pool (#24414) (cherry picked from commit 520cf2c) - fix(memory): keep the shared -wal when another process closes the memory store (#25852) (cherry picked from commit dc63bb6) - fix: read the page-cache prefetch in a child to keep sqlite locks (#26302) (cherry picked from commit 81dde23) - perf(memory): score facts from a term index and prebuild after restart (#25328) (cherry picked from commit 6824348) - fix(desktop): retry a failed netstat before Windows recovery gives up (#25792) (cherry picked from commit 043dd9f) - fix(cli): say a gateway still serves the port when restart's replacement is refused (#25366) (cherry picked from commit 2e13127) - fix(cli): refuse to stop or restart a gateway the desktop app supervises (#25705) (cherry picked from commit bbf0910) - fix(hooks): approve kiro-cli read-only file searches after the deny tiers (#25150) (cherry picked from commit a0c0bd4) - fix(settings): refuse a config save that config.local.json overrides (#26216) (cherry picked from commit 7f8688e) - fix(workflows): write non-finite floats as null so runs open (#26085) (cherry picked from commit 3591282) - fix(approvals): give each background tool approval its own id (#25905) (cherry picked from commit 51ef3bb) - fix(chat): record file changes for kiro-cli v3 write tools (#25650) (cherry picked from commit 5369270) - fix(sandbox): stop blaming a host-wide OOM kill on a per-tree limit (#25647) (cherry picked from commit 791d2a2) - fix(acp): replay history when a KAS resume restores no turns (#25521) (cherry picked from commit 47c71cb) - fix(kas): auto-approve granted built-ins after Crew's own checks (#25339) (cherry picked from commit dba4de5) - fix(kas): mount web_search as the engine's remote_web_search (#26435) (cherry picked from commit 65c21b5) - fix(kas): answer a spec's shell.allowedCommands at the gate, after Crew's checks (#25539) (cherry picked from commit 39d07d9) - fix(kas): relay an MCP server's boolean env flags, never its secrets (#25331) (cherry picked from commit b734a68) - fix(security): read the -c script past options and redirections (#26087) (cherry picked from commit fea0920) - fix(kas): refuse a shell command a denyByDefault spec does not allow (#26501) (cherry picked from commit 9f0d02f) - fix(kas): name a deniedCommands deny aimed at a redirect as not carried (#26489) (cherry picked from commit 4951c0c) - fix(security): delete the curl-upload deny rule (#26469) (cherry picked from commit 70e206e) Conflicts resolved by hand: - #26302: test/spawn_audit_helpers.py adds only the page_cache.py entry (the embeddings_child.py entry names a module 0.11.0 lacks); test/test_page_cache_prefetch.py takes main's file. - #25328: test/test_dashboard_server_composition_contract.py lazy-import count 93 -> 96 (the three names it adds). - #25705: test/test_cli_restart_refused_message.py takes main's file. - #26085: dashboard/handlers/workflows.py adds import math, keeps the release typing import. - #25339: platform/governance.py keeps the release rule for a missing ceiling (main's enterprise-baseline clause is not on 0.11.0). - #26435: harness-parity.md H6 row edited in place on the release text. - #25539: its acp-client.md and agent-spec-fields.md lines are left out; the paragraphs they edit are not on 0.11.0 (security.md carries it). - #25331: the test and two doc mentions use hoist_managed_servers / resume=, the 0.11.0 names of main's renamed hoist_servers_for_session. - #26087: security package line budget 32,552 -> 32,714 (re-measured). - #26501: kas_permissions.py comment keeps 0.11.0's shapes (main's subagent rules are absent); its acp-client.md line is left out, and the agent-spec-fields.md toolsSettings row says denyByDefault is gate-enforced. - #26489: its agent-spec-fields.md sentence is added to the 0.11.0 row. - #26469: test_denied_commands_security.py keeps 0.11.0's comment; count 113 -> 112. Test fixes (host-dependent tests made hermetic; none loosens an assertion): - tmpdir_helpers.short_tmp_path: a tmp_path override for modules whose code judges a path by its components (a .kiro/crew data-home part); an agent session's TMPDIR under ~/.kiro/crew made every test path the data home. Used by the file-explorer, design-tweak (both), spawn-offload, launch-copy, home-pin, native-skill and auto-improvement-members tests; the sage ancestor-chain test creates its dir under /tmp for the same reason. - pi-gate tests and the remote-session Python 3.9 test take the first real binary on PATH (playwright_cli_installer_helpers._native_tool_on_path): a mise shim under a scratch HOME hangs or writes to stdout. - snapshot-merge ACL test names its own uid; nobody (65534) is the overflow uid inside a user namespace and cannot be named in an ACL. - installer-step and push_guard interrupt tests spawn with SIGINT at its default; a background pytest run starts with SIGINT ignored, which a shell trap and Python both keep. Left out: #23920 (already on release/0.11.0), #26144 (needs sandbox_launch_mark from #24709), #26088 (fences a main-only port), #25346 (11 of its tests fail on 0.11.0: the kiro-cli skill scope it compares against differs there), #26397 (needs #26152's new download route, not on 0.11.0), #26428 (not merged).
…26487) Backports these main PRs to release/0.11.0, in pick order. Each was a `git cherry-pick -x` of its squash commit on main: - fix(memory): read memory.db off the writer lock, split background pool (#24290) (cherry picked from commit fed830c) - fix(dashboard): bound the pre-prompt build's wait to enter the memory pool (#24414) (cherry picked from commit 520cf2c) - fix(memory): keep the shared -wal when another process closes the memory store (#25852) (cherry picked from commit dc63bb6) - fix: read the page-cache prefetch in a child to keep sqlite locks (#26302) (cherry picked from commit 81dde23) - perf(memory): score facts from a term index and prebuild after restart (#25328) (cherry picked from commit 6824348) - fix(desktop): retry a failed netstat before Windows recovery gives up (#25792) (cherry picked from commit 043dd9f) - fix(cli): say a gateway still serves the port when restart's replacement is refused (#25366) (cherry picked from commit 2e13127) - fix(cli): refuse to stop or restart a gateway the desktop app supervises (#25705) (cherry picked from commit bbf0910) - fix(hooks): approve kiro-cli read-only file searches after the deny tiers (#25150) (cherry picked from commit a0c0bd4) - fix(settings): refuse a config save that config.local.json overrides (#26216) (cherry picked from commit 7f8688e) - fix(workflows): write non-finite floats as null so runs open (#26085) (cherry picked from commit 3591282) - fix(approvals): give each background tool approval its own id (#25905) (cherry picked from commit 51ef3bb) - fix(chat): record file changes for kiro-cli v3 write tools (#25650) (cherry picked from commit 5369270) - fix(sandbox): stop blaming a host-wide OOM kill on a per-tree limit (#25647) (cherry picked from commit 791d2a2) - fix(acp): replay history when a KAS resume restores no turns (#25521) (cherry picked from commit 47c71cb) - fix(kas): auto-approve granted built-ins after Crew's own checks (#25339) (cherry picked from commit dba4de5) - fix(kas): mount web_search as the engine's remote_web_search (#26435) (cherry picked from commit 65c21b5) - fix(kas): answer a spec's shell.allowedCommands at the gate, after Crew's checks (#25539) (cherry picked from commit 39d07d9) - fix(kas): relay an MCP server's boolean env flags, never its secrets (#25331) (cherry picked from commit b734a68) - fix(security): read the -c script past options and redirections (#26087) (cherry picked from commit fea0920) - fix(kas): refuse a shell command a denyByDefault spec does not allow (#26501) (cherry picked from commit 9f0d02f) - fix(kas): name a deniedCommands deny aimed at a redirect as not carried (#26489) (cherry picked from commit 4951c0c) - fix(security): delete the curl-upload deny rule (#26469) (cherry picked from commit 70e206e) Conflicts resolved by hand: - #26302: test/spawn_audit_helpers.py adds only the page_cache.py entry (the embeddings_child.py entry names a module 0.11.0 lacks); test/test_page_cache_prefetch.py takes main's file. - #25328: test/test_dashboard_server_composition_contract.py lazy-import count 93 -> 96 (the three names it adds). - #25705: test/test_cli_restart_refused_message.py takes main's file. - #26085: dashboard/handlers/workflows.py adds import math, keeps the release typing import. - #25339: platform/governance.py keeps the release rule for a missing ceiling (main's enterprise-baseline clause is not on 0.11.0). - #26435: harness-parity.md H6 row edited in place on the release text. - #25539: its acp-client.md and agent-spec-fields.md lines are left out; the paragraphs they edit are not on 0.11.0 (security.md carries it). - #25331: the test and two doc mentions use hoist_managed_servers / resume=, the 0.11.0 names of main's renamed hoist_servers_for_session. - #26087: security package line budget 32,552 -> 32,714 (re-measured). - #26501: kas_permissions.py comment keeps 0.11.0's shapes (main's subagent rules are absent); its acp-client.md line is left out, and the agent-spec-fields.md toolsSettings row says denyByDefault is gate-enforced. - #26489: its agent-spec-fields.md sentence is added to the 0.11.0 row. - #26469: test_denied_commands_security.py keeps 0.11.0's comment; count 113 -> 112. Test fixes (host-dependent tests made hermetic; none loosens an assertion): - tmpdir_helpers.short_tmp_path: a tmp_path override for modules whose code judges a path by its components (a .kiro/crew data-home part); an agent session's TMPDIR under ~/.kiro/crew made every test path the data home. Used by the file-explorer, design-tweak (both), spawn-offload, launch-copy, home-pin, native-skill and auto-improvement-members tests; the sage ancestor-chain test creates its dir under /tmp for the same reason. - pi-gate tests and the remote-session Python 3.9 test take the first real binary on PATH (playwright_cli_installer_helpers._native_tool_on_path): a mise shim under a scratch HOME hangs or writes to stdout. - snapshot-merge ACL test names its own uid; nobody (65534) is the overflow uid inside a user namespace and cannot be named in an ACL. - installer-step and push_guard interrupt tests spawn with SIGINT at its default; a background pytest run starts with SIGINT ignored, which a shell trap and Python both keep. Left out: #23920 (already on release/0.11.0), #26144 (needs sandbox_launch_mark from #24709), #26088 (fences a main-only port), #25346 (11 of its tests fail on 0.11.0: the kiro-cli skill scope it compares against differs there), #26397 (needs #26152's new download route, not on 0.11.0), #26428 (not merged). Co-authored-by: w <w@k.local>
Problem / Motivation
Goal: An MCP server declared in an agent spec starts on KAS with the same settings it gets on kiro-cli, while no credential-shaped
envvalue reaches the ACP wire.On KAS the agent spec travels over ACP (
_meta.kiro.customAgentsonsession/new), so the projection insrc/kiro_crew/acp/kas_agents.pywithheld every literalenvvalue from a server Crew did not author. A server that reads feature flags or settings fromenvstarted without them: in a live comparison one server exposed 15 tools on v2 and 37 on KAS from the same spec, and a second lost two settings variables.Why it matters
kiro-cli moves its default ACP engine to KAS on 11/2, so every session that ran on v2 runs on KAS. Any agent-spec server configured through
envsilently changes behaviour on that date, with no error.Not a goal
secret://reference routed through the gateway, or an edition-relayed${NAME}).KIROCREW_HOME(and edition references).headers,command,argsandurl: unchanged.envvalue (words, numbers, URLs, paths). Those values stay withheld on KAS here and are named in the log. KAS: relay URL and path env values for agent-spec MCP servers via a local launcher #25362 owns relaying them through a local launcher so the env never crosses the wire.What changed (motivation → approach → change)
Symptom: env settings missing on KAS. Root cause:
_withhold_credential_fieldskept only an exact edition-relayed${NAME}on a third-party server and dropped every literal. It did this because anything kept is in thesession/newframe, its recordings and its logs.Approaches weighed:
hoist_servers_for_session) so env stays local. Rejected: the hoist moves an entry intosession/new's ownmcpServersarray, which is the same frame, and hoists it as already projected. Keeping env truly local needs a Crew-side launcher, a new launch path; KAS: relay URL and path env values for agent-spec MCP servers via a local launcher #25362 owns that.MYSQL_PWD, run-togetherDBPASS, acronym-prefixed names. So the rule now holds by construction: no secret is a boolean.The change:
_relayable_literal(key, value)relays a third-party literal only when it is exactlytrueorfalse(case-insensitive, trimmed;_RELAYABLE_BOOLEANS). The value is relayed as written. A boolean is still withheld when:config.sections_agent_env.AGENT_ENV_CREDENTIAL_CLASS(the name split at punctuation and camelCase), or the gateway'sis_secret_env_key/is_credential_env_keyprefixes;external_text.redact_external_text) would change it alone or beside its key.Every other literal is withheld: numbers (a PIN is digits), words, URLs, paths, JSON, references,
secret://. The projection's INFO line names a withheld key when the name is a plain word the redactor leaves alone, counts the rest, and never prints a value. Managed servers keep their existing rule.agent.envand the shared class are unchanged.acp/kas_agents.pyis listed insecurity_posture.NON_EGRESS_REDACTION_MODULES: it asks the redactor a yes/no question and emits no redacted text.This fixes the boolean feature-flag case the issue reports and leaves the rest to #25362, so the PR says
Refs #25318rather than closing it.Backwards compatibility
Compatible: the change only relays values that were withheld before; nothing that was relayed is now dropped.
Removes nothing: no field, key, record or path is taken away; the only behaviour change is more
envkeys reaching third-party servers.Tests
test/test_kas_agents_mcp_env_relay.py(new):TestBooleansReachTheServer:true/falsein any case, and with surrounding spaces, relay as written. They appear in the serializedsession/newparams on both the new path and the load-path hoist.TestEverythingElseIsWithheld: 36 non-boolean values are withheld on both paths. Each case asserts its key is absent from the serialized params, and a value long enough to be unique is absent too.LOG_LEVEL=debug, numbers,yes/on/1, a host, a URL, a path.DBPASS,SMTPPASS,MYSQLPWD,ADMINPW,DB_PASSPHRASE,AWS_CREDS,SID_COOKIE,BASIC_AUTH,MYSQL_PWD,dbPass,SERVICE_PW,MODE, a digit PIN.ghp_,sk-proj-,AKIA, an opaque token, JSON, a connection string, a driver URL with a password, a webhook URL,${},secret://.true;rmand a quoted"true".TestABooleanCanStillBeWithheld:trueunderAPI_KEY,GITHUB_TOKEN,CLIENT_SECRET,DB_PASSWORDorencryptionKeyis withheld, and so is a key-pairedghp_...=true.TestTheRuleIsLocalToTheKasProjection:PW_TEST_HTML_REPORT_OPENis withheld on KAS, whileagent.envstill saves and loads it.TestTheWithholdIsLogged: withheld keys are named, values never are, and a credential-shaped key name is counted, not printed.test/test_kas_agents_mcp_servers.py: three tests used a fake secret (sekrit,sk-live,n0nce) under an innocent key. They now put it under a credential key.Mutation check on the pushed head. Each check was removed alone, one at a time, with the tree restored and clean in between:
test_boolean_flags_reach_a_third_party_serverand 80 moretest_a_non_boolean_value_is_not_in_the_frame[LOG_LEVEL-*],[MAX_RESULTS-*]and 63 moretest_each_boolean_relays_on_its_own[DEBUG],[TELEMETRY],[VERBOSE]and moretest_a_boolean_under_a_credential_key_is_withheld[GITHUB_TOKEN],[CLIENT_SECRET],[DB_PASSWORD],[encryptionKey]test_a_key_paired_credential_is_withheldtest_withheld_keys_are_named_and_values_are_nottest_a_credential_shaped_key_name_is_counted_not_printedRedundancy, by design:
trueunderAPI_KEYis caught by both the key check and the redactor's key-anchored pattern.Proof: PROVEN test/test_kas_agents_mcp_env_relay.py::TestBooleansReachTheServer::test_boolean_flags_reach_a_third_party_server, test/test_kas_agents_mcp_env_relay.py::TestBooleansReachTheServer::test_each_boolean_relays_on_its_own[DEBUG], test/test_kas_agents_mcp_env_relay.py::TestBooleansReachTheServer::test_each_boolean_relays_on_its_own[ENABLE_EXPERIMENTAL_TOOLS], test/test_kas_agents_mcp_env_relay.py::TestBooleansReachTheServer::test_each_boolean_relays_on_its_own[FEATURE_X_ENABLED], test/test_kas_agents_mcp_env_relay.py::TestBooleansReachTheServer::test_each_boolean_relays_on_its_own[TELEMETRY] (head 22b1554)
Locally run:
test/test_kas_agents_mcp_env_relay.py,test/test_kas_agents_mcp_servers.py,test/test_kas_agents.py,test/test_security_posture.py,test/test_acp_agent_env.pyandtest/test_agent_spec_fields_doc.py, 725 tests, all pass on this head.test_every_backend_launch_carries_agent_env[copilot]was deselected: it is red on origin/main on this host too, because a.mcp.jsonin the home directory makes Copilot refuse to start. The full suite was not run locally.Manual verification
Not run against a live KAS session on this host. Unit coverage asserts on the serialized
session/newparams, which is the frame KAS receives and what a frame recording stores. Windows and macOS are unverified here, though the change is pure string handling with no platform branch.Related Issues
Refs #25318: the boolean feature-flag case.
#25362 owns relaying every other env value through a local launcher, so env never crosses the wire.
Sibling sweep
Swept: git grep -nE "_CREDENTIAL_BEARING_FIELDS|withhold.*env|env.*withheld" -- src/kiro_crew/acp
Sibling: src/kiro_crew/acp/session_mcp.py:183 -- not affected -- mirrored hosts' acp_server_element carries the spec env as given, so there is no withhold to narrow
Sibling: src/kiro_crew/acp/kas_agents.py:1437 -- not affected -- hoist_servers_for_session hoists the already projected entry, so it inherits this filter
Pattern harvest
Not generalizable: the one place an agent spec's env is filtered for a wire is this projection; the reusable pieces, the redactor and the shared credential-name class, are reused rather than respelled. The lesson recorded for the class: a value gate for a wire is an allowlist of shapes, never a denylist of credential forms.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.