DEV Community

Cover image for Google Agent Smith Writes 25% of Google's Code: What API Teams Should Know
Wanda
Wanda

Posted on • Originally published at apidog.com

Google Agent Smith Writes 25% of Google's Code: What API Teams Should Know

TL;DR

Google’s internal AI coding agent, Agent Smith, now generates over 25% of the company’s new production code. Unlike autocomplete tools like Copilot, Agent Smith works asynchronously in the background, writing, testing, and iterating on code without human interaction. For API teams, this raises questions about contract stability, test coverage, documentation drift, and review workflows when a quarter of your codebase is machine-generated.

Try Apidog today

Introduction

During a March 2026 earnings call, Google CEO Sundar Pichai announced that AI-generated code now accounts for more than 25% of new code produced at Google.

This isn’t autocomplete. This isn’t Copilot suggestions accepted by developers. This is code that ships to production after AI generation. The tool, Agent Smith, is so popular among Google’s 180,000+ employees that the company had to throttle access to manage infrastructure strain.

Agent Smith is fundamentally different from today’s AI coding tools. While Copilot and Claude Code assist in real time, Agent Smith works in the background. Engineers assign tasks, step away, and return to review completed work.

For API development teams, this shift from “AI-assisted” to “AI-generated” code introduces practical challenges. When 25% of your codebase is written by an autonomous agent, how do you keep API contracts stable? How do you ensure tests cover machine-generated endpoints? How do you prevent documentation drift?

💡 Apidog’s integrated API lifecycle platform keeps design, tests, mocks, and documentation in sync regardless of whether a human or an AI agent makes the change. Try Apidog free to build API workflows that are agent-proof.

This article breaks down what Agent Smith does, how it differs from other AI coding tools, and what API teams should do to prepare.

What Agent Smith Does

Asynchronous Autonomous Coding

Agent Smith operates asynchronously. Here’s the workflow:

  1. An engineer describes a task in natural language
  2. Agent Smith breaks the task into subtasks
  3. It writes code across multiple files
  4. It runs tests and iterates on failures
  5. The engineer reviews the completed work

This differs from Copilot’s inline suggestions or Claude Code’s interactive sessions. Agent Smith acts like a junior developer who takes a ticket, returns later with a pull request.

Engineers can delegate tasks and check progress via Google’s internal chat platform, even from mobile. The tool accesses employee profiles and relevant documentation automatically for context.

Built on Gemini and Antigravity

Agent Smith is powered by Google’s Gemini model family and enhanced with retrieval systems for internal code and documentation. It’s built on Antigravity, Google’s agentic coding platform, and extends it with autonomous task decomposition and execution.

The retrieval augmentation ensures Agent Smith generates context-aware, production-quality code by referencing existing implementations and adhering to internal conventions.

What “25% of New Code” Means

“25% of new code” means:

  • Generated by AI, not autocompleted
  • Passes human code review
  • Ships in production systems
  • Measured across all Google engineering output

This is not 25% of the total codebase, but 25% of new code written today. The percentage is growing and is considered a strategic advantage.

How Agent Smith Differs from Other AI Coding Tools

The AI Coding Tool Spectrum

Tool Mode Interaction Scope Production code?
GitHub Copilot Real-time autocomplete Inline in IDE Line/function level After human acceptance
Claude Code Interactive session Conversational Multi-file changes After human review
Cursor Agent Background + interactive IDE-embedded Project-level After human review
Agent Smith Asynchronous autonomous Task delegation Full feature implementation After human review
KAIROS (unreleased) Always-on daemon Background monitoring Repository-wide TBD

Agent Smith is at the autonomous end of this spectrum. The next step would be fully autonomous deployment without human review—no tool does this yet.

Why Asynchronous Matters for API Teams

Real-time AI tools operate within the developer’s flow. Asynchronous agents shift this. When Agent Smith writes an API endpoint, the human reviews it after the fact, separated from creation context. This leads to issues like:

  • Unclear rationale for API decisions
  • Non-obvious contract changes in code review
  • Artifacts (tests, docs, mocks) may not be updated
  • Breaking changes may slip through

