# iFood's 15,000-Repo Agent Deployment: How to Scale Coding Agents Without Breaking CI/CD

> Source: <https://dev.to/mech_app_ai/ifoods-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking-cicd-109n>
> Published: 2026-11-25 10:08:13+00:00

**Recommendation:** Route agent work through a shared remote sandbox that opens merge requests with scoped tokens instead of pushing to trunk, and instrument every run so a bad suggestion is caught before it spreads across repos.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

iFood runs coding agents across 15,000 repositories. Not as a prototype. As production infrastructure that fixes vulnerabilities, validates code standards, and updates dependencies at scale. The challenge is not whether an agent can complete a single task. The challenge is building the plumbing so 25,000+ agent runs do not cascade into broken builds, permission sprawl, or untrackable regressions.

Their solution is the Remote Agents Platform, an internal service that turns engineering tasks into API calls. Teams delegate work, execution happens in a remote sandbox, and results return as merge requests. The security team doubled the number of vulnerabilities fixed after adopting it.

This is not a case study about prompt engineering. It is about the infrastructure decisions required to deploy agents at scale without breaking CI/CD.

A single repository task is trivial. Run a linter. Update a dependency. Fix a known CVE. The problem emerges when you multiply that task across thousands of repos, each with different CI configurations, access controls, and merge policies.

Before the platform, iFood teams built fragmented solutions. Each team solved the same orchestration problems independently. Each hit the same wall: no shared agentic runtime to handle sandboxing, state tracking, or result aggregation.

Victor Coelho, Senior Software Engineer at iFood, frames it clearly: "Solving this for one repository is easy. The challenge is solving it at scale."

The Remote Agents Platform abstracts agent execution into three layers:

This design decouples task submission from execution. The team requesting a security fix does not need to manage sandbox provisioning, credential rotation, or cleanup.

At 15,000 repos, manual ACL configuration per repository is not viable. The platform uses a service account model with scoped tokens:

This means agents never push directly to trunk. They open PRs. Human review gates remain intact.

Agent-generated PRs must not bypass existing CI checks. The platform integrates at two points:

This prevents a single bad agent suggestion from cascading. If an agent introduces a subtle bug in 10 repos, the observability layer flags it before it spreads to 200.

The platform has completed over 25,000 runs. Without instrumentation, debugging a failed run across 15,000 repos is impossible.

iFood instruments three signals:

This data feeds back into two loops:

Average inference cost per run is $0.04. At 25,000 runs, that is $1,000 in inference costs. Observability ensures that cost scales predictably as task volume grows.

The case study does not detail rollback mechanisms, but the architecture implies a critical gap. If an agent introduces a bug that only surfaces three days later in 200 repos, what is the rollback primitive?

Three options exist:

| Rollback Strategy | Pros | Cons | 
|---|---|---|
| **Revert commits** | Simple, uses existing git tooling | Requires tracking which commits came from which agent run | 
| **Feature flags** | Gradual rollout, easy to disable | Requires agents to wrap changes in flags (not always possible) | 
| **Snapshot-based** | Full repo state restore | Heavy, requires storage for every pre-agent state | 

The most likely approach: tag agent-generated commits with metadata (run ID, task type, timestamp) and build a revert tool that can batch-revert commits matching a specific pattern.

Without this, a cascading failure requires manual intervention across hundreds of repos.

The security team was the first to adopt the platform at scale. They use it to fix vulnerable dependencies and validate code against internal security standards.

Results:

This is the ideal agent use case: high-volume, low-ambiguity tasks where the cost of human time exceeds the cost of occasional agent errors.

The platform exposes a simple API for task submission. Here is a plausible interface based on the architecture described:

``` python
import requests

# Submit a task to fix a known CVE across all repos using a vulnerable package
response = requests.post(
    "https://agents.ifood.internal/v1/tasks",
    headers={"Authorization": f"Bearer {API_TOKEN}"},
    json={
        "task_type": "security.fix_cve",
        "parameters": {
            "cve_id": "CVE-2026-12345",
            "package": "lodash",
            "target_version": "4.17.21"
        },
        "scope": {
            "repositories": "all",  # or list of specific repos
            "filters": {
                "has_package": "lodash"
            }
        },
        "execution": {
            "timeout_minutes": 30,
            "sandbox_tier": "standard"
        }
    }
)

task_id = response.json()["task_id"]

# Poll for results
status = requests.get(
    f"https://agents.ifood.internal/v1/tasks/{task_id}",
    headers={"Authorization": f"Bearer {API_TOKEN}"}
)

# Results include PR URLs, failure reasons, and acceptance status
print(status.json()["results"])
```

This API hides the complexity of sandbox provisioning, credential management, and result aggregation. Teams submit tasks and receive merge requests.

| Decision | Benefit | Cost | 
|---|---|---|
| **Sandbox per run** | Isolation, no state leakage | Higher compute cost, slower startup | 
| **Service account tokens** | No manual ACL management | Requires token rotation infrastructure | 
| **PR-based results** | Preserves human review gates | Slower than direct commits | 
| **Asynchronous execution** | Developers do not block | Requires polling or webhook infrastructure | 

The platform prioritizes safety over speed. Agents do not push directly to trunk. They do not bypass CI. They do not share state across runs. This makes the system slower but far less likely to cause cascading failures.

**Use this approach when:**

**Avoid this approach when:**

The missing piece is the rollback primitive. Without a way to batch-revert agent changes, a single bad suggestion can require manual cleanup across hundreds of repos. Build that tool before you scale past 1,000 repos.
