AIARTICLE

6 min read

How iFood scales code agents across 15,000 repositories with an internal API

How iFood scales code agents across 15,000 repositories with an internal API
Image: Alan Andrade
Article · AI
Reading
6 min
Tables
1
In short

The Brazilian company built an internal platform that turns engineering tasks into API calls, runs agents in an isolated sandbox and returns the result as a merge request. The case, published by OpenAI on November 24, 2026, shows what changes when code automation needs to work across thousands of repositories at the same time.

The bottleneck wasn't the task, it was execution at scale

iFood, Brazil's dominant food delivery platform, maintains more than 15,000 code repositories. Each one periodically needs one-off tasks: validating whether the code follows internal standards, fixing vulnerable dependencies, running a performance analysis. None of these tasks is difficult in isolation.

The problem appears when they multiply by 15,000. That's what Victor Coelho, senior software engineer at iFood, describes in a case study published by OpenAI on November 24, 2026.

Solving this for one repository is easy. The challenge is solving it at scale.

Victor Coelho, Senior Software Engineer, iFood

Before the platform, each team at iFood solved the problem its own way, and all of them ran into the same obstacle: what was missing was a shared agentic runtime, not intelligence or use cases. The answer was an internal project called Remote Agents Platform.

How it works under the hood: API, sandbox and merge request

The platform works as an API that triggers a remote agentic coding task. The flow has three steps: the team submits a prompt and environment requirements via a REST call; the platform processes the task on a dedicated remote runner, inside an isolated sandbox; the result becomes available later, asynchronously.

Internally, the runner alternates between two types of steps, and this combination is what makes the flow predictable end to end:

  • Deterministic steps at the beginning and end: cloning the repository, importing the skills the agent can use, preparing the working branch and, at the end, publishing the merge request and making the generated artifacts available.
  • Agentic execution in the middle of the flow: the actual work, running inside the sandbox with the GPT-5.6 Luna model.

The sandbox runs Ubuntu and already comes with the toolchains that iFood's ecosystem requires: Python, Java, Kotlin, C#, TypeScript, Rust, JavaScript and Go. Beyond the sandbox, the agent accesses Nexus, GitLab, Docker, Snyk, Kubernetes and AWS, which allows the task to go from code analysis to dependency fixing without leaving the flow.

Why GPT-5.6 Luna, and why cost per execution matters

The choice of model wasn't based on a single criterion. According to Coelho, among models from the same checkpoint, internal benchmarks showed a better balance of intelligence, efficiency and execution speed in GPT-5.6 Luna.

We chose GPT‑5.6 Luna because, among models at the same checkpoint, the benchmarks showed it offered a great balance of intelligence, efficiency, and execution speed—how quickly it could complete tasks. Those three qualities together led us to choose GPT‑5.6 Luna.

Victor Coelho, Senior Software Engineer, iFood

This balance matters more in a platform designed to scale than in a one-off use case. With tens of thousands of tokens consumed per execution, the average cost of US$0.04 per run stops being a detail and becomes an architecture decision: the platform has already completed more than 25,000 runs, consuming more than 27 billion tokens.

It's worth noting that the case study is published by OpenAI itself as marketing material, and doesn't include comparisons with other models or detailed benchmark methodology: what exists are the iFood team's statements about the choice, without competitor numbers for contrast.

How to know if the agent completed the task

Delegating execution at scale creates a new problem: how to automatically confirm that the agent did what it was supposed to. iFood's answer came in the post-session step, processing the result with OpenAI's Structured Outputs, which forces the output to follow a predefined contract.

We process the result using Structured Outputs, which ensures the response follows a predefined contract. From the agent's session, we can identify the outputs within the response structure we expect. This helps reduce uncertainty and ensures we can always get a response from the agent's session, whether positive or negative.

Victor Coelho, Senior Software Engineer, iFood

In practice, this takes away from the human team the task of manually inspecting each run to know if it worked. The output contract is what decides that, which only works because the schema was carefully defined before running at volume.

The first real user: the security platform

The platform already powers an internal security product at iFood, which scans the 15,000 repositories for vulnerable dependencies and tries to fix them on its own. After migrating to the Remote Agents Platform, the accuracy of these fixes more than doubled, and the number of vulnerabilities fixed also more than doubled.

The central point of this use case isn't security itself, it's the adoption model: the security team didn't need to build its own agentic runtime or become an expert in agent orchestration. It needed to call an API.

Before the platformAfter the platform
Fragmented solutions by teamShared agentic runtime via API
Each team rebuilt executionTeams delegate execution, focus on the business problem
Lower fix accuracyFix accuracy more than doubled

What changes for developers: time without monitoring

The gain that iFood's team highlights isn't execution speed, it's what asynchronous execution frees up. Since the task runs without supervision, the developer doesn't need to keep an eye on it.

While they're in a meeting, they can launch a code fix, a performance analysis, or another task that's a little more routine—something they can delegate without having to monitor it at that moment.

Victor Coelho, Senior Software Engineer, iFood

This is the model's real trade-off: the gain isn't finishing faster under supervision, it's not needing to supervise at all. Routine work stops competing for attention with what requires human judgment, but this only works if the output contract (Structured Outputs) is reliable enough for the team to trust the absence.

Inspired by OpenAI's own APIs

The Remote Agents Platform was designed as an internal layer mirroring how OpenAI itself exposes this kind of task to external clients, with direct inspiration from the Batch API and the Agents API.

In short: the inspiration went beyond the concept. According to Coelho, it extended to interface design, resource organization and the approach to asynchronous execution with results retrieved later, meaning iFood built internally something that resembles OpenAI's own products, only closed within their own ecosystem.

What remains open

The material released doesn't detail how the platform handles security flaws introduced by the agent itself, nor what human review exists before the merge request actually becomes a merge. There is also no cost comparison with alternatives (running a local open-weight model, for example), nor the cost of building and maintaining the runtime itself, only the cost per model execution.

For those building something similar in Brazil, the most replicable takeaway isn't the chosen model, it's the separation between deterministic steps and agentic execution within the same pipeline, and the use of Structured Outputs as a success/failure contract instead of manual inspection. This is architecture, not hype, and it works with any model provider that supports structured output.

Translated from the Brazilian Portuguese original · Read the original

View profile →