Sourcegraph Releases a Migration Agent: At Mercari, It Found About 80 Vulnerable Repositories
Updating a library or closing a vulnerability across a hundred services is weeks of routine work: every repo is slightly different, and CI keeps failing. Sourcegraph has opened a beta of Agentic Batch Changes. You describe the migration in plain language, and the agent finds the repositories, edits them, and fixes failing CI. At Mercari, it found about 80 repositories with a vulnerability in GitHub Actions. An engineer approves every PR, so try it on a small, real migration first.
AI-processed from Sourcegraph Blog; edited by Hamidun News
Imagine a company with a hundred services. You need to update a dependency, change an API call, or close a vulnerability urgently before an audit. The edit itself takes five minutes. Then comes the hard part: finding every affected repository, accounting for the fact that each one is set up slightly differently, waiting for CI (automated builds and tests), dealing with red builds, and getting each pull request to a state where it can be merged. Sourcegraph is trying to automate exactly this part and has opened a public beta of Agentic Batch Changes. There are early results already: the Japanese marketplace Mercari used it to find about 80 repositories with a vulnerability in GitHub Actions.
How the agent works
It builds on Sourcegraph's existing Batch Changes engine and code search, including Deep Search. You describe the migration in plain language, for example "replace the deprecated call with the new one in all services." The agent then works in steps.
First, it searches for all repositories the change affects and assesses how the edit will impact each one. Then it builds a plan. Typically it tries the approach on a single repository first and, once the method works, rolls it out to the rest.
If the change can be described by a deterministic script, the agent writes a script. If it needs judgment, for example because code is structured differently across services, it brings in a coding agent that makes the edit with context in mind.
CI is a separate piece. When a build fails, the agent reads the logs, works out the cause, and adds a commit with a fix. You can show it how to pull logs from your system, whether BuildKite, GitHub Actions, or something else. The goal is set firmly: get the PR to a state where it passes checks and is ready for review, rather than leaving it red. If the agent gets stuck or needs a decision, it stops and asks. You can step in and change course at any time. An engineer ultimately approves each set of changes.
The Mercari example
Mercari used the agent in an experimental setup. Patrick Klitzke, the tech lead for Help Center, was searching the code for an environment-variable injection vulnerability in GitHub Actions. By his account, one query was enough to cover the Help Center frontend and backend. He then extended the search to all of the company's repositories and found about 80 potentially affected ones.
The most telling part is how the agent handled the differences. Mercari's repositories are similar but not identical. A plain script would have reduced the task to a text search and replace, without understanding how each string is used. The agent analyzed each repository separately. Canva also tested the product: it split mass changes by code owner within a Bazel monorepo.
Sourcegraph names several suitable scenarios:
- Dependency updates with breaking changes between major versions
- Closing CVEs: search finds every place using the vulnerable library, the agent ships the fixes, and Code Insights tracks progress
- Refactors that need context rather than a regular expression: replacing deprecated APIs, removing ioutil in Go, dropping obsolete constructors in Java
- Rolling out new libraries and authorization contracts, where each service needs its own edit
- Modernizing CI configurations
- Generating documentation and AGENTS.md files in each repository to prepare the codebase for agentic tools
Limitations and what to do about them
This is a public beta, and the company openly warns of rough edges. The product is designed for changes across many repositories at once. For a task in a single repository, Sourcegraph itself recommends a regular coding agent. The beta is available to Sourcegraph Cloud customers and usage is currently free. Support for the self-hosted version is promised for July 8, 2026, with the release of Sourcegraph 7.5.
What practitioners should take away: First, the bottleneck in large migrations often lies in orchestration: finding targets, waiting for CI, and manual fixes after red builds. That is the part now being handed to agents. Second, the rule that a human approves every PR looks sensible at this scale: the agent takes on the routine, and responsibility stays with the team. Third, the examples Sourcegraph cites are customer stories from the beta program, with no independent figures on the share of PRs successfully merged or the time saved.
So a reasonable first step is to take a small but real migration, such as a deprecated call or a shared CI template, and see how many repositories the agent gets to merge without your involvement. If you have dozens or hundreds of services and a growing tech-debt backlog, the product is worth trying while it is free.
- Nov 21, 2026VibeCBS collects project nicknames in advance: the agent finds 2.8 times more documents
- Nov 21, 2026FDE job postings grew 4.6x in a year: what a forward deployed engineer actually does at the client's site
- Nov 21, 2026Sakana AI Opens Applied Research Lab for Market and Economic Modeling
- Nov 21, 2026Meta Is Reportedly Preparing the $300 Muse Charm AI Tamagotchi With a Year of Verizon 5G
Key Questions Answered
How the agent works?
It builds on Sourcegraph's existing Batch Changes engine and code search, including Deep Search. You describe the migration in plain language, for example "replace the deprecated call with the new one in all services." The agent then works in steps. First, it searches for all repositories the change affects and assesses how the edit will impact each one. Then it builds a plan. Typically it tries the approach on a single repository first and, once the method works, rolls it out to the rest.
What are the key details on The Mercari example?
Mercari used the agent in an experimental setup. Patrick Klitzke, the tech lead for Help Center, was searching the code for an environment-variable injection vulnerability in GitHub Actions. By his account, one query was enough to cover the Help Center frontend and backend. He then extended the search to all of the company's repositories and found about 80 potentially affected ones. The most telling part is how the agent handled the differences. Mercari's repositories are similar but not identical.
What are the key details on Limitations and what to do about them?
This is a public beta, and the company openly warns of rough edges. The product is designed for changes across many repositories at once. For a task in a single repository, Sourcegraph itself recommends a regular coding agent. The beta is available to Sourcegraph Cloud customers and usage is currently free. Support for the self-hosted version is promised for July 8, 2026, with the release of Sourcegraph 7.5.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.