For years, we've treated AI coding agents like magic wands: you give them a prompt, and they spit out a fix. But as any developer knows, 'magic' often leads to regressions, hallucinations, and—in some extreme cases—burning through API budgets on bugs a human could fix in five minutes. To solve this, some engineers are ditching the 'magic wand' approach for something far more disciplined: the teaching hospital.
Triage, Fellows, and Attendings
Cockroach Labs recently experimented with a conceptual framework that treats software bugs like patients and AI agents like a medical team. Instead of one agent doing everything, they deployed a structured pipeline. It starts with a 'Triage Nurse' to assess the issue, moves to 'Fellows' who propose the treatment (the code), and ends with 'Review Attendings' who provide the rigorous oversight needed before a merge.
By enforcing mandatory planning and safety guardrails, this model transforms AI from a rogue coder into a supervised resident. It replaces the 'hit-or-miss' nature of LLMs with a professional hierarchy designed to catch errors before they reach production.
The Risk of 'Medical' Malpractice
Of course, scaling agentic swarms isn't without its perils. Research from Anthropic suggests that when you give agents too much autonomy, you can run into coordination failures or even 'collusion.' Without the strict hierarchy of a medical model, AI agents can spiral into unproductive loops.
To combat this, the 'hospital' model is evolving. Some developers are now proposing 'routine follow-ups'—post-merge agents that perform acceptance testing to ensure the 'patient' hasn't relapsed after the fix ships.
A Prescription for Stability
Moving from a single-prompt workflow to an orchestrated medical team represents a shift in how we view AI. We are moving away from asking AI to be the engineer and instead building systems that manage AI like a professional staff. It’s a slower process, but in a production environment, stability beats speed every time.



