Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 9 min read Case study mediumAdept

How River takes security work from a fix to merge

River, Shopify's Slack-based AI agent, drives dependency and application vulnerability fixes from patch to verified closure. It revalidates each ledger entry against the live repository head, PR state and vulnerability tracker before editing. It replays upgrades on the current head, grafts changes into the current lockfile, and ignores CI results from superseded commits. When it reaches a decision it cannot make, it hands owners one narrow question. After merge it confirms the default branch no longer carries the vulnerability. In the first 11 days the dependency backlog fell about 70%, and security merges through the freshness-gated merge queue rose from about 10% to 80%. The key lesson is that prompts can express judgment, but guarantees such as enumeration, deduplication and current-head identity must be enforced in code.

Assumes: pull request and CI workflowsdependency lockfilesLLM agents

Related posts

  • Defending Your Software Supply Chain: What Every Engineering Team Should Do Now

    Docker mediumAdept

    Recent supply chain compromises (the axios npm hijack attributed to Lazarus Group, the TeamPCP campaign via Trivy's GitHub Action, Shai-Hulud, GlassWorm) share one root cause: implicit trust in mutable tags, broad long-lived tokens and unsandboxed runners. The recommended defenses start with pinning Actions to commit SHAs and images to digests, using lock files with npm ci, and applying 3-day cooldowns on new dependency versions, since most malicious releases live only hours. Further layers are short-lived scoped CI credentials, avoiding pull_request_target, artifact proxies and build-time SBOMs, plus canary tokens and credential cleanup on developer machines. AI coding agents should run in microVM sandboxes and MCP servers should be governed. Many recommendations are paired with Docker products such as Hardened Images, Scout, Sandboxes and MCP Gateway.

  • How we use Dependabot to secure GitHub

    GitHub Engineering mediumAdept

    GitHub's Product Security Engineering team rolled Dependabot out across several thousand internal repositories in three stages: measuring alerts org-wide through the GraphQL API, a staged enablement (200 repos, then 1,000 at 30 days, then the whole org at 45 days), and remediation. Remediation was driven through the internal Service Catalog, which receives Dependabot metrics through the REST API, attaches SLOs with grace periods, and limits the effort to production services. Folding these metrics into the monthly Engineering Fundamentals review raised the share of services with zero alerts from 68% to 81% in a quarter, covering about 50 services. The same approach was later extended to CodeQL.

  • Automating cross-repo documentation with GitHub Agentic Workflows

    GitHub Engineering mediumAdept

    Aspire's team uses GitHub Agentic Workflows to auto-draft documentation pull requests in a separate docs repo whenever a product pull request merges, with the shipping engineer assigned as reviewer. The agent gets read-only access and emits intent, while a narrowly scoped safe-outputs handler with a two-repo GitHub App token, branch allow-lists, protected files and draft-only PRs performs the writes. A deterministic bash resolver maps milestones to docs release branches before the agent runs. Over 30 days, 396 runs produced 82 docs PRs, all merged, at a median 44.8 hours, after the prompt was tightened with negative examples to cut an initial ~13% false-positive rate.

  • Fixing security vulnerabilities with AI

    GitHub Engineering mediumAdept

    Copilot Autofix turns CodeQL security alerts into LLM-suggested fixes by building a prompt from the query help, the alert message, and code snippets along the data-flow path. The model returns a natural-language explanation, before/after code blocks (chosen over raw diffs because models miscompute line numbers), and a list of needed dependencies. Post-processing then applies fuzzy matching, syntax and semantic checks, and package-registry vetting. An automated harness over 1,400+ JavaScript/TypeScript alerts with test coverage counts a fix as successful only if it clears the alert, adds no new alerts or syntax errors, and leaves test outcomes unchanged; iterating against it tripled the success rate while cutting LLM compute sixfold.

  • Under the River

    Shopify Engineering mediumAdept

    Shopify's Slack-native agent River co-authors one in eight merged PRs, and it rests on two 2024 bets: a single monorepo (World) and Nix-built reproducible environments across dev, CI and production. Underneath sits Aquifer, an internal agent platform built so the session outlives any process. A Postgres-backed append-only event log holds the conversation, the agent harness runs outside a disposable sandbox, and ephemeral session cells are recreated on demand. Agents are shipped as Nix-built profile bundles across interactive, automation and job modes. Lessons for agent infrastructure: decouple the brain from the hands, make agents public and multiplayer so transcripts compound into shared skills, and treat each new agent as a profile rather than a new platform.

The quest for software engineering knowledge.

Look:
Layout: