ANTIGRAVITY LABJP
Articles/Agents & Manager
Agents & Manager/2026-06-15Advanced

Receiving Managed Agent Async Jobs Through a Propose, Verify, Adopt Pipeline

The Managed Antigravity Agent, now in public preview via the Gemini API, autonomously plans, executes, and verifies inside a sandbox. Here is a design for catching its async deliverables through three stages — propose, verify, adopt — before they reach production, with implementation code and operational pitfalls.

Managed AgentGemini API4Async ProcessingAntigravity240

Premium Article

The Managed Antigravity Agent reached public preview on the Gemini API, handling everything from planning to execution autonomously inside a sandbox.

The convenience makes your pulse quicken at first. But operate it a little and another worry arrives. Running autonomously means deliverables come out without anyone's review. Should you really flow those straight to production?

As I started handing multi-app operations to this mechanism, I paused right here. What I want to share is a design for catching an autonomous agent's async deliverables through three stages: propose, verify, and adopt.

Don't "adopt on the spot"

The crux of the problem is that an autonomous agent returns "plausible but wrong" deliverables with full confidence.

It edits files, browses the web, and runs code. Each individual action may work correctly, yet the final judgment can be off. Adopt that into production unverified and the error reaches your users intact.

So I always treat autonomous output as a "proposal." A proposal is not yet an adoption. Insert a verification stage in between, and only let what passes proceed to adoption. Splitting into three stages alone sharply lowers the chance that a runaway autonomy reaches production.

Stage one: Propose

In the first stage, you submit an async job to the Managed Agent and receive the result. This output never touches production; it sits in an isolated place.

import time
from google import genai
 
client = genai.Client()
 
def propose(task: str, poll_interval: float = 3.0, timeout: float = 300.0):
    """Submit an async job to the Managed Agent and receive its deliverable as a proposal."""
    job = client.agents.create_run(
        agent="antigravity-preview-05-2026",
        input=task,
    )
    deadline = time.monotonic() + timeout
    while True:
        status = client.agents.get_run(job.id)
        if status.state in ("succeeded", "failed"):
            break
        if time.monotonic() > deadline:
            client.agents.cancel_run(job.id)   # never leave it running
            raise TimeoutError(f"job {job.id} timed out")
        time.sleep(poll_interval)
 
    if status.state == "failed":
        raise RuntimeError(f"job {job.id} failed: {status.error}")
    return {"job_id": job.id, "artifact": status.output}

The key is to always call cancel_run on timeout.

Fire an async job and forget it, and it keeps running on the sandbox side, racking up charges. I once went pale the next morning seeing the cost of a job that ran all night. I strongly recommend preparing a path that always stops what you start.

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
An implementation of a three-stage gate so autonomous deliverables are never adopted unverified
Where to draw the line between what the verify phase checks mechanically and what it escalates to a human
The pitfalls of polling async jobs, and how to handle them in production
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-12
Running Gemini's Managed Agents API: Where Cloud Execution Ends and My Local Agents Begin
A hands-on record of launching Gemini's Managed Agents (public preview) from Python — polling, artifact retrieval, and a cost guard — plus five criteria I use to decide what stays on my local CLI agents.
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-06-15
Designing Schema Evolution So Sub-Agent Handoffs Never Break
Put a typed contract at the boundary where a downstream agent receives an upstream agent's output, and learn how to evolve that schema without breaking existing flows — with validation code, a migration sequence, and the production symptoms to watch for.
📚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 →