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

Make the Self-Debugging Agent Walk the Logged-In and Post-Paywall Screens

By default, Antigravity 2.0's real-browser self-debug only sees the logged-out free view and reports success. To catch billing regressions, inject an authenticated session and paid state into the agent's browser and force coverage with assertions.

antigravity414self-debug2paywalltesting17agents120

Premium Article

Last week an Antigravity 2.0 agent came back with "Verified every screen in a real browser, from the home page to article detail. No issues found," complete with evidence. I merged it, relaxed, and the next morning a reader emailed to say a premium article's paywall had lifted for free members and the full text was visible to everyone.

The bug was not in the code. It was in where the check started. The Chrome the agent launched was a first-time visitor with no cookies, so it only ever walked the free, logged-out state. The one screen that must never break, the billing path, was never opened during self-debug. As an indie developer whose revenue rests on premium articles and in-app purchases, I cannot leave that blind spot alone.

Why default self-debug only sees the free, first-visit state

Real-browser self-debug launches an actual Chrome mid-build, drives elements, and checks its own work with screenshots. The speed is genuinely useful, but that Chrome starts from a clean profile every time. It carries no login session and no cookie that marks the visitor as paid.

So the agent always looks at the public face of the site. On my sites, article body gating runs across three states.

StateWhat decides itWalked by default?
Logged out, free articleNo cookieYes (the only one)
Logged-in memberpremium_token cookieNo
Single-article purchasearticle_purchases cookieNo

If two of three states are never seen, "all screens OK" is not all screens. The agent's well-meaning pass report quietly breeds complacency. Where to keep the evidence and the approval boundary is covered in designing evidence and approval for real-browser self-debug; here I dig into the step before that, whether the agent is even being shown the right state.

Three entry points for showing the agent a state

To make the agent walk the paid screen, you provide an entry point that injects the state. I adopt them in this order.

1. Pre-seeding the cookie (first choice)

Only on preview, burn in a premium_token before navigation. This reproduces "how a member sees it" without touching the real Stripe flow at all, so it is the fastest and safest option.

2. Deep-linking to the post-purchase URL

Send the browser straight to the unlocked article URL and confirm the rendered result. Use it together with cookie seeding.

3. Flag-forced unlock (last resort)

Disable the paywall with an environment variable. This bypasses the decision logic itself, so I treat it strictly as a visual check and never as verification of the billing decision.

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
Understand why an agent that only sees the logged-out free view reports 'all screens OK' and starts missing paywall regressions
Copy a working harness that injects a premium_token cookie and deep-links into the paid state, straight into your own preview
Add a 'fail the run if the post-paywall DOM was never reached' coverage assertion so a broken Stripe paywall is caught before it ships
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-18
Handing Visual Regression to a Parallel Agent in Antigravity 2.0
A design for running a dedicated headless visual-regression agent alongside your main implementation agent using Antigravity 2.0's parallel orchestration — with a working harness and the reproducibility traps I hit in production.
Agents & Manager2026-04-16
Building an AI Test Pipeline with Antigravity Agents: Automating Quality Assurance in Production
Learn how to build a production-grade automated test pipeline using Antigravity's AI agents — from unit test generation to E2E testing with Playwright, complete with validation layers and CI/CD integration.
Agents & Manager2026-07-02
Turning Last Night's Failed Runs into Tomorrow's Prevention — Designing a Postmortem Feedback Loop
Stop letting unattended failures end at a notification. A concrete design for classifying failures and feeding fixes back into Guide skills, gates, and schedules, with measured recurrence rates.
📚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 →