Skip to content

Have coding agents read app security results as JSON - #8968

Open
jek wants to merge 1 commit into
app-security/support-json-schema-checkfrom
app-security/support-json-schema-agent-review
Open

jek wants to merge 1 commit into
app-security/support-json-schema-checkfrom
app-security/support-json-schema-agent-review

Conversation

@jek

@jek jek commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The coding-agent instructions have agents read review's terminal boxes and rejoin wrapped lines, and read record rejections from a box. With typed JSON output available from every app security command (earlier in this stack), agents can read results directly.

WHAT is this pull request doing?

Updates the agent workflow in INSTRUCTIONS.md and the commands it prints:

  • The workflow's check, record, review and clean commands pass --json --no-input. Each prints one JSON object on stdout, and nothing waits for input. The flags are added only in the instructions, so the commands' own next steps don't change.
  • Step 5 explains that a rejected document is an error with the code findings-document-rejected, and that details.errors lists every error.
  • Step 6 names the review --json fields to report from: checks[].findings, disposition, docsUrl, coverage, resultsFiles and scopeDiffers. Lines and columns are one-based, as recorded.
  • Deterministic-only mode keeps the plain check command: check --json has no findings.

Patch changeset, since the agent-facing content changes.

How to manually test your changes?

Build once and run the local CLI directly, so nothing else reaches stdout:

pnpm nx build cli
alias shopify-dev="node $PWD/packages/cli/bin/dev.js"
shopify-dev app security instructions --path <app>

The workflow's commands include --json --no-input; the deterministic-only command doesn't. Follow the printed steps with a coding agent, or by hand, and check that each command runs as printed and that review --json --no-input has the fields that step 6 names.

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 (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@jek
jek added this pull request to stack #8969 October 21, 2026 00:00
@jek jek changed the title Have coding agents read app security results as JSON Have coding agents read app security results as JSON Oct 21, 2026
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 21, 2026
@jek
jek force-pushed the app-security/support-json-schema-agent-review branch from 753568a to 1a0504c Compare October 21, 2026 00:46
The coding-agent instructions now run `check`, `record`, `review` and
`clean` with `--json --no-input`, and name the result fields to read.
`review`'s terminal boxes wrap long paths and commands, so agents had to
rejoin them; its JSON result has every finding in full, with absolute
paths and one-based lines and columns as recorded. A rejected `record`
document is an error with the code `findings-document-rejected` and
every error in `details.errors`. `--no-input` keeps an agent with a
terminal from stopping at the instructions prompt after `check`.

The flags are added where the instructions format the commands, so in
every shell they're on the command line itself, ahead of `record`'s
heredoc or redirection, and the next steps that the commands print
don't change. The deterministic-only scan is still read from its
terminal report, because `check --json` has no findings.
@jek
jek force-pushed the app-security/support-json-schema-agent-review branch from 1a0504c to 3544095 Compare October 21, 2026 01:11
@jek

jek commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @jek! Your snapshot has been published to npm.

Built from 3544095b7befd3fca8e4655b7b6e7f906d1f6269. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261021133901

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@jek
jek marked this pull request as ready for review October 21, 2026 13:58
@jek
jek requested a review from a team as a code owner October 21, 2026 13:58

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant