Skip to content

fix(security): wire orchestrator to handle consolidateFindings.blocked signal#27

Merged
avifenesh merged 2 commits into
mainfrom
fix/orchestrator-blocked-branch
Apr 26, 2026
Merged

fix(security): wire orchestrator to handle consolidateFindings.blocked signal#27
avifenesh merged 2 commits into
mainfrom
fix/orchestrator-blocked-branch

Conversation

@avifenesh
Copy link
Copy Markdown
Contributor

@avifenesh avifenesh commented Apr 26, 2026

Summary

Closes a gap from #25. That PR added blocked/blockReason to consolidateFindings in commands/audit-project-agents.md, but the /audit-project orchestrator's Phase 6 iteration loop never read those fields - it only checked remainingIssues.length === 0. A prompt-injected reviewer subagent could mass-mark findings as falsePositive to zero the severity counter and silently approve.

This PR wires the blocked branch into Phase 6 using the same three-option AskUserQuestion pattern as prepare-delivery/skills/orchestrate-review/SKILL.md (lines ~326-374):

  • Treat flagged findings as open - strip falsePositive flags on the current raw agent results and re-run consolidateFindings in place. No reviewer re-spawn (mirrors prepare-delivery b09ca9c).
  • Override and approve - record suspicious: true + falsePositiveRatio in workflow state and exit.
  • Abort workflow - workflowState.failPhase(blockReason).

The blocked check runs BEFORE the zero-issues exit. Otherwise a blocked result with all findings flagged would slip through as "zero remaining".

Changes

  • commands/audit-project.md Phase 6 (lines ~294-318 before, ~294-379 after): rewrote the iteration loop to consume raw agent results, call consolidateFindings, branch on .blocked, then check zero-issues.

Test plan

  • Manual: simulate a reviewer returning 6/10 findings as falsePositive and confirm the AskUserQuestion gate fires
  • Manual: "Treat as open" path re-aggregates without re-spawning reviewers
  • Manual: "Abort" path calls workflowState.failPhase
  • Parity with prepare-delivery/skills/orchestrate-review/SKILL.md iteration loop confirmed by diff review

Note

Medium Risk
Changes the /audit-project iteration/approval control flow to gate suspicious reviewer outputs, so mistakes could block reviews or allow approvals if mis-handled, but it reduces a prompt-injection bypass risk.

Overview
Prevents the Phase 6 iteration loop in commands/audit-project.md from silently exiting when reviewers mass-mark findings as falsePositive by switching the loop to track raw agent results, re-run consolidateFindings, and honor its new blocked/blockReason signal.

When blocked is set, the workflow now prompts the user via AskUserQuestion to either treat flagged findings as open (strip falsePositive flags and re-aggregate without re-spawning reviewers), override and approve (record suspicious: true plus falsePositiveRatio), or abort (fail the phase), and this check runs before the zero-issues exit.

Reviewed by Cursor Bugbot for commit 2207230. Configure here.

…d signal

The previous PR added blocked/blockReason to consolidateFindings but the
/audit-project orchestrator's Phase 6 iteration loop only checked
remainingIssues.length === 0. A prompt-injected reviewer could mass-mark
findings as falsePositive to zero the gate counter and silently approve.

Wire the blocked branch BEFORE the zero-issues exit using the same
three-option AskUserQuestion pattern as prepare-delivery's
orchestrate-review SKILL.md (Treat flagged as open / Override and
approve / Abort). On 'Treat as open' we strip flags on the current raw
agent results and re-run consolidateFindings in place (no reviewer
re-spawn), mirroring prepare-delivery commit b09ca9c.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2207230. Configure here.

Comment thread commands/audit-project.md
Comment thread commands/audit-project.md Outdated
@avifenesh avifenesh merged commit a25b65e into main Apr 26, 2026
5 checks passed
@avifenesh avifenesh deleted the fix/orchestrator-blocked-branch branch April 26, 2026 17:55
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.

1 participant