Google just open-sourced the internal plugin its engineers use to stop AI coding agents from shipping bugs at scale. It’s called the Elephant-Goldfish Model (EGM), and the core idea is simple: no AI touches code until it has written and defended a design document.
The Problem It Solves
The EGM team put it plainly in their announcement: AI tools are great at increasing coding speed, but speed without guardrails means you auto-scale your mistakes. They called this a “potential reliability crisis” driven by session context collapse and what they termed slop: low-quality output generated fast.
How Elephant and Goldfish Work
The plugin runs two types of AI sessions with opposite properties.
The Elephant is a long-running session that holds the full project context: architecture, intent, and decision history. It never writes code. Its job is to interview the developer, argue over design choices, and maintain the record.
Each Goldfish is stateless. It starts with zero memory of the design conversation, which is the point. A reviewer that wasn’t in the room doesn’t carry the room’s blind spots.
Three Phases Before Any Code Runs
The plugin structures work into three commands:
- egm-brainstorm: Developer and Elephant debate options under a strict no-code rule. Assumptions get tested before anything is committed.
- egm-draft: They produce a Markdown design document covering the problem statement, technical plan, alternatives considered, and an implementation plan that names specific files to change.
- egm-review: Multiple Goldfish reviewers read the document cold. One has to explain the design back to the Elephant. If it gets the plan wrong, the document goes back for revision. Additional Goldfish act as hostile reviewers hunting edge cases, hidden dependencies, and logical gaps. A final Goldfish makes a go/no-go call on whether file paths, data structures, and function signatures are all present and unambiguous.
What It Does Not Cover
Security threat modeling is not built into the default reviewer list. Teams that want a security-focused review need to add it themselves. The good news is that reviewer personas and rules are customizable, so adding a security-minded Goldfish is possible.
Availability
The repository ships with Markdown rules, subagent persona definitions, and review workflows. It currently runs inside Google’s Antigravity development environment, with support for other environments described as coming. Google says thousands of Googlers use it daily to ship production code. It’s free on GitHub.
