ANTIGRAVITY LABJP
Articles/Agents & Manager
Agents & Manager/2026-07-14Advanced

I Changed One Line in AGENTS.md and Broke the Agent — Regression-Testing the Instructions Themselves

Every time you edit the instructions you hand an agent — AGENTS.md, skill text — some other task quietly breaks. Here is a regression harness whose subject is the instructions, not the code: fixed tasks, deterministic assertions, and a way to wire it into unattended runs.

Antigravity328agent design7regression testing3prompt managementunattended ops2

Premium Article

All I did that day was reword one line in AGENTS.md, from "reuse existing functions where possible" to "prefer reusing existing functions." Same intent, surely. Yet the next morning's unattended run had one task writing a fresh utility from scratch every single time. I hadn't touched a line of code. What broke was the instruction.

When you hand Antigravity agents recurring work as an indie developer, this is the failure I fear most. No red test, no exception thrown. Something that used to work just quietly stops working — and because the cause is an instruction you edited in good faith, it takes days to notice.

We write regression tests for code. Why not for instructions? For the past few weeks I have been trying to answer that with an implementation: a regression harness whose subject under test is not the code, but the text you feed the agent.

Treat instructions as implicit code

An agent's behavior is the composition of the model weights and the instructions you provide. You cannot change the weights, but you rewrite the instructions daily. That makes AGENTS.md and your skill files a kind of source code that gets interpreted at runtime. And source code deserves a way to tell whether a change regressed anything.

Ordinary unit tests will not do. Unlike a function's return value, the same input does not yield the same output — the same instruction and task still produce slightly different results each run. So we swap the subject from "the output itself" to "the properties the output must satisfy." Pin the properties, and a little wobble no longer prevents a verdict.

This is continuous with externalizing completion checks. Not trusting an agent's self-report, and verifying from the outside, is the design I covered in the article on graduating agents from self-reported completion. This piece sits one step earlier: a layer that re-verifies many tasks at once, the moment you change an instruction.

Decide fixture granularity first

A regression suite is a set of fixtures. One fixture pairs "a task's instruction" with "the assertions that task must satisfy." Get greedy with granularity and it collapses. My first attempt turned real production tasks into fixtures directly, and it failed: each run took minutes, hit external APIs, and produced environment-dependent results. Far too heavy for a suite you run constantly. Bringing production tasks in wholesale was the first pitfall of this setup; to avoid that weight I now stick to representative, lightweight tasks.

Now I keep fixtures "representative, short, and side-effect closed." My rule of thumb: under 30 seconds per fixture, no external network, and artifacts confined to files inside the sandbox. You are not reproducing the real job — you are reproducing, in minimal form, the property you want the real job to preserve.

Assertion typeWhat it checksNoise resistance
File existsWas the expected artifact producedHigh
grep patternDid it use a specific function or APIMedium
Exit codeDoes the artifact run or build as-isHigh
ForbiddenDid it write something you asked it to avoidHigh

I do not machine-check semantic correctness — whether the code's intent is right. Lean on a model judge for that and the noise climbs, and the foundation for detecting regressions crumbles. Putting only deterministically measurable properties into assertions is what made the suite trustworthy.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
How to build a regression suite whose subject is the instruction text (AGENTS.md, skills) rather than code, and how to size each fixture
Four deterministic assertion types — file existence, grep, exit code, forbidden patterns — plus baseline diffing to catch silent regressions
A multi-trial score that keeps stochastic noise from being read as a regression, and how to fold the harness into an unattended schedule
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Agents & Manager2026-06-15
Stop Letting Antigravity Agents Self-Report 'Done' — Completion Contracts and External Verification
An Antigravity agent reporting 'done' when the work was not actually finished is a failure mode I kept hitting. Moving the completion decision out of the agent and into code fixed it. Here is the contract, a three-layer verifier, and how it holds up under unattended, scheduled runs.
Agents & Manager2026-05-06
Giving AI Agents an Aesthetic Sense — Building a UI Quality Evaluation Pipeline with Antigravity × Gemini Vision
Explore how to encode the vague judgment of 'is this UI good or bad' into code. Combines Antigravity with Gemini Vision to implement a complete pipeline — from screenshot capture to AI evaluation, improvement suggestions, automated fixes, and CI/CD integration.
Agents & Manager2026-04-24
Implementing Antigravity's A2A Protocol — Practical Patterns for Agent-to-Agent Conversation
A hands-on guide to Antigravity's A2A (Agent-to-Agent) protocol. Walks through the minimal two-agent setup and three real-world patterns — fire-and-forget, bidirectional confirmation, and scatter-gather — with runnable samples.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →