Run app security checks in CI/CD
Run the app security checks in your CI/CD pipeline so that every change is checked before it merges. This guide describes a pipeline that works with any CI/CD provider and any coding agent that can run unattended, and then gives an example for GitHub Actions and Codex that you can copy and adapt.
Anchor to Before you beginBefore you begin
Fix the issues that your app already has, so that the pipeline fails only on issues that a change introduces:
- Check your app with your coding agent.
- Fix every high-severity finding.
If your project has more than one shopify.app*.toml file, then pass --config to choose one, and pass the same flag to every shopify app security command in your pipeline.
Anchor to Build the pipelineBuild the pipeline
Whatever your CI/CD provider and coding agent, your pipeline should follow these basic steps:
- Scan. Run
shopify app security check --skip-instructions, and thenshopify app security review --blocking high. Stop the pipeline if the review fails, so you don't pay for an agent review that would fail anyway. - Review with an agent. Give your coding agent the output of
shopify app security instructionsas its prompt. The agent records its findings withshopify app security record. Keep only those findings, inagent-findings.json, for the next stage. - Decide. Run
shopify app security review --blocking high --jsonwith the scan results and the agent's findings, and keep its JSON output for the report. Also fail this stage if the agent review didn't finish, so a broken agent run can't pass. - Report. Optionally, post the results where your team works, such as a pull request comment. Build the report from the decide stage's JSON output, not from the agent's own text.
- Require. Make the decide stage a required check before merging.
Install your app's dependencies and the latest version of Shopify CLI in each stage that runs a shopify app security command.
Don't let the agent's commands reach the network, use sudo, or read credentials other than the model provider key, and let them write only inside the checkout. Don't run the agent stage for changes from forks, and don't give any stage that runs the change's code permission to write to your repository. Your coding agent sends your source code to its model provider.
Don't let the agent's commands reach the network, use sudo, or read credentials other than the model provider key, and let them write only inside the checkout. Don't run the agent stage for changes from forks, and don't give any stage that runs the change's code permission to write to your repository. Your coding agent sends your source code to its model provider.
Anchor to Example: GitHub Actions and CodexExample: Git Hub Actions and Codex
This workflow implements each stage of the pipeline as a job: precheck, agentic-review, verdict, and summary-comment. To set up the pipeline:
- In your repository's settings, add an Actions secret named
OPENAI_API_KEYthat contains your OpenAI API key. - Save this file in your repository as
.github/workflows/app-security-review.yml. If you pass--config, then add it to eachshopify app securitycommand, and updateRESULTS_DIR. - Open a pull request, and check that the Verdict check runs and the summary comment appears. The agent review skips draft pull requests.
- In your repository's branch protection rules, make Verdict a required status check.
.github/workflows/app-security-review.yml
Anchor to Adapt the exampleAdapt the example
You can adapt the example in the following ways:
Use another coding agent
Replace the Run Codex step with your agent, and give it the same prompt file. If your agent has no sandbox, then allow only the commands that the review needs. For example, this step runs Claude Code:
Run Claude Code
Use another CI/CD provider
Keep the four stages and the restrictions in Build the pipeline. Move the files between stages the way your provider passes artifacts between jobs.
Block on medium-severity findings too
Change --blocking high to --blocking medium in the Stop on high severity findings and Decide steps.
Run only the deterministic scan
Keep only the precheck job, and require Pre-check instead of Verdict. The scan covers fewer checks than the agent, especially for apps that don't use the React Router app template.
Run the agent review only on labeled pull requests
Add labeled to the pull_request types, and add contains(github.event.pull_request.labels.*.name, 'security-review') to the agentic-review job's if. Remove the label after the review, or every push runs the agent again.
Check a release before you publish it
Run the jobs in your release workflow, before the step that publishes. The release event starts after a release is published, so it can't block one.