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.

The Core Problem: Task Multiplication

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."

Architecture: API-Driven Agent Execution

The Remote Agents Platform abstracts agent execution into three layers:

  1. API surface: Teams submit tasks via API. No direct repo access required.
  2. Sandbox runtime: Agents execute in isolated environments. Each run gets a fresh clone, ephemeral credentials, and a time-boxed execution window.
  3. Result pipeline: Completed work surfaces as merge requests with full audit trails.

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

Permission Boundaries

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

  • Each agent run receives a short-lived token tied to a specific repository and task type.
  • Tokens expire after task completion or timeout (whichever comes first).
  • Write access is gated at the merge request level, not at the git push level.

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

CI Integration Points

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

  1. Pre-merge validation: Agent PRs trigger the same CI pipelines as human-authored PRs. If tests fail, the PR is marked for human review.
  2. Post-merge observability: A separate tracking layer monitors merged agent changes for regressions. If a pattern of failures emerges, the platform can pause similar tasks across other repos.

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.

Observability: Tracking 25,000+ Runs

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

iFood instruments three signals:

  • Acceptance rate: Which repos merge agent PRs vs. close them without merging.
  • Task completion time: How long agents take to complete tasks, broken down by task type and repo complexity.
  • Failure modes: Why tasks fail (timeout, test failure, merge conflict, permission error).

This data feeds back into two loops:

  1. Prompt refinement: If agents consistently fail on a specific task type, the prompt or tool configuration is adjusted.
  2. Model selection: iFood uses GPT-5.6 Luna for agent execution. Observability data informs whether a lighter model could handle simpler tasks at lower cost.

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.

Rollback Primitive: The Missing Piece

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.

Security Platform: First Major User

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:

  • 2x increase in vulnerabilities fixed.
  • Asynchronous execution means developers do not wait for security scans to complete.
  • Agents handle the tedious work (updating dependency versions, running validation), while humans review the final PR.

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.

Code Snippet: Task Submission API

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

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.

Trade-Offs at Scale

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.

Technical Verdict

Use this approach when:

  • You have hundreds or thousands of repositories with repetitive tasks.
  • Human review gates must remain intact (regulated industries, high-stakes code).
  • You can afford the infrastructure cost of sandboxing and observability.
  • Tasks are well-defined and low-ambiguity (dependency updates, linting, known CVE fixes).

Avoid this approach when:

  • You have fewer than 50 repositories (manual execution is cheaper).
  • Tasks require deep context or ambiguous decision-making (agents will fail often).
  • You cannot instrument observability (you will not know why agents fail or succeed).
  • You need real-time execution (asynchronous design adds latency).

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.

Source Links