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.

antigravity437agents129scope-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.

Hardening Permissions Leaves the Scope Accidents Behind

This distinction is not abstract — it shows up in the tooling. Antigravity CLI 1.1.3, released on July 16, 2026, closed two holes in the permission layer.

The first was headless execution (-p). When it hit a tool that required confirmation, you got one of two outcomes: it hung there, or it silently auto-approved. After the fix it soft-denies, and the allow rule name required to permit the operation is printed to stderr. The second was always-proceed mode, where file writes outside the workspace were being auto-approved by mistake.

As someone who leaves tasks running unattended overnight, the second one gave me a chill. An auto-approval that can write outside the workspace is a permission-layer bug, and it deserved exactly the fix it got.

But once it was fixed, I looked back at my own "button color" incident and realized none of it had been addressed. The writes back then landed inside the workspace, and the permissions were correctly granted. The refactor, the rename, the dependency bump — every one of them is legal from a permission standpoint.

LayerShape of the questionDoes the 7/16 fix help?Accident left over
PermissionMay it write there?Yes — blocks auto-approved writes outside the workspace
ScopeMay it do that this time?No — the permission stays legitimateThe while-I'm-at-it refactor and rename

The more the permission layer hardens, the more the remaining accidents concentrate in the scope layer. I do not read this as "the tool is safe now, so I can relax." I read it as: the tool got safer, and that made it clear which layer is mine to design.

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 carry the contract into headless runs and verify drift from the diff afterward
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-07-15
The File Is Right There in ls, and Your Agent Still Can't Open It
The agent says the file does not exist. Your terminal says it does. After three days of blaming cloud sync, the answer turned out to be that one voiced consonant mark was never a single character. Detection script and a three-layer gate included.
Agents & Manager2026-07-08
Measuring the Rework Rate of What You Delegate to Agents: Drawing Delegation Boundaries with Numbers, Not Instinct
How much should you hand to an agent? I drew that line by instinct for a long time. Here is a practical way to compute a per-category rework rate from your git history and redraw the delegation boundary with numbers, with working code.
Agents & Manager2026-07-05
Protecting Your Agent Stack's Known-Good State with a Single Lockfile — Change-Budget Design for an Era of Simultaneously Moving Parts
When the IDE build, CLI, model, and dependencies all move at once, you can no longer tell which one caused a regression. Here is a change-budget design that pins your known-good state to one lockfile, with working code and operational logs.
📚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 →