Agentic Batch Changes
Agentic Batch Changes lets you describe a change in plain language: then, the agent scopes it, applies it across every repo, and tracks it through to merge.
Agentic Batch Changes is currently a Beta feature. The Beta is currently only available upon request: schedule a demo or reach out to your account manager to get started.
Agentic Batch Changes is built on top of Batch Changes, our precision tool for applying code changes at scale. Paired with Deep Search, our code understanding agent, these two tools form the foundation of an agent harness specialized for operating across your entire codebase: from thousands of repositories, to the largest monorepos.
Getting started
Agentic Batch Changes is currently a Beta feature. The Beta is currently only available upon request: schedule a demo or reach out to your account manager to get started.
Once Agentic Batch Changes is enabled, you can find it in the Sourcegraph navigation bar.
Setup
Before creating an Agentic Batch Change, make sure your Sourcegraph instance can access the repositories and publish changes back to your code host:
- Configure code host connections for the repositories you want the agent to search and modify.
- Configure Batch Changes credentials for each code host where the agent should publish pull requests or merge requests.
- Deploy Sourcegraph executors so Agentic Batch Changes can run code-modification jobs in isolated workspaces. Executors are available with no additional setup on Sourcegraph Cloud.
Prompting
Each Agentic Batch Change starts with a prompt. Like any agent, specificity and a clear success criteria can dramatically improve results. The agent works particularly well with detailed migration plans, which you can upload for the agent to consume. However, you can also start with some fairly simple requests to see how the agent responds:
- "Generate documentation for these repositories to describe the purpose of the repository."
- "Generate
AGENTS.mdguidance for these repositories to help coding agents." - "Identify usage of primitive wrapper constructors in Java projects, like
new Boolean(true), and replace them with the recommended.valueOf()factory methodBoolean.valueOf(true)." - "In our Go 1.16+ code, remove
ioutilimports, replacing them with the appropriate modern methods in packages likeioandos." - "Find repositories affected by CVE-2025-55182. Prioritize repositories that have execution paths to vulnerable code. If the application’s React code does not use a server, it is not affected by this vulnerability. If the app does not use a framework, bundler, or bundler plugin that supports React Server Components, the app is not affected by this vulnerability."
We recommend encoding guidance that works for your organization via agent customization.
Capabilities
Customization
Most organizations will also have specific conventions, technologies, and preferences. The agent may discover some of these conventions in its research, but you can also improve performance by customizing the agent with skills and AGENTS.md-style guidance, available on a per-user, per-organization, or global level in settings:
- User settings → Batch Changes → Agent
- Administration → Batch Changes → Agent
Changeset hooks
Agentic Batch Changes introduces a new batch changes concept, "changeset hooks". These allow programmable responses to events like CI failures and merge conflicts. For example:
- When CI fails, the agent can prepare a script to fetch CI logs for you. This data can be used to amend the agent's plan, or even be handed off to a coding agent to fix immediately.
- When a merge conflict is encountered, the agent can ask a coding agent to address it.
To get set up, just ask the agent for it in your agentic batch change. We recommend encoding processes that work for your organization via agent customization.
Coding agent steps
The coding agent step is a new native step type for Agentic Batch Changes that allows the agent to delegate non-deterministic or context-dependent changes for another coding agent to handle. Coding agent steps are automatically pre-configured with the Sourcegraph MCP.
We currently support Claude Code and Codex as native coding agent steps.
Note that Agentic Batch Changes does not use coding agent steps for every task. For deterministic changes, the agent will opt to write a script - or even an entire program - to efficiently apply some, or all, of the target changes.
Building images for steps
Just like any agent, Agentic Batch Changes and its coding agents benefits from having tools tailored for specific tasks. To support this, the agent can build a tailor-made image with all the tools it needs for a specific specific task that it can re-use across an agentic batch change. Custom-built images are hosted directly in Sourcegraph.
If you prefer, you can guide the agent the an image of your choice instead, or encourage the agent to build on top of particular images. We recommend encoding processes that work for your organization via agent customization.
Note that the agent's image-building capability is only available in Sourcegraph Cloud by default.
Batch Changes capabilities
All batch changes capabilities are available to the agent.
For example, the agent can write conditional steps, template changeset titles and descriptions, and split changes in one repository into multiple changesets.
Administration options like rollout windows and commit signing also carry over. See Administration for details.
Administration
Most Batch Changes configuration options, such as rollout windows and commit signing, still apply in Agentic Batch Changes unless otherwise noted. To learn more, refer to Batch Changes configuration.
Access control
Access to Agentic Batch Changes can be managed through role-based access control. Users will need both of:
- Batch Changes permissions
Batch Changes: ReadorBatch Changes: Write - Agentic Batch Changes permissions
Batch Changes: Agent ReadorBatch Changes: Agent Write
Entitlements
Entitlements are currently only available for coding agent steps.
Security
Agentic Batch Changes uses the same security model as Batch Changes, with additional safeguards for agent-generated work:
- Repository permissions are enforced when users view, create, update, or publish changes, so users can only act on repositories they are allowed to access.
- Batch Changes credentials control which code host identity publishes pull requests or merge requests.
- Code host protections, including CI checks, branch protections, and review requirements, continue to apply to pull requests or merge requests created by Agentic Batch Changes.
- Executors run code-modification jobs in isolated workspaces. Executors do not access code host credentials directly.
- Executor secrets are scoped by user, organization, or globally, and are redacted in logs. Agentic Batch Changes will ask you for approval on any agent-generated actions that reference your secrets before those actions run.