iFood Manages 15,000 Repositories with Coding Agents: An Architectural Lesson at 4 Cents per Run

iFood packages coding agents as an internal API, supporting 15,000 repositories at just 4 cents per run.
iFood built an internal system called the Remote Agents Platform that abstracts coding agents into a REST API, supporting automated tasks across 15,000 repositories—completing over 25,000 runs and consuming more than 27 billion tokens, at an average cost of only $0.04 per run. The real bottleneck isn't model intelligence but execution infrastructure: the platform sandwiches agent execution between deterministic steps, delegating middle tasks to GPT-5.6 Luna in sandboxes, choosing models by balancing intelligence, efficiency, and speed, and using Structured Outputs to automatically determine success or failure. The first major user, the security team, more than doubled fix accuracy and vulnerability resolution, while async execution freed developer attention.
iFood Manages 15,000 Repositories with Coding Agents: An Architectural Lesson at 4 Cents per Run
While most teams are still tuning prompts for an AI coding assistant tied to a single repository, Latin American delivery giant iFood has turned coding agents into company-wide infrastructure—driving automated tasks across 15,000 code repositories through an internal REST API, with an average inference cost of just $0.04 per run, and a cumulative total of more than 25,000 tasks completed and over 27 billion tokens consumed.
According to Victor Coelho, a senior software engineer at iFood, this system—called the Remote Agents Platform—abstracts engineering tasks into API calls: teams submit prompts and environment requirements, execution happens in remote isolated sandboxes, and results come back as merge requests. What's truly worth paying attention to isn't the model itself, but the engineering architecture choices behind it.
The Real Bottleneck Isn't the Task—It's the Execution Infrastructure
iFood maintains more than 15,000 code repositories, and each one needs certain tasks performed periodically: verifying that code conforms to internal standards, fixing vulnerable dependencies, running code analysis. Individually, none of these is hard; the hard part is multiplying them by fifteen thousand.
Coelho puts it plainly: "Solving this problem for one repository is easy; the challenge is solving it at scale." Before the platform existed, teams improvised their own approaches but all hit the same wall—what they lacked wasn't intelligence or use cases, but a runtime layer purpose-built for executing agent tasks.
This insight deserves serious attention from every technical leader pushing AI into engineering workflows: when multiple teams each build their own agent execution environments, what's wasted isn't model API fees, but duplicated infrastructure and fragmented engineering experience. iFood's solution was to converge execution capability into a single internal API, letting business teams focus on their own problem domains while outsourcing execution to the platform.
Agent runtime refers to the external environment layer that hosts AI agent execution, typically including isolated sandboxes, toolchains and credential injection, filesystem and network access control, lifecycle management, and log tracing. It is distinct from the model itself: the model handles only reasoning and decisions, while the runtime is responsible for letting those decisions safely act on real code and systems. A mature runtime needs to solve resource isolation (avoiding one run contaminating the host machine), environment consistency (pre-installed languages and dependencies), least privilege (exposing only the necessary repositories and cloud services), and observability (recording each step for auditing). Without this layer, every team has to assemble its own containers, secrets, and CI configuration—duplicating effort and making unified security policies difficult.
Workflows Where Deterministic Steps Interleave with Agent Execution
The entry point to the Remote Agents Platform is a simple REST API. Users create run tasks through it, the platform manages the entire lifecycle internally and delegates execution to isolated sandboxes, and task progress can be monitored in real time.
The more elegant design lies in the workflow orchestration inside the executor: deterministic steps "sandwich" the agent execution at both ends. At the start comes cloning the repository, importing the skills available to the agent, and creating a working branch; at the end comes publishing the merge request and making the generated artifacts available. Wedged in between is the actual agent execution—running GPT‑5.6 Luna inside the sandbox.
Coelho summarizes it as "a combination of deterministic steps and agent execution within the workflow." The sandbox runs Ubuntu with the toolchains pre-installed for the iFood ecosystem, covering Python, Java, Kotlin, C#, TypeScript, Rust, JavaScript, and Go, plus general-purpose tools. Beyond the sandbox, the agent can also access Nexus, GitLab, Docker, Snyk, Kubernetes, and AWS.
This "deterministic at both ends, intelligent in the middle" structure is essentially an engineering means of constraining the model's uncertainty—leaving cloning and publishing, the parts the model shouldn't worry about, to code, and reserving judgment and modification for the model.
Model Selection Is a Three-Way Tradeoff, Not a Single-Event Champion
When iFood chose GPT‑5.6 Luna, it weighed three factors simultaneously. Coelho says that among models at the same checkpoint, benchmarks showed it struck a good balance among intelligence, efficiency, and execution speed (i.e., how quickly it completes tasks), and "the combination of these three traits is what led us to choose it."
This balance matters far more for a platform at scale than for a one-off use case. When the platform consumes tens or hundreds of thousands of tokens, the $0.04 average cost per run is no longer a trivial detail but an architectural consideration. Coelho adds that, given the platform's plans to scale to multiple use cases within iFood, the balance between efficiency and intelligence "ensures we can scale sustainably."
The lesson for enterprises: evaluate intelligence, cost, and speed together when selecting a model, rather than fixating on a single benchmark leaderboard. The larger the scale, the harder this triangle is to reconcile—and the more worthwhile it is to think it through in advance.
The relationship between inference cost and token consumption deserves separate explanation: LLMs bill by input and output tokens, and a single agent task often requires multiple rounds of tool calls and code reads/writes, accumulating tens of thousands of tokens or more. So the cost per run is determined by "price per token × total tokens," and model efficiency (completing tasks with fewer tokens) matters as much as unit price. At the scale of 15,000 repositories, even a few cents per run multiplied by task frequency and repository count produces considerable monthly spend; conversely, choosing a cheaper model that needs more rounds of correction can end up raising total cost. This is why platforms at scale focus on cost per task rather than price per token.
Using Structured Output to Put a "Contract" on Agent Results
Delegating execution at scale introduces a new problem: how do you automatically determine whether the agent has completed the task?
iFood's answer comes after execution: results are processed through OpenAI's Structured Outputs, requiring the output to conform to a predefined contract. Coelho explains that the expected outputs in the response structure can be identified from the agent session, which helps reduce uncertainty and ensures that, whether the result is positive or negative, you always get a structured response from the session.
This step may seem unremarkable, but it's the precondition for the entire platform to scale. Without structured responses, at the scale of 15,000 repositories it would be impossible to automatically determine whether the agent achieved its goal—human review would instantly zero out the benefits of scale. Requiring outputs to follow a contract is equivalent to installing a programmable "acceptance switch" on every agent execution.
Structured Outputs is an API capability offered by OpenAI that requires the model to generate responses strictly according to the JSON Schema provided by the caller, ensuring that output fields, types, and nested structures can be parsed directly by programs. Unlike the traditional approach of "prompting the model to output JSON," it uses constrained decoding to exclude schema-nonconforming candidates at the token generation stage, so there are no missing fields, type errors, or extra explanatory text. For an agent platform, this means the same parser can handle all run results and turn "whether the task is complete" into a boolean judgment on structured fields—no natural language understanding or manual spot checks required. The tradeoff is that the schema must be designed in advance and is relatively fixed, making it slightly less flexible than free text.
The First Big User Was the Security Team—Fix Accuracy More Than Doubled
The platform's first major use case was iFood's internal security product: scanning all 15,000 repositories for vulnerable dependencies and attempting fixes. The effect of the migration was direct and significant—Coelho says that with the platform, the accuracy of these fix changes more than doubled, and the number of vulnerabilities fixed also more than doubled.
This use case perfectly illustrates the platform's positioning: the security team doesn't need to build its own agent runtime, nor become an expert in agent orchestration—it just needs to call an API.
Asynchronous execution is another layer of value that is easily underestimated. Because tasks are delegated and run unattended, developers don't have to watch the progress bar. Coelho describes kicking off a code-fix or performance-analysis task while in a meeting; these routine tasks no longer compete for the team's attention, and the time saved is reserved for problems that require judgment. He emphasizes that the productivity release comes not from doing things faster while watching, but from not having to monitor in real time.
Inspired by the OpenAI API, but Internalized as Enterprise Infrastructure
The Remote Agents Platform borrows heavily in its design from the way OpenAI exposes such capabilities externally. Coelho mentions that the platform drew a lot of inspiration from OpenAI's Batch API and the newer Agents API, building a similar but internalized product. This borrowing goes beyond concepts into interface design, resource organization, and the handling pattern of asynchronous execution with results retrieved later.
From the results OpenAI has published, the platform has completed more than 25,000 tasks, consumed over 27 billion tokens, at an average cost of $0.04 per run, covering all 15,000 repositories, with every run using GPT‑5.6 Luna.
This also yields a reusable adoption checklist: expose agent capabilities through an internal API to prevent other teams from reinventing the wheel; isolate each run in a sandbox with the ecosystem toolchain pre-installed; choose models by weighing intelligence, cost, and speed; use structured output to automatically distinguish success from failure; and start with an internal user that has a clear pain point and high call volume—iFood chose the security platform.
For technical managers, perhaps the most counterintuitive conclusion from the iFood case is this: the decisive factor for an agent platform isn't model IQ, but the "unsexy" engineering decisions around runtime, contracts, and cost models.
The Batch API and asynchronous agent pattern is centered on the idea of submitting a time-consuming task and immediately returning a handle, with the caller later polling or receiving a callback for the result—escaping the timeout limits of synchronous requests. OpenAI's Batch API processes large batches of requests at a discount over a longer time window, while the Agents API further encapsulates tool calls, multi-step execution, and state management into objects that can run asynchronously. When enterprise internal platforms borrow this pattern, they typically need to build their own task queues, state storage, and result archiving, and embed authentication, quotas, and auditing—so the platform has both the interface shape of a cloud service and compliance with enterprise internal security and network boundaries.
One-line Summary
iFood packages coding agents as an internal API, supporting 15,000 repositories at just 4 cents per run.
Paragraph Summary
iFood built an internal system called the Remote Agents Platform that abstracts coding agents into a REST API, supporting automated tasks across 15,000 code repositories—completing over 25,000 runs and consuming more than 27 billion tokens, at an average cost of only $0.04 per run. The article points out that the real bottleneck isn't model intelligence but execution infrastructure: the platform sandwiches agent execution between deterministic steps, with repository cloning and merge request publishing handled by code, and the middle tasks delegated to GPT-5.6 Luna inside sandboxes. Model selection balances intelligence, efficiency, and speed, and Structured Outputs enforce structured responses to automatically determine success or failure. The first major user was the security team, whose fix accuracy and number of resolved vulnerabilities both more than doubled; asynchronous execution also freed developers' attention.
Related articles

Java4Shell Vulnerability Analysis: Has Java's Memory Safety Myth Been Shattered?
Computerphile breaks down the Java4Shell vulnerability: OpenJDK's native Base64 decoder mishandles AVX-512 mask calculation, causing out-of-bounds writes and RCE. Covers root cause, Base64 padding mechanics, AI-assisted discovery debate, and fixes.

Controversial US Surveillance Law Section 702 Nears Expiration: Congress Races to Renew
FISA Section 702 surveillance authority is nearing expiration. Congress is urgently pushing reauthorization, possibly attaching it to the NDAA. This article analyzes the controversies, legislative strategy, and future outlook.

The No-Space Vacuum: The Mystery of Geometric Origins in Quantum Gravity
The "no-space vacuum" in group field theory refers to a state with no geometric quantum excitations—not empty space, but no space. This article explains how this quantum gravity concept yields macroscopic cosmic geometry through condensed matter mechanisms, along with the theory's current status and controversies.