ANTIGRAVITY LABJP
Articles/Agents & Manager
Agents & Manager/2026-06-28Intermediate

It Did Things I Never Asked For — Binding an Agent's Task Scope With a Contract

Ask it to fix a button color and you get a refactor, renames, and a dependency bump too. This is a scope problem, not a permission one. Here is a contract that stops at the scope boundary and asks.

antigravity399agents109scope-controltask-contract

Premium Article

I thought I had only asked to "fix the button color." The returned changes included the color fix plus a refactor of a nearby function, a variable rename, and a dependency version bump for good measure. All of them well-meant, and all of them work. But what I wanted to see was a single line of color change; the rest only swelled the review and planted unintended diffs.

When you run several apps in indie development, this "over-helpfulness" quietly adds up. Each instance is small, but stacked together you lose track of which change you actually intended. What I want to bind here is not permission. The write access is fine. What I want to bind is acting beyond what was asked.

This Is a Scope Problem, Not a Permission One

Talk of reining in a runaway agent tends to start with permissions: what can it write to, what can it execute. That matters too, but this problem sits on a different layer. Having permission to fix the color is fine. The problem is doing other things while fixing the color — being over-helpful beyond the task's scope.

Binding with permissions reduces what the agent can do. Binding with scope leaves what it can do unchanged, and limits only "what is allowed this time." The latter is what I wanted.

Sign a Task-Scope Contract

So I put a short contract that states the scope per request into the rules or prompt. It has only three parts.

  1. State what to do (in-scope) in one sentence.
  2. List what not to do (out-of-scope), only the things that tend to happen.
  3. Declare that if it wants to cross the boundary, it proposes without executing and stops.
## Scope of this task
- Do: change the submit button color to brand-primary.
- Do not: refactor nearby code, rename variables/functions,
  bump dependency versions, apply the formatter wholesale, ripple into other files.
- If tempted to cross the boundary: do not execute. List it as a one-line "proposal"
  and hand the decision to the human.

The third part is the crux. Banning all "while I'm at it" stops genuinely necessary ripple too. Instead of that, change it to "if tempted, leave a proposal rather than doing it." This keeps the noticing while confining only the execution to scope.

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
A task-scope contract, distinct from permissions, that stops over-helpful changes
How to write an acceptance rule that proposes — without executing — when it wants to cross the boundary
How to set scope granularity and allowed ripple so it does not stop and ask every time
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-28
The Day the Article I Asked It to Format Became the Agent's Instructions
When you run an unattended content-formatting pipeline with Antigravity CLI, instruction-like text buried in the file you are processing can hijack the agent. Here is how I separate the instruction channel from the data channel and add an output-scope acceptance gate to reject anything out of bounds.
Agents & Manager2026-06-25
Before a Major Update Silently Breaks Your Overnight Automation — Designing a Staged-Adoption Canary Gate
After a major update dropped my unattended run success rate from about 98% to 63% overnight, I built a staged-adoption gate that freezes the working setup, verifies a new version against a golden output in an isolated profile, and only then adopts it. Here is the design with bash and Python.
Agents & Manager2026-06-22
Your Antigravity Custom Tools Don't Break by Design — They Break on Re-execution: Field Notes on Idempotency and Error Contracts
Once you add a custom tool to an Antigravity agent, the real production problem is re-execution and duplicated side effects. Here are the idempotency keys, error contracts, health gates, and tool-sprawl checks that actually held up in practice.
📚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 →