Skip to content

Make app security checks static only - #8936

Open
jplhomer wants to merge 2 commits into
mainfrom
jplhomer/app-security-static-only-guardrail
Open

jplhomer wants to merge 2 commits into
mainfrom
jplhomer/app-security-static-only-guardrail

Conversation

@jplhomer

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

An agent proving a credential-leakage finding executed app/SDK code to build a repro, which made an unintended outbound request. The shipped prompts never forbade execution or network calls, unlike the XSS/SQLi checks, so a security-review agent could touch live services while trying to prove a finding.

WHAT is this pull request doing?

  • Adds an absolute static-only rule to both top-level instruction surfaces (checks/index.ts INSTRUCTIONS and INSTRUCTIONS.md §3): verify by reading code; don't execute app, SDK, test, or repro code; don't make network calls or probe live stores/services to prove a finding; if a candidate can't be proved from code, record the check as unresolved naming the candidate.
  • Adds the same one-liner to CREDENTIAL_LOG_LEAKAGE and CREDENTIAL_BROWSER_LEAKAGE, bumping both v2 → v3, and regenerates checks/embedded.ts.
  • Updates the targeted instruction/check tests that pin this content. No consent-gated execution path is added.

Targeted tests: checks.test.ts and app-security-instructions.test.ts (64 passed); eslint on the touched TS files passes.

@jplhomer
jplhomer requested a review from a team as a code owner October 16, 2026 15:55
Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:55
@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 16, 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.

🟡 Changes recommended

Credential check version mismatches violate the registry invariant and cause getRegistry() to throw.

1 open finding
What changed in this PR

Restricts Shopify CLI’s agent security investigations to static code inspection, preventing execution or live-service probing to prove findings.

Changes:

  • Adds static-only rules and unresolved-candidate guidance.
  • Updates both credential-leakage prompts to version 3 and regenerates embedded content.
  • Adds targeted instruction assertions.
File Description
packages/​app/​src/​cli/​services/​app-security-instructions.test.ts Tests static-only workflow instructions.
packages/​app/​src/​cli/​services/​app-security-engine/​tests/​checks.test.ts Checks restrictions and credential prompt versions.
packages/​app/​src/​cli/​services/​app-security-engine/​INSTRUCTIONS.md Defines static-only investigation rules.
packages/​app/​src/​cli/​services/​app-security-engine/​checks/​index.ts Adds restrictions to generated agent instructions.
packages/​app/​src/​cli/​services/​app-security-engine/​checks/​embedded.ts Synchronizes embedded prompts and instructions.
packages/​app/​src/​cli/​services/​app-security-engine/​checks/​CREDENTIAL_LOG_LEAKAGE.md Restricts verification and bumps version.
packages/​app/​src/​cli/​services/​app-security-engine/​checks/​CREDENTIAL_BROWSER_LEAKAGE.md Restricts verification and bumps version.

🧠 Review effort: Balanced


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

---
id: CREDENTIAL_LOG_LEAKAGE
version: 2
version: 3

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.

These tests are a bit funny but it does make sense to assert our product guidance in tests this way at least 👍🏼

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants