Uber Fences In Its Code-Cleaning AI Agents

Uber’s AutoClean limits what each repair agent may touch and runs every change past a panel of reviewers before engineers see it.

The most interesting design choice in Uber’s AutoClean is not what its agents can do but what they are barred from doing. When a cleanup change breaks a build or a test, the failure goes to a fixer with a narrow remit. A test fixer, for example, may edit test files but not production code. Uber says the rule exists so an agent cannot turn a red test green by quietly changing the behavior that test was written to protect.
That guardrail sits inside a system that, according to InfoQ, has removed more than 16,000 stale feature flags and over 1 million lines of code from Uber’s monorepos. AutoClean combines AI agents, deterministic code transformations, continuous integration (CI) and independent validation, and passes finished changes to people for review.
The problem being cleaned up
Flags let teams ship functionality in stages or pull it back fast. When a rollout wraps up, the surrounding conditional branches, configuration fields, function parameters and tests frequently remain. Uber says this leftover code complicates maintenance and testing, and it also grows the amount of code AI agents have to read when working on related tasks.
From flag to finished change
AutoClean starts by querying Uber’s feature flag management system for flags judged safe to remove. A cleanup agent then explores and edits the code, using the Model Context Protocol to call PolyglotPiranha, Uber’s structural code transformation engine.
The agent replaces each flag with its permanent value and traces that value through callers, parameters and conditionals. PolyglotPiranha, not the language model, handles the boolean and conditional simplification, so rewrites that could change behavior do not rest on the model alone. InfoQ’s reading is that static tools are strong at deterministic rewrites, while AI earns its place on decisions about how a value propagates.
The change then enters CI. On failures, AutoClean tries deterministic repairs first and agent-based ones after. The loop of repair and CI repeats until the change passes or reaches its attempt limit. Uber calls CI the source of truth.
Four reviewers, one veto
Green CI does not end the process. AutoClean runs static checks and then CodeCourt, an agentic validation layer. Its reviewers each examine one property alone: no additions, semantic preservation, no intent drift, and no leftover agent artifacts.
A single failed check means the change is dropped. Only those that clear everything reach the team that owns the code.
Two software engineers commented in a LinkedIn discussion that InfoQ cites. Muhammad Ali Akbar wrote that the CI-as-source-of-truth approach “is what sold me.” Deepanshu Udhwani highlighted the difference between passing tests and staying inside a cleanup’s intended scope: “No intent drift is a different check than no regression.”
Uber says a human reviewer still decides whether a flag is truly ready to go. AutoClean automates investigation, rewriting, repair and validation, while that final judgment stays with the owning team.
Source: InfoQ
Morning to night, Reporting Team files on the machines and code changing daily life. We retell another publication's findings ourselves, always naming that publication and hyperlinking the original article.
Responses
One briefing. Every morning. Free.
Start the day with Circuit Courier: the essential AI & tech stories in one email.