What Breaks When AI Writes Your API Code

API Contract Drift

An API contract defines endpoints, schemas, status codes, and error formats. Human developers usually update OpenAPI specs and notify consumers when making changes.

Autonomous agents like Agent Smith may change code that passes tests, but tests may not cover all contract aspects. For example:

  • Agent Smith adds a preferences field to GET /api/users/{id}.
  • Existing tests pass (they don’t check for extra fields).
  • Frontend’s TypeScript types lack preferences.
  • Mobile app’s strict parser fails on unexpected field.

Result: code is correct, tests pass, contract is broken.

Test Coverage Gaps

AI-generated code often comes with matching tests, but those tests focus on new behavior, not regression. For APIs, this can mean:

  • Missing response time benchmarks
  • Diverging error response formats
  • Unchecked rate limiting
  • Missed authentication edge cases
  • Inconsistent pagination

Documentation Drift

If documentation is generated from code or OpenAPI specs, it should stay in sync. But with separate documentation, agent-made changes may not be reflected. Even with auto-generated docs, agents lack human context for usage notes and rationale.

Review Fatigue

When 25% of code is AI-generated, reviewers face more code that looks syntactically correct but may diverge from architectural norms and unstated requirements. This increases the risk of superficial (“rubber-stamp”) code reviews.

How to Build Agent-Proof API Workflows

1. Make API Contracts the Source of Truth

Adopt design-first API development. With OpenAPI as the source of truth, all code changes are validated against the contract.

Without design-first:

Code change → Tests pass → Ship → Contract broken
Enter fullscreen mode Exit fullscreen mode

With design-first:

Spec defines contract → Code must match spec → Contract validation catches drift
Enter fullscreen mode Exit fullscreen mode

Apidog’s visual API designer lets you define endpoints and schemas before code is written. Validate all changes against the spec.

2. Use Contract Testing, Not Just Unit Tests

Unit tests validate behavior. Contract tests enforce the API agreement.

Example contract test:

// This test fails if the response shape changes,
// even if the new shape is "valid"
describe("GET /api/users/:id contract", () => {
  it("returns expected schema", async () => {
    const response = await request(app).get("/api/users/123");

    expect(response.body).toMatchSchema({
      type: "object",
      required: ["id", "name", "email", "created_at"],
      properties: {
        id: { type: "string" },
        name: { type: "string" },
        email: { type: "string", format: "email" },
        created_at: { type: "string", format: "date-time" }
      },
      additionalProperties: false  // Catches unexpected fields
    });
  });
});
Enter fullscreen mode Exit fullscreen mode

The additionalProperties: false line ensures any schema change is caught. Apidog automates contract testing: define your schema once and validate every response in tests and CI/CD.

3. Gate Deployments on Spec Validation

Add API spec validation to your CI/CD pipeline. Ensure code matches the declared contract before deployment:

# CI/CD pipeline step
- name: Validate API contract
  run: |
    # Diff the current spec against the running implementation
    apidog run --test-scenario-id CONTRACT_TESTS

    # Fail if any contract violations found
    if [ $? -ne 0 ]; then
      echo "API contract violation detected. Review changes."
      exit 1
    fi
Enter fullscreen mode Exit fullscreen mode

This blocks contract-breaking changes before production.

4. Require Spec Updates for API Changes

Enforce a workflow: any PR modifying API behavior must include an OpenAPI spec update. For AI-generated PRs, the agent or a human must update the spec before merging.

In Apidog, spec changes auto-propagate to:

  • API documentation
  • Mock server responses
  • Test assertions
  • Client SDK types

This keeps all artifacts in sync.

5. Monitor API Behavior in Production

Even with contract tests, production monitoring catches what pre-prod tests miss. Track:

  • Schema violations: Log mismatches against the spec
  • Unexpected fields: Alert on new, undocumented fields
  • Error rate changes: Watch for shifts across endpoints
  • Latency shifts: Detect performance changes from agent-written code
  • Traffic pattern changes: Spot unexpected usage on new endpoints

6. Separate API Review from Code Review

Standard code review checks functionality. API review checks consumer impact.

For AI-generated API changes, use a checklist:

  • Does this break any existing consumer?
  • Is the OpenAPI spec updated?
  • Are breaking changes versioned?
  • Are error responses consistent?
  • Are new endpoints documented?
  • Have downstream teams been notified?

The Trajectory: Where Autonomous Coding Is Heading

Agent Smith Today vs. Tomorrow

Agent Smith at 25% is just the start. AI agents are a “big focus,” and the percentage will rise as access expands and tools mature.

Other companies are building similar systems:

  • Claude Code’s KAIROS: Always-on daemon with GitHub webhooks and background workers
  • GitHub Copilot Agent Mode: Multi-step autonomous file editing
  • Amazon CodeWhisperer: Expanding to agentic workflows

AI coding tools are moving from “assistant” to “autonomous contributor” to “background infrastructure.” Soon, the question is not if, but how much of your API code is written by AI.

What API Teams Should Prepare for Now

  • Design-first is now required. Make your API spec the source of truth before agent adoption makes it urgent.
  • Invest in contract testing. Unit tests aren’t enough when code authors lack your team’s context. Contract tests encode conventions explicitly.
  • Choose tools that sync artifacts. Disconnected toolchains create drift. Integrated platforms like Apidog keep specs, tests, mocks, and docs in sync.
  • Update review processes. Standard reviews miss API contract violations. Add checklists and automated validation for API changes.

Try Apidog free to build API workflows that stay consistent whether your next code change comes from a human developer, Agent Smith, or whatever autonomous coding tool comes next.

FAQ

What is Google Agent Smith?

Agent Smith is Google’s internal AI coding agent, built on Gemini and Antigravity. It works asynchronously: engineers assign tasks, and Agent Smith writes, tests, and iterates on code without real-time human interaction. It generated over 25% of Google’s new production code as of March 2026.

Is Agent Smith available outside Google?

No. Agent Smith is internal to Google employees only. There are no public release plans. The technology is similar to Copilot Agent Mode and Claude Code, but more deeply integrated with Google’s internal systems.

Does AI-generated code break API contracts?

It can. AI agents write code that passes tests, but tests may not cover the full contract. Schema changes, new fields, error formats, and behavioral changes can break downstream consumers. Contract testing and design-first development prevent this.

Should API teams worry about Agent Smith?

Not about Agent Smith specifically, since it’s internal to Google. But similar autonomous coding tools (Copilot Agent Mode, KAIROS, etc.) are coming. Preparing your API workflow now—with design-first, contract testing, and integrated tooling—positions you to adopt autonomous agents safely.

How do I prevent AI agents from breaking my APIs?

Use design-first development with OpenAPI as the source of truth. Add contract tests with additionalProperties: false to catch schema changes. Gate deployments on spec validation. Use an integrated platform like Apidog to keep specs, tests, mocks, and docs in sync.

What’s the difference between AI-assisted and AI-generated code?

AI-assisted code (Copilot, Claude Code) is written in real time with human oversight. AI-generated code (Agent Smith) is produced asynchronously, with the developer reviewing completed work after the fact. This increases the risk of undetected contract violations.

Will AI agents replace API developers?

No. Agent Smith still requires human task definition, code review, and approval. AI augments productivity but does not replace the judgment, context, or architectural thinking of human developers. The role shifts toward defining tasks, reviewing output, and maintaining system coherence.

Key Takeaways

  • Google’s Agent Smith generates 25% of new production code via asynchronous, autonomous operation
  • This shift from AI-assisted to AI-generated code changes API review dynamics
  • API contract drift is the primary risk when autonomous agents modify endpoints and schemas
  • Design-first development with OpenAPI specs as the source of truth prevents contract breakage
  • Contract testing with strict schema validation catches changes unit tests miss
  • Integrated platforms like Apidog synchronize specs, tests, mocks, and docs to prevent drift
  • Autonomous coding agents are accelerating—prepare your API workflows now

Agent Smith at 25% is the beginning. Teams that build agent-proof API workflows today will be able to safely adopt autonomous coding tools tomorrow.

Top comments (0)