Repository navigation
Conversation
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the computer-use refusal ( [DESIGN-REVIEWED] 3ffc70d Description read[DESCRIPTION-READ] 3a934b3b064267744313d03e7eef91fa53f6095646eb53a84c09e8cdb77fc85d 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 Before merge, check that the refusal reason reaches the agent in full. If it goes through the same ~200-character cut as the display title, the new line is cut off too. What this change shipsInventory (6 items) — 6 justifiedIntent: when a shell command is refused for reading AWS credentials from environment variables, the agent and the user can see which check fired and where it matched in a long command. This is a FIX (Refs #16714, which counts 14 of 48 refusals from this tier).
[FIRST-PRINCIPLES-REVIEWED] 3ffc70d Description read[DESCRIPTION-READ] f9b6aa077fdc01d71640e038af7d29d2ac9643d31af2a1a7e33eed81bf012b7c 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: |
3aeb942 to
7a65267
Compare
|
Review dispositions for
|
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 TIGHTENING: None. No pattern got stricter. The environment-credential tier now adds a refusal-diagnostic line to the reason it already returned, and ADJUDICATED: 18 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: The diff adds no assumption about paths, separators, interpreters or executable names. It changes what the matcher returns and adds text to the refusal reason, on every host. I still wrote candidates for each spelling of the operations next to this tier:
No platform the diff assumes was left without a candidate. [SCOPE-REVIEWED] 3ffc70d |
7a65267 to
515547c
Compare
39034b0 to
126d636
Compare
7513b6d to
3ffc70d
Compare
UX Review (Opus 5.5) — ⏭️ skippedRevision |
|
target=design head=3ffc70db28779c8f09e027668a2446d07561ea23 span=computer-use-refusal
|
|
target=first-principles head=3ffc70db28779c8f09e027668a2446d07561ea23 span=reason-reaches-agent
|
CrysisDeu
left a comment
There was a problem hiding this comment.
Review: DO_NOT_MERGE as-is → MERGE_WITH_NITS after rebase
Reviewed at head 3ffc70db. The design is right: diagnostics.py:199-209 emits the rule id, offsets and a character census, never the matched bytes, and matching behaviour is unchanged. No concerns with the code itself.
It cannot merge in its current shape, though — the branch is ~669 commits behind main and has a merge conflict. What a rebase needs to fix:
test/test_security.py:8179— this hunk is orphaned; the test it patches moved totest/test_security_bash_gate.py:448on main. Re-apply the change there or the suite goes red after rebase.test/test_security_gate_liveness.py:419—_PACKAGE_LINE_BUDGET = 31_537vs32_526on main. Set it to32_554(main + this PR's delta) and add the ledger entry.docs/system-specs/modules/security.md:1195-1200— textual conflict, resolve by hand.- Sensitive Change Review is red because the PR has no template section — fill it in for the rebased head.
Happy to approve once it is rebased and green; ping me.
Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: closing this PR. The operator is pausing work on T3/T4 issues for now, so this stays unmerged. The branch is kept: reopen the PR or reuse the branch if the issue is picked up again. |
Problem / Motivation
Goal: When the environment-credential check refuses a shell command, the refusal says which check fired and where in the command it matched, so the agent and the user can tell a real credential read from a text-only match.
The in-band refusal notice quotes the tool's display title, which the backend cuts to about 200 characters.
_check_env_credential_accessreturned the same single line for all seven of its checks (Blocked: command reads AWS credentials from environment variables), with no rule id and no location. When the match sat past the cut, nobody could see what triggered it. #16714 counts 14 of 48 policy refusals in one week from this tier, none with a credential read visible in the quoted prefix.Why it matters
An agent that cannot tell an over-block from a real block either gives up on allowed work or retries variants blindly, and the user cannot report the over-block precisely. This tier was the largest bucket in the issue's sample.
Not a goal
security/diagnostics.py, security.md "Refusal diagnostic"), because a refusal about a credential read must not become the leak.python3 -is executed code. It stays with the owner.-F *=@refusal (1 of 48). The git-publish floor already emits a diagnostic; the exfil reason already names its pattern.What changed (motivation → approach → change)
Symptom: an env-credential refusal on a long command gives no clue what matched. Cause: the tier returns a constant string, and the notice's quoted command is truncated. Change: the tier now appends the existing payload-free
Refusal diagnostic:line (already used by the argv floor, the git-publish floor and the keystone size ceiling), naming the check and the real match span in the scanned command.denied_rules._DenyMatchergainsspan(text);matchis nowspan(text) is not None, so a reported span and a verdict cannot disagree. Fragment path: first fragment start to last fragment end. Bounded path: the whole-regex match span._check_env_credential_access: the three shared rules report their catalog id (credential-exfil-env-grep-aws,credential-exfil-env-awk-sed-awsfrom fix(security): bound the env-credential rule's filter word so prose is not a dump #17881,credential-exfil-printenv-aws); the four keystone-only patterns get idsenv-cred-declare-print,env-cred-echo-expansion,env-cred-awk-environ,env-cred-interpreter-environ, index-aligned with_ENV_CRED_PATTERNS(iterated withzip(strict=True)and pinned by the new test). Componentenv-credential.test/test_security_gate_liveness.py:_PACKAGE_LINE_BUDGETraised from 31,509 to 31,537 (+28 lines, the net growth ofdenied_rules.py). Main sits exactly at the budget, so any growth ofsecurity/trips it; the raise carries its reason in the file's existing comment ledger.test/test_security.py::TestEnvDumpGrepAwsNarrowing::test_a_dump_in_a_tool_argument_is_still_refused(added by fix(security): bound the env-credential rule's filter word so prose is not a dump #17881) checked the reason by exact tuple membership; it now compares line one, the same way the other reason tests do.deny_guidance, the recovery card and the test that comparessplitlines()[0]are unaffected.Enumeration of the tier's checks, with this PR's verdict:
credential-exfil-env-grep-awscovered;credential-exfil-env-awk-sed-awscovered;credential-exfil-printenv-awscovered;declare -pcovered;echo/printf/cat $AWS_SECRET*covered;awk ENVIRON[...]covered; interpreteros.environ/ENV/process.env ... AWS_SECRET*covered. The span for a greedy.*pattern starts at its first token (for examplepython) and ends on the secret-bearing name, so the END offset is the one that locates the trigger.Backwards compatibility
Compatible: the refusal gains a trailing line; the first line and every match verdict are unchanged.
Removes nothing: the diff adds a diagnostic line and a matcher method; no key, rule, path or accepted input is removed.
Tests
test/test_env_cred_refusal_diagnostic.py(15 cases, run withpytest -n0by path, together withtest/test_security_gate_liveness.py):env-credential, and a span whose text ends on the secret-bearing name;end > 200;AWS_name and the reason contains no value from the command;is_sensitive_bash_commandpasses the annotated reason through;matchagrees withspan is not Nonefor all three shared matchers.Red on base: the file fails to import there. Mutations: reporting the whole subject instead of the hit span fails 4 cases; a fragment span of
(0, 0)fails 2.Manual verification
N/A — the change is a pure string producer covered by unit tests. Not run on macOS or Windows; the producer has no platform branch.
Related Issues
Refs #16714
Pattern harvest
Rule candidate: review-prompt
Pattern: a refusal producer that returns a constant reason for several distinct checks gives the reader nothing to diagnose; every refusal tier should name its check and, where it matches at an offset, the span.
Decision for the owner
#16714 asks whether refusals should show the matched text and whether content rules should skip heredoc and quoted text. This draft shows the check id and match offsets but not the matched text, and leaves matching unchanged, because echoing bytes breaks the diagnostics module's no-payload rule and skipping heredocs would let
python3 - <<EOFcode past the check.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.