feat(#1309): add mandatory finding for agent behavior definition changes - #445
feat(#1309): add mandatory finding for agent behavior definition changes#445ben-alkov wants to merge 3 commits into
Conversation
Site previewPreview: https://a49a1013-site.fullsend-ai.workers.dev Commit: |
🤖 Finished Review · ✅ Success · Started 5:13 PM UTC · Completed 5:22 PM UTC |
ReviewFindingsMedium
Previous runReviewFindingsMedium
Low
Info
Previous run (2)ReviewFindingsMedium
Low
Info
Labels: PR modifies a scaffolded skill definition to address a security governance gap in agent self-review. Previous run (3)ReviewFindingsMedium
Low
Info
Previous run (4)ReviewFindingsLow
Info
Previous run (5)ReviewFindingsLow
Info
Previous run (6)ReviewFindingsLow
Info
|
@@ -140,6 +140,16 @@ dimension carry over to another — each requires its own scrutiny.
[low] logic-error The new rule does not specify an explicit category name for findings. Without corresponding categories in the security sub-agent definition and the pr-review routing table, re-review severity anchoring will route findings for this rule to the correctness dimension instead of security. Consider adding category directives (e.g., agent-behavior-modification) to sub-agents/security.md and the routing table. 1 comment in thread |
@@ -140,6 +140,16 @@ dimension carry over to another — each requires its own scrutiny.
[low] logic-error The security sub-agent Own section does not explicitly list agent behavior definition files. Adding them would improve clarity and consistency with the mandatory-finding directive in SKILL.md. 1 comment in thread |
[low] formatting-consistency Uses Medium with uppercase M. The canonical severity list and existing rules use all lowercase. Should be medium for consistency. 1 comment in thread |
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
PR Summary by QodoRequire security finding when agent behavior definitions change
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
/fs-fix |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🤖 Review · ❌ Terminated · Started 6:22 PM UTC · Ended 6:32 PM UTC |
🤖 Finished Fix · ✅ Success · Started 6:22 PM UTC · Completed 6:29 PM UTC |
🔧 Fix agent — iteration 1 (human-triggered)No fixes applied. The bot approved with no findings, the human provided no specific instruction, and the code correctly implements issue fullsend-ai/fullsend#1309 requirements. All CI checks pass. Disagreed (1):
Tests: passed Updated by fullsend fix agent |
Why is there a structural blindspot here? 1 comment in thread |
@@ -140,6 +140,16 @@ dimension carry over to another — each requires its own scrutiny.
[low] logic-error The new 'Agent behavior definition changes' rule does not specify a finding category name. The routing table in step 3a of pr-review/SKILL.md enumerates recognized categories per dimension; an ad-hoc category string from this rule would fall through to the 'correctness' dimension as a fallback. The security sub-agent's 'Own' section also does not list agent behavior definition files. The concern is narrow: it only affects re-review severity anchoring when prior findings from this rule exist. Suggested fix: Add a category directive (e.g., 'agent-behavior-modification') to the rule text and add that category to the security row of the step 3a routing table in pr-review/SKILL.md. 1 comment in thread |
+- Agent behavior definition changes: If the diff modifies any file
[low] formatting-consistency Uses Medium with uppercase 'M'. Existing severity references in the same file use lowercase: high (line 137), medium (lines 261, 263), info (line 266). Should be medium for consistency. Suggested fix: Change Medium to medium. 1 comment in thread |
@@ -140,6 +140,16 @@ dimension carry over to another — each requires its own scrutiny.
[info] agent-behavior-definition This diff modifies a skill definition file that controls how the review agent evaluates changes. The modification is additive: it introduces a new mandatory-finding rule. The change expands review coverage by closing a governance gap. It does not relax, remove, or weaken any existing check. This PR is self-referential — the new rule would flag this very PR, which is the correct and intended behavior. 1 comment in thread |
🤖 Finished Review · ✅ Success · Started 6:22 PM UTC · Completed 6:32 PM UTC |
/fs-fix Take care of the "low" findings |
🤖 Finished Fix · ✅ Success · Started 8:00 PM UTC · Completed 8:06 PM UTC |
I'm wondering if these file patterns are too specific to fullsend-developing-fullsend. Another team using fullsend might not have Should these patterns be configurable? Something like a If we went that way, the rule in SKILL.md would say "check |
Following up on the configurability question — what's the relationship between this list and the "protected paths" list in pr-review? From a user's perspective, are these two separate lists that produce different behavior, or are they essentially the same thing? If they do the same thing (flag files for human attention), we might be asking users to maintain two lists that serve one purpose. If they're meaningfully different, we should be explicit about how — otherwise it'll be confusing to configure. |
Put another way: the small version of this might just be adding these patterns to the existing protected paths list — no new rule needed. The large version might be making the protected paths list itself configurable, so we aren't hardcoding paths that only matter for fullsend-developing-fullsend. |
🔧 Fix agent — iteration 1 (human-triggered)Addressed both low review findings: added explicit finding category Fixed (2):
Tests: passed Updated by fullsend fix agent |
@@ -140,6 +140,17 @@ dimension carry over to another — each requires its own scrutiny.
[info] agent-behavior-definition This diff modifies a skill definition file that controls how the review agent evaluates changes. The modification is purely additive. No existing checks are relaxed or weakened. This PR is self-referential. 1 comment in thread |
maps, IAM policy JSON/YAML, Kubernetes
[info] pattern-inconsistency Severity formatting uses a different pattern than the Permission manifest changes bullet. Cosmetic inconsistency. 1 comment in thread |
🤖 Finished Review · ✅ Success · Started 6:50 PM UTC · Completed 7:01 PM UTC |
🤖 Finished Review · ✅ Success · Started 12:48 PM UTC · Completed 12:58 PM UTC |
See the review comment for full details. |
@@ -146,6 +146,17 @@ dimension carry over to another — each requires its own scrutiny.
[medium] logic-error The new rule introduces category Suggested fix: Add
/fs-fix 2 comments in thread |
/fs-fix |
🤖 Finished Fix · ✅ Success · Started 8:12 PM UTC · Completed 8:17 PM UTC |
🔧 Fix agent — iteration 2 (human-triggered)Addressed both parts of the medium-severity logic-error finding: (1) added agent-behavior-definition to the security routing table in pr-review/SKILL.md, and (2) added agent behavior definition file coverage to the security sub-agent's Own section in sub-agents/security.md. This closes both gaps identified by the reviewer. Fixed (2):
Tests: passed Updated by fullsend fix agent |
This is an automated comment. We are moving agent content from |
Will move to agents repo |
Code Review by Qodo
Context used✅ Compliance rules (platform):
55 rules 1. Protected skills/ files modified
|
| - **Agent behavior definition changes:** If the diff modifies any file | ||
| that defines agent behavior — skill definitions (`skills/*/SKILL.md`), | ||
| agent definitions (`agents/*.md`), harness configs (`harness/*.yaml`), | ||
| or policy files (`policies/*.yaml`) — always produce a finding. Use |
There was a problem hiding this comment.
2. Incomplete behavior-file coverage 🐞 Bug ≡ Correctness
The new “agent behavior definition changes” rule only enumerates skills/*/SKILL.md, agents/*.md, harness/*.yaml, and policies/*.yaml, so edits to other instruction files (notably skills/*/sub-agents/*.md) are not guaranteed to trigger the mandatory finding. This PR itself modifies skills/pr-review/sub-agents/security.md, demonstrating the rule does not fully cover agent-behavior definition changes as intended.
Agent Prompt
### Issue description
The new mandatory-finding instruction for “agent behavior definition changes” lists a narrow set of file patterns and misses other repo paths that also define agent behavior (e.g., sub-agent instruction markdown).
### Issue Context
This PR changes `skills/pr-review/sub-agents/security.md`, which is clearly an agent-behavior/instruction file, but it is not included in the enumerated patterns in the new rule.
### Fix Focus Areas
- skills/code-review/SKILL.md[149-159]
### Suggested fix
- Expand the pattern list to include sub-agent instruction files (at least `skills/*/sub-agents/*.md`, and consider `skills/*/sub-agents/**/*.md` if nesting is used).
- Consider adding other behavior-defining top-level config files that control agent wiring/allowlists (e.g., `config.yaml`) if they are in-scope for the governance goal.
- Keep the category (`agent-behavior-definition`) and severity guidance as-is, but ensure the “always produce a finding” trigger covers all intended behavior-definition locations.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| handling, permission manifest changes, agent behavior definition changes | ||
| (skill definitions, agent definitions, harness configs, policy files), AND | ||
| prompt injection / Unicode steganography / bidirectional text overrides | ||
| targeting AI agents in code comments, string literals, and configuration | ||
| values in the diff. |
There was a problem hiding this comment.
3. Security taxonomy not aligned 🐞 Bug ⚙ Maintainability
skills/pr-review/sub-agents/security.md was updated to include “agent behavior definition changes” in the sub-agent’s scope, but the doc’s own Categories: list does not mention agent-behavior-definition even though the top-level taxonomy now does. This documentation drift makes category usage for these findings ambiguous/inconsistent for the security sub-agent.
Agent Prompt
### Issue description
The security sub-agent doc claims ownership of “agent behavior definition changes,” but its documented `Categories:` list does not include the new `agent-behavior-definition` category that the parent skill taxonomy recognizes.
### Issue Context
`skills/pr-review/SKILL.md` now includes `agent-behavior-definition` under the security dimension, but `skills/pr-review/sub-agents/security.md` still lists only permission/role/secret categories in its `Categories:` section.
### Fix Focus Areas
- skills/pr-review/sub-agents/security.md[16-23]
- skills/pr-review/sub-agents/security.md[126-134]
- skills/pr-review/SKILL.md[259-271]
### Suggested fix
- Update the `Categories:` list in `skills/pr-review/sub-agents/security.md` to include `agent-behavior-definition` (and/or add a short dedicated section describing how to label and severity-grade these findings).
- If the local `Categories:` list is meant to be illustrative rather than normative, clarify that explicitly to avoid confusion.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
waynesun09
left a comment
There was a problem hiding this comment.
Additional finding (no inline anchor)
[MEDIUM] PR description's Go/lint verification note is fabricated boilerplate carried over from the origin repo
The PR body states as fact: "make lint could not run due to Go module cache permission errors in the sandbox (infrastructure issue, not code-related)." This repository has zero .go files and no go.mod/go.sum anywhere, and its Makefile defines no lint target at all (only help, script-build, check-bundle, script-test, test). The real CI lint gate (.github/workflows/lint.yml test job) runs pre-commit run --all-files via Python/uv plus a directly-downloaded pinact binary — nothing touches a Go module cache. The actual required checks (test, script-test, commit-lint, DCO, vouch-gate) all show passing, so no real verification was skipped — the problem is specifically a false, unverified narrative carried over unedited from the Go-based origin repo (this PR is explicitly "Cloned from" the predecessor PR in the other repo).
Suggestion: Correct the PR body to describe the actual verification path (pre-commit hooks via the test CI job, which passed). When porting PR bodies/templates across repos, verify build/lint claims against the target repo's real tooling rather than carrying over unverified boilerplate — notably ironic here since scrutinizing unverified agent claims is exactly what this PR asks reviewers to do.
| handling, permission manifest changes, AND prompt injection / | ||
| Unicode steganography / bidirectional text overrides targeting AI agents in | ||
| code comments, string literals, and configuration values in the diff. | ||
| handling, permission manifest changes, agent behavior definition changes |
There was a problem hiding this comment.
[HIGH] Security sub-agent lacks mandatory-finding directive; fix doesn't fire in real (orchestrated) PR review
Verified directly: security.md's only change is a passing clause added to the "Own:" sentence (lines 19-20) — "agent behavior definition changes (skill definitions, agent definitions, harness configs, policy files)". It has no dedicated section, unlike the parallel "## Permission and role changes" section (lines 126-147) which has an explicit **Categories:** line, a "must always produce a finding, even if the change appears internally consistent" mandate, and a severity table. The actual four glob patterns, the "always produce a finding" mandate, and the info/medium severity split exist only in skills/code-review/SKILL.md (lines 149-159).
I verified via skills/pr-review/SKILL.md step 4 ("Compose the spawn prompt") that dimension sub-agents are dispatched with only Part 1 (their own definition file body), Part 2 (meta-prompt.md), and Part 4 (context package) — code-review/SKILL.md's content is never included (Part 3, the only place another skill's content is injected, is docs-currency-only). I verified via agents/review.md (lines 89-94) that any prompt referencing a PR number/URL routes to pr-review, not code-review — i.e., every real GitHub PR review goes through the under-instructed path. This is exactly issue #1309's own motivating example (PR #1156 approved with zero findings).
Notably, the predecessor PR's automated reviewer diagnosed this almost identically on 2026-06-24 ("the security sub-agent definition does not receive code-review/SKILL.md content during pr-review orchestration... will not produce agent-behavior-definition findings") — that exact comment thread was mirrored into this PR itself, and a fix commit (415a798) was applied that added the category to the pr-review routing table and this bare Own-list mention. That fix addresses the re-review misrouting half of the diagnosis but not the "sub-agent is never told this is mandatory" half — the gap the reviewer itself flagged remains unfixed.
The existing bot comment on this PR (anchored security.md:19-23, "Security taxonomy not aligned") only flags a shallower symptom (Categories list inconsistency/documentation drift) and does not identify that the fix is functionally inoperative for orchestrated review, so this is materially new information.
Suggestion: Add a dedicated "## Agent behavior definition changes" section to security.md mirroring "## Permission and role changes": state **Categories:** \agent-behavior-definition``, restate the four file patterns and the "always produce a finding" mandate verbatim, and restate the info/medium severity split. Do not rely on the Own-list mention — sub-agents never see code-review/SKILL.md's content during pr-review orchestration.
| Examples of permission-declaring files: GitHub App manifest JSON, | ||
| `permissions:` blocks in `.github/workflows/*.yml`, token scoping | ||
| maps, IAM policy JSON/YAML, Kubernetes `Role`/`ClusterRole` YAML. | ||
| - **Agent behavior definition changes:** If the diff modifies any file |
There was a problem hiding this comment.
[MEDIUM] PR description overstates the governance gap closed and duplicates existing protected-path enforcement; predecessor PR's maintainer questions were never resolved
The PR body claims this "closes a governance gap where the review agent could silently approve changes to its own skill definitions, agent definitions, harness configs, or policy files." I verified that gap doesn't exist today: skills/pr-review/SKILL.md's "Protected paths" check (lines 986-1053) already lists agents/, harness/, policies/, and skills/ as protected prefixes and mandates a protected-path finding that the schema uses to reject action: approve; scripts/post-review.sh's REVIEW_PROTECTED_PATHS array (whose own header comment calls it "the sole enforcement point") independently, deterministically downgrades any approve on these same directories with zero LLM dependency.
I also verified, via the mirrored history from the predecessor PR (explicitly "superseded by" this PR) now visible on this PR's own thread, that the maintainer raised three unresolved questions never answered: (1) whether the four hardcoded patterns should be configurable per adopting team (proposing a RISKY_FILES-style override); (2) the relationship to the existing protected-paths list — "the small version of this might just be adding these patterns to the existing protected paths list — no new rule needed"; and (3) a direct "Why is there a structural blindspot here?" comment on the rule's own justification text (still present verbatim at code-review/SKILL.md:156 today, unchanged and unexplained). The predecessor PR was closed for an unrelated reason (repo migration), not because these questions were resolved, and neither the code nor this PR's description addresses any of the three.
I also confirmed step 6c's cross-reference mechanism ("See also: [category] finding at this location") would not actually link a future protected-path finding to an agent-behavior-definition finding, since protected-path is generated later at step 6e, after the 6a-6c grouping/cross-reference pass has already run on sub-agent findings — so the two categorized findings will appear side by side with no stated relationship.
Suggestion: Before merging, explicitly resolve whether this rule should be folded into the existing protected-path list (per the maintainer's "small version" suggestion) or kept separate with a stated rationale for why a narrower, info/medium-graded rule adds value beyond the existing high/medium-graded, broader protected-path gate. Correct the PR description so it doesn't claim to close a gap that deterministic code already closes, and answer (or link) the still-open "why is there a structural blind spot" question instead of repeating the unexplained assertion verbatim.
Add a new Platform Security rule to the code-review skill that instructs the review agent to always produce a finding when a diff modifies files that define agent behavior. This closes a governance gap where the review agent could silently approve changes to its own skill definitions, agent definitions, harness configs, or policy files without flagging them for human review. The rule covers four file patterns: skills/*/SKILL.md, agents/*.md, harness/*.yaml, and policies/*.yaml. Severity is info for additive changes and medium for modifications that relax existing checks or remove constraints. Note: make lint could not run due to Go module cache permission errors in the sandbox (infrastructure issue, not code-related). This is a Markdown-only change with no Go code modifications. Closes #1309 Signed-off-by: Ben Alkov <ben.alkov@redhat.com>
Add explicit finding category `agent-behavior-definition` to the agent behavior definition changes rule so the pr-review routing table can correctly route and anchor these findings to the security dimension. Fix formatting consistency: **Medium** → **medium** to match the canonical lowercase severity convention used elsewhere in SKILL.md. Addresses review feedback on #2133 Signed-off-by: Ben Alkov <ben.alkov@redhat.com>
Add `agent-behavior-definition` to the security row in the pr-review routing table so findings with this category are routed to the security sub-agent during re-reviews instead of falling back to correctness. Add agent behavior definition file coverage to the security sub-agent's Own section so it knows to produce these findings during pr-review orchestration. Addresses review feedback on #2133 Signed-off-by: Ben Alkov <ben.alkov@redhat.com>
415a798 to
2be0d71
Compare
|
🤖 Finished Review · ✅ Success · Started 9:26 PM UTC · Completed 9:44 PM UTC |
ReviewFindingsMedium
Labels: PR modifies review agent skill definitions and security sub-agent scope |
| handling, permission manifest changes, AND prompt injection / | ||
| Unicode steganography / bidirectional text overrides targeting AI agents in | ||
| code comments, string literals, and configuration values in the diff. | ||
| handling, permission manifest changes, agent behavior definition changes |
There was a problem hiding this comment.
[medium] logic-error
The security sub-agent's Own block now claims ownership of 'agent behavior definition changes' but the file lacks a corresponding procedural section with the category name (agent-behavior-definition), severity guidance (info for additive, medium for weakening), and file pattern matching instructions. The standalone code-review/SKILL.md has full procedural detail, but the orchestrator dispatches the security sub-agent using only sub-agents/security.md — it does not receive code-review/SKILL.md. Without a procedural block, the sub-agent has no guidance on what category to emit, what severity to assign, or what file patterns to match. The existing 'Permission and role changes' responsibility has a dedicated section with categories, criteria, and severity rules; this new responsibility has none.
Suggested fix: Add a procedural section to skills/pr-review/sub-agents/security.md analogous to 'Permission and role changes' specifying: (1) category agent-behavior-definition, (2) file patterns (skills//SKILL.md, agents/.md, harness/.yaml, policies/.yaml), (3) severity guidance (info for additive, medium for weakening), (4) rationale.
|
🤖 Finished Retro · ✅ Success · Started 11:31 PM UTC · Completed 11:43 PM UTC |
Retro: PR #445 — Add mandatory finding for agent behavior definition changesOutcome: Closed without merging after 13 dispatch runs (triage, code, 6 reviews, 3 fixes on predecessor fullsend#2133, plus 1 review on this PR) across two repos over 50 days. The 17-line change added a new review rule to What went well
What went wrong
Evidence supporting existing issues
Proposals filed
|
Add a new Platform Security rule to the code-review skill that instructs the review agent to always produce a finding when a diff modifies files that define agent behavior. This closes a governance gap where the review agent could silently approve changes to its own skill definitions, agent definitions, harness configs, or policy files without flagging them for human review.
The rule covers four file patterns: skills//SKILL.md, agents/.md, harness/.yaml, and policies/.yaml. Severity is info for additive changes and medium for modifications that relax existing checks or remove constraints.
Closes fullsend-ai/fullsend#1309
Post-script verification
agent/1309-agent-behavior-review-rule)eda1e12306a7a4393c077260bcd5acde491b8649..HEAD)Original PR metadata