Skip to content

Nudge agents to add a regression test when fixing a verified app security finding - #8927

Merged
jplhomer merged 3 commits into
mainfrom
jplhomer/app-security-instructions-test-nudge
Oct 20, 2026
Merged

jplhomer merged 3 commits into
mainfrom
jplhomer/app-security-instructions-test-nudge

Conversation

@jplhomer

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The app security remediation guidance told agents to make the smallest safe changes when fixing findings, but never mentioned tests — so a fixed verified finding could silently come back.

WHAT is this pull request doing?

Adds one sentence to Section 6 of the app security agent instructions: when fixing a verified finding, add or update a deterministic regression test that reproduces it where the app has a suitable test setup, and run that test after the fix. Regenerates the embedded instructions copy. No changeset, matching recent instructions-only changes to this file, and no check prompts or versions change.

How to manually test your changes?

Run shopify app security check on an app, ask the agent to fix a verified finding, and confirm it adds or updates a regression test and runs it after the fix.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type and added a changeset with pnpm changeset add

PR authored by Qlaw

…rity finding

The remediation guidance said to make the smallest safe changes, but never mentioned tests, so a fixed finding could silently come back. It now asks for a deterministic regression test that reproduces the finding where the app has a suitable test setup, run after the fix.

Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
@jplhomer
jplhomer requested a review from a team as a code owner October 15, 2026 19:32
Copilot AI balanced review requested due to automatic review settings October 15, 2026 19:32
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Oct 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The guidance is narrowly scoped, both copies match, and no blocking issues remain.

0 open findings

What changed in this PR

Updates app security remediation guidance to help prevent verified findings from recurring.

Changes:

  • Directs agents to add or update a deterministic regression test where suitable test infrastructure exists, then run it after the fix.
  • Synchronizes the embedded instructions without changing check prompts or versions.
File Description
packages/​app/​src/​cli/​services/​app-security-engine/​INSTRUCTIONS.md Adds regression-test guidance for verified fixes.
packages/​app/​src/​cli/​services/​app-security-engine/​checks/​embedded.ts Updates the embedded instructions to match.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jplhomer
jplhomer requested a review from jek October 16, 2026 14:17
@jplhomer jplhomer removed the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Oct 20, 2026
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 20, 2026
@jplhomer
jplhomer enabled auto-merge October 20, 2026 13:44
@jplhomer
jplhomer added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 59be148 Oct 20, 2026
30 checks passed
@jplhomer
jplhomer deleted the jplhomer/app-security-instructions-test-nudge branch October 20, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants