{"slug": "ifood-s-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking", "title": "iFood's 15,000-Repo Agent Deployment: How to Scale Coding Agents Without Breaking CI/CD", "summary": "IFood built the Remote Agents Platform, an internal service that runs coding agents across 15,000 repositories, executing over 25,000 runs at roughly $0.04 in inference cost per run. The platform sandboxes agent execution, uses scoped service-account tokens so agents open merge requests rather than pushing to trunk, and integrates with existing CI checks and observability to prevent bad suggestions from cascading. \"Solving this for one repository is easy. The challenge is solving it at scale,\" said Victor Coelho, a senior software engineer at iFood, whose security team doubled the number of vulnerabilities fixed after adopting the platform.", "body_md": "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.\n\nTheir 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.\n\nThis is not a case study about prompt engineering. It is about the infrastructure decisions required to deploy agents at scale without breaking CI/CD.\n\nA 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.\n\nBefore 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.\n\nVictor Coelho, Senior Software Engineer at iFood, frames it clearly: \"Solving this for one repository is easy. The challenge is solving it at scale.\"\n\nThe Remote Agents Platform abstracts agent execution into three layers:\n\nThis design decouples task submission from execution. The team requesting a security fix does not need to manage sandbox provisioning, credential rotation, or cleanup.\n\nAt 15,000 repos, manual ACL configuration per repository is not viable. The platform uses a service account model with scoped tokens:\n\nThis means agents never push directly to trunk. They open PRs. Human review gates remain intact.\n\nAgent-generated PRs must not bypass existing CI checks. The platform integrates at two points:\n\nThis 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.\n\nThe platform has completed over 25,000 runs. Without instrumentation, debugging a failed run across 15,000 repos is impossible.\n\niFood instruments three signals:\n\nThis data feeds back into two loops:\n\nAverage 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.\n\nThe 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?\n\nThree options exist:\n\n| Rollback Strategy | Pros | Cons | \n|---|---|---|\n| **Revert commits** | Simple, uses existing git tooling | Requires tracking which commits came from which agent run | \n| **Feature flags** | Gradual rollout, easy to disable | Requires agents to wrap changes in flags (not always possible) | \n| **Snapshot-based** | Full repo state restore | Heavy, requires storage for every pre-agent state | \n\nThe 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.\n\nWithout this, a cascading failure requires manual intervention across hundreds of repos.\n\nThe 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.\n\nResults:\n\nThis is the ideal agent use case: high-volume, low-ambiguity tasks where the cost of human time exceeds the cost of occasional agent errors.\n\nThe platform exposes a simple API for task submission. Here is a plausible interface based on the architecture described:\n\n``` python\nimport requests\n\n# Submit a task to fix a known CVE across all repos using a vulnerable package\nresponse = requests.post(\n    \"https://agents.ifood.internal/v1/tasks\",\n    headers={\"Authorization\": f\"Bearer {API_TOKEN}\"},\n    json={\n        \"task_type\": \"security.fix_cve\",\n        \"parameters\": {\n            \"cve_id\": \"CVE-2026-12345\",\n            \"package\": \"lodash\",\n            \"target_version\": \"4.17.21\"\n        },\n        \"scope\": {\n            \"repositories\": \"all\",  # or list of specific repos\n            \"filters\": {\n                \"has_package\": \"lodash\"\n            }\n        },\n        \"execution\": {\n            \"timeout_minutes\": 30,\n            \"sandbox_tier\": \"standard\"\n        }\n    }\n)\n\ntask_id = response.json()[\"task_id\"]\n\n# Poll for results\nstatus = requests.get(\n    f\"https://agents.ifood.internal/v1/tasks/{task_id}\",\n    headers={\"Authorization\": f\"Bearer {API_TOKEN}\"}\n)\n\n# Results include PR URLs, failure reasons, and acceptance status\nprint(status.json()[\"results\"])\n```\n\nThis API hides the complexity of sandbox provisioning, credential management, and result aggregation. Teams submit tasks and receive merge requests.\n\n| Decision | Benefit | Cost | \n|---|---|---|\n| **Sandbox per run** | Isolation, no state leakage | Higher compute cost, slower startup | \n| **Service account tokens** | No manual ACL management | Requires token rotation infrastructure | \n| **PR-based results** | Preserves human review gates | Slower than direct commits | \n| **Asynchronous execution** | Developers do not block | Requires polling or webhook infrastructure | \n\nThe 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.\n\n**Use this approach when:**\n\n**Avoid this approach when:**\n\nThe 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.", "url": "https://wpnews.pro/news/ifood-s-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking", "canonical_source": "https://dev.to/mech_app_ai/ifoods-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking-cicd-109n", "published_at": "2026-11-25 10:08:13+00:00", "updated_at": "2026-11-25 10:12:48.459607+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "mlops", "ai-infrastructure"], "entities": ["iFood", "Victor Coelho", "Remote Agents Platform"], "also_reported_by": [], "takeaway": "Running coding agents across 15,000 repos at about $0.04 per inference run requires a shared remote-sandbox runtime with scoped service-account tokens, agent PRs gated by existing CI, and per-run instrumentation rather than per-team orchestration.", "recommendation": {"advice": "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.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/ifood-s-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking", "markdown": "https://wpnews.pro/news/ifood-s-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking.md", "text": "https://wpnews.pro/news/ifood-s-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking.txt", "jsonld": "https://wpnews.pro/news/ifood-s-15000-repo-agent-deployment-how-to-scale-coding-agents-without-breaking.jsonld"}}