November 9, 2026

Before an AI Agent Writes Your Code

When an AI coding agent builds the wrong thing, the code itself is often clean. The mistake happened earlier, in an assumption nobody wrote down or checked.

Google has open-sourced a plugin built around that problem. The Elephant-Goldfish Model (EGM) has a coding agent write a design document first, then hands that document to fresh AI reviewers that never saw the conversation behind it. Google says thousands of its engineers use it daily on production code. Version 0.1.1 shipped on November 6, and MarkTechPost reviewed it on November 8.

If you build custom business software with AI, the idea is worth understanding even if you never install the plugin.

Plan first, then let fresh reviewers attack the plan

The Elephant is one long working session. It holds your project context and earlier decisions, asks you questions, weighs trade-offs with you and drafts the spec. It writes no code.

Each Goldfish is a separate subagent that starts empty. It reads only the draft and the files the draft points to, and its job is to find missing assumptions, unclear requirements and implementation risks.

The review runs in five stages. In one of them, a reviewer has to explain the design back in its own words. If that explanation is wrong, the document is ambiguous. The last stage checks that file paths, data structures and function signatures are actually spelled out. Findings are ranked Blocker, Major or Nit, and you approve the design before anything gets built.

Later, a drift report compares the code with the spec. The project suggests running it weekly.

Why a reviewer with no memory is useful

A long AI session gets attached to its own reasoning. If it misread a requirement early, every later answer builds on that reading. Asking that session to review its own plan rarely helps, because it shares the same blind spots.

EGM is strict about this. If your tool cannot start fresh subagents, the review stops instead of quietly running in the same context.

Others are pointing at the same gap. Entire, the new Git platform led by former GitHub CEO Thomas Dohmke, argues that pull request history has turned into a log only the agent reads. Its answer is scored reviews on every push and a memory layer kept with the repository, so the reasons behind a change are not lost.

In business software, the spec is where the rules live

In ERP and custom software work, the costly mistakes tend to start in requirements, not in code.

Think of a discount rule, a stock reservation or an approval limit. If an agent assumes reserved stock counts as available, the code can pass every test you wrote and still oversell. A reviewer asking what happens to reserved stock is much cheaper than a customer finding out.

Be clear about what EGM is and is not. There is no published accuracy benchmark; the evidence is Google’s internal use and test runs. Reviews use a lot of tokens from your own model plan. One open issue reports a project instruction file leaking into Codex reviewers, which weakens the fresh-context idea. The README says it is not an officially supported Google product, and the first tagged release says it is not ready for stable-release claims. The project itself says a review does not replace tests or human judgment.

Practical takeaways

The useful idea is simple: check the plan before the code, and have it checked by someone who was not part of writing it.

  • Ask your agent for a short design document before it codes anything that touches money, stock or customers.
  • Write the business rules and edge cases in plain language inside that document.
  • Have a fresh session or a colleague explain the plan back to you. If they get it wrong, fix the document.
  • Compare the finished code with the spec, not only with the tests.
  • Keep an eye on token cost and save this for changes where a mistake is expensive.

When your last AI-built feature went wrong, was the problem in the code or in the plan?

Sources

← Back to field notes