Repository navigation
docs: stream gh JSON payloads on stdin in the PR-body fallback and the sage poster - #21307
Conversation
Sensitive change review
|
Sensitive Change Review
|
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the PR only changes how two shipped recipes send their JSON body (stdin instead of a temp file), and the API call they make is unchanged. Notes
[DESIGN-REVIEWED] e775566 Description read[DESCRIPTION-READ] 57cab4b3381cb5a1d9039d174209f34de8a06be49f91fe0ff3526b74ad071e64 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. It is a fix to two shipped command recipes, the harm is named (a body file left in a shared What this change shipsInventory (3 items) — 3 justifiedIntent: Agents that follow the PR-body REST fallback or the sage poster should leave no JSON body file in a shared
[FIRST-PRINCIPLES-REVIEWED] e775566 Description read[DESCRIPTION-READ] e279c0e5943ba6c8a5cd56a12390b637a724271129f58c51fe3015e652df6703 That sha256 names the PR description this verdict read. Recompute it with |
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 — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: No regression has been confirmed by the script. The new matcher only fires when TIGHTENING: a new catalog row, ADJUDICATED: 29 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: 24 posix rows and 5 windows rows.
UNADJUDICATED: The legitimate ordinary operations this row refuses are the threat shape itself. Per scope rules they were not written as rows:
Those workflows run outside the agent gate, so this diff does not affect them. An agent asked to replay one would be refused, and would need to switch to the stdin forms ( [SCOPE-REVIEWED] 97ef649 |
ddbce2d to
05d5aed
Compare
05d5aed to
c310d45
Compare
4b36e7c to
69322c0
Compare
Sensitive change review
|
Sensitive change review
|
Sensitive change review
|
|
self-added: yes
🤖 AI-assisted comment 🤖 |
Sensitive change review
|
|
self-added: yes
🤖 AI-assisted comment 🤖 |
Sensitive change review
|
|
self-added: no
🤖 AI-assisted comment 🤖 |
Sensitive change review
|
|
@bolichen97 Ready for re-review at head
🤖 AI-assisted comment 🤖 |
|
Conflict-only rebase onto main |
Sensitive change review
|
|
self-added: yes
🤖 AI-assisted comment 🤖 |
Sensitive change review
|
|
@bolichen97 New head 🤖 AI-assisted comment 🤖 |
|
Conflict-only rebase onto main |
Sensitive change review
|
|
Backend Tests reds on |
|
Rebased onto main |
Sensitive change review
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This head (684b0c5) cannot merge yet. The first item needs a maintainer decision before any code change.
-
Open maintainer change request against the goal (
src/kiro_crew/security/gh_file_body.py:1,src/kiro_crew/security/denied_rules_catalog.py:558)- Review 5804824533 (2026-11-06) asks to drop the new
data-exfil-gh-file-bodyrefusal. That covers the row, its wiring indeny_gate.pyandexfil_bash.py,gh_file_body.py, the golden entry and the tests. It came after #30600 merged, so the earlier option B ruling does not cancel it. - Trigger:
gh release create v1 --notes-file CHANGELOG.md,gh api graphql --field query=@q.graphqlorgh api repos/o/r/pulls/1 -X PATCH --input body.json. - Outcome: at this head,
audit_bash_exfiltrationandis_deniedboth refuse all three. On main both allow them. - Later pushes changed the reader and kept the refusal, and no comment answers the review. #7365 also still records block or prompt as an open decision.
- Fix: get an answer in this thread. bolichen97, do you withdraw the request, or should this PR close and the stdin text edits in
ci.mdandreview_driver.pyland on their own? The goal is frozen, so the author must not cut it down alone.
- Review 5804824533 (2026-11-06) asks to drop the new
-
The
repoarm refuses flags thatgh repodoes not have (src/kiro_crew/security/gh_file_body.py:24, table at lines 36-42)- Trigger:
gh repo edit o/r --field 'notes=@n.md'orgh repo create x --input f. - Outcome: gh exits with "unknown flag" before it sends a request, so the arm blocks nothing. The spec line at
security.md:3291and the body still saygh api|repo --input <file>is an upload path, which is not true. - Fix: remove
"repo"from_GH_FILE_BODY_SUBCOMMANDS, delete its table and the test row attest_exfil_gate_opt_out.py:241, and changeapi|repotoapiin the spec and the body.
- Trigger:
-
Shell re-spelling decoding goes past the Not a goal (
src/kiro_crew/security/gh_file_body.py:57)- Trigger:
$'g\x68' api ...,g''h api ...,g\h api ...orgh api /gists $'--\x69nput' f. - Outcome: these are refused only because of decoding added in one round to answer a "spelling Y reaches it too" finding. The PR's own Not a goal excludes re-spelled program names, and AGENTS.md calls this kind of change a review smell, not a fix.
- Fix: delete the
_decode_ansi_c_bodyimport and theansistate in_word_text(lines 14, 57, 62-64, 70). Reduce_may_run_ghto a plain"gh"substring test. Delete the re-spelling refused rows. Plain quote removal (--in''put) can stay.
- Trigger:
Items 2 and 3 matter only if the refusal stays after item 1.
Optional:
- Four recursive
whole_wordsreads inshell_commands.py(lines 234, 236, 250, 368) have no pinning test. Rows such asx="$(gh api $(echo /gists) --input f)"would catch a regression. - The fail-closed branch of the
is_deniedfloor (deny_gate.py:886-888) has no test. A test that patches_gh_file_body_flagto raise would pin it. - If the refusal stays, add a Reader line for the cron fire-time re-vet (
mcp_cron_vet.py:vet_job_at_fire_time). Installed command jobs that use these flags will start to fail there.
|
Conflict-only rebase onto main |
Sensitive change review
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This head (97ef649) still cannot merge. The only push since my last review was a conflict-only rebase, so the blocking item below is unchanged.
- Open maintainer change request against the goal (
security/denied_rules_catalog.py:557,security/gh_file_body.py:1)- Trigger:
gh release create v1 --notes-file CHANGELOG.md,gh api graphql --field query=@q.graphqlorgh api repos/o/r/pulls/1 -X PATCH --input body.json. - Outcome: at this head, both
audit_bash_exfiltrationandis_deniedrefuse all three. On main, both allow them. Piping on stdin (--input -) is still allowed. - Review 5804824533 asks to drop this refusal: the row, its wiring in
deny_gate.pyandexfil_bash.py,gh_file_body.py, the golden entry and the tests. No comment since then answers it. #7365 also still lists block versus prompt as an open decision. - Fix: a maintainer answer in this thread. bolichen97, do you withdraw the request, or should the PR shrink to the stdin edits in
ci.mdandreview_driver.py? The goal is frozen, so the author should not cut it down alone.
- Trigger:
Status of my earlier items:
- Item 1 (open maintainer change request): still stands, see above.
- Item 2 (the
repoarm matches flagsgh repodoes not have,security/gh_file_body.py:24): still stands. It applies only if the refusal stays. - Item 3 (re-spelled program name decoding goes past the PR's Not a goal,
security/gh_file_body.py:57): still stands. It applies only if the refusal stays.
Optional:
- If the refusal stays, add Reader lines for the cron fire-time re-vet (
mcp_cron_vet.py:vet_job_at_fire_time) and user script hooks (hook_runtime/script_hooks.py). Installed jobs and hooks that use these flags will start to fail there. - The body says the floor honours a per-session waiver. The row's category is
credential-exfil, which makes it a self-guard, so a waiver never applies. Only turning the row off works. Please correct the text. - The added
kiro_crew.security.shell_normalizerrow inNOT_RULES(test/test_display_battery_rules_version.py:38) is not needed by this diff, and it loosens the import-closure ratchet. Thegh_file_bodyrow is needed and can stay.
…e sage poster The prepare-pr REST fallback for a failed `gh pr edit`, and the code-review-sage poster prompt, write their JSON payload to a temp file and pass `--input <file>`. Both now pipe the JSON on stdin (`--input -`), so no temporary file is left in a shared `/tmp`. Two small tests pin the shipped text. No deny rule changes: refusing gh's body-from-file flags was dropped from this change by the owner's decision; that question stays open in #7365. Design and finding from #8353 by atomsbaza. Co-authored-by: PISIT KOOLPLUKPOL <pisit.koolplukpol@outlook.com>
|
@bolichen97 @KiroCrewCaptain New head 🤖 AI-assisted comment 🤖 |
|
This head (e775566) has no blocking findings, but it cannot merge yet. Two things are still open: a change request from @bolichen97, and PR Readiness. Status of my earlier items:
What this review checked on this head:
Still needed before merge:
Optional:
|
|
Review-ready on e775566: all 102 checks pass and |
bolichen97
left a comment
There was a problem hiding this comment.
Approving e775566 as maintainer. 102 checks pass. The six red ones are cancelled duplicates, and each has a newer passing run on this head. This replaces my change request on 7787396.
The point from that review is fixed: the new gh file-body refusal (gh_file_body.py, the data-exfil-gh-file-body catalog row and its deny-gate wiring) and its regexes are gone. What is left changes no gate:
- The code-review sage poster prompt and the prepare-pr REST fallback now stream their JSON on stdin (
--input -) instead of writing a temp file, so nothing is left in a shared/tmp. - Two tests pin both texts, and that the exfil gate allows the stdin form. The
audit_bash_exfiltrationcall there reads an existing gate.
Replaces #8353 (by @atomsbaza), narrowed by the owner's decision to its stdin edits.
Problem / Motivation
Goal: Two shipped gh recipes send their JSON body on stdin instead of through a temporary file.
The prepare-pr skill's REST fallback for a failed
gh pr edit(references/ci.md) and the code-review-sage poster prompt (sage_lib/review_driver.py) both write the JSON payload to a temp file, then pass--input <file>. The temp file lands in a shared/tmpand is never cleaned up.Why it matters
An agent following either recipe leaves a body file behind in
/tmp, where another session can read or overwrite it. Piping the JSON on stdin (--input -) does the same job with nothing left on disk.Not a goal
gh api --input <file>,--field k=@<file>,gh release --notes-file <file>). The owner (iamwhatever, a maintainer) decided this PR drops that refusal, answering bolichen97's review 5804824533: a command that works on main keeps working. Block versus prompt stays open in Data-exfiltration deny pattern misses the long-form file-body flags #7365.What changed (motivation → approach → change)
ci.md)/tmp/pr-patch.json, then--input /tmp/pr-patch.jsonpython3 -c … | gh api … -X PATCH --input -review_driver.py)--input <tmpfile>--input -Both recipes send the same request as before; only the transport of the body changes. Two small tests pin the shipped text, and one checks that the exfil gate allows the stdin form.
Why this shape: the earlier version of this PR added a new deny row for gh's file flags. The owner decided to drop it, so this PR keeps only the stdin edits bolichen97 marked as fine to keep.
Backwards compatibility
Compatible: both recipes produce the same API call; stdin replaces a temp file, and every gh version that supports
--inputreads-as stdin.Removes nothing: no rule, key or function is taken away; only two command examples change.
Tests
test_prepare_pr_rest_fallback_uses_stdin:ci.mdshows-X PATCH --input -and no--input /tmp/.test_code_review_sage_poster_streams_its_payload_on_stdin: the poster prompt has no--input <tmpfile>, showsreviews --input -, andaudit_bash_exfiltrationallows the piped command.Proof: not provable -- docs or config only
Local: the exfil, display-battery and security-liveness suites and the code-review-sage tests pass on the head. One code-review-sage test (
test_store_ancestor_chain.py::…test_a_link_planted_inside_the_window_is_followed_outside_every_root) fails on this host and on main alike.Manual verification
N/A — the change is two command examples, and the tests read the shipped text.
Related Issues
Part of #7365
Replaces #8353
Checklist
Contribution License Agreement
Contributed under Apache-2.0. Original finding and design by @atomsbaza in #8353.