← Latest papers
💻 computer science

Agent Contracts: A Formal Framework for Resource-Bounded Autonomous AI Systems

This paper introduces "Agent Contracts," a formal framework that extends the Contract Net Protocol to govern multi-agent systems by unifying task specifications with strict resource, temporal, and success constraints, thereby enabling predictable, auditable, and resource-bounded autonomous AI deployment with demonstrated efficiency and zero conservation violations.

Original authors: Qing Ye, Jing Tan

Published 2026-03-26
📖 5 min read🧠 Deep dive

Original authors: Qing Ye, Jing Tan

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you hire a brilliant, hyper-energetic assistant to do a job for you. You give them a task, and they get to work. But here's the catch: you never told them when to stop, how much money they can spend, or what "done" actually looks like.

In the real world, this assistant might keep working for 11 days straight, burning through your entire credit card limit, asking for more money, and getting stuck in a loop of "I need to check this one more thing." This is exactly what happened to an engineering team in late 2025, resulting in a $47,000 bill for an AI system that just wouldn't quit.

This paper introduces a solution called Agent Contracts. Think of it as a legal and technical "Rulebook" that you give to your AI before it starts working. It turns a wild, unpredictable robot into a disciplined employee who knows exactly how much they can spend and when to clock out.

Here is the breakdown using simple analogies:

1. The Core Problem: The "Runaway Robot"

Current AI agents are like unlimited credit cards. You can swipe them as much as you want, but the bill only comes at the end. If the AI gets confused or stuck in a loop, it keeps swiping until your bank account is empty. Existing tools can tell the AI what to do, but they don't have a formal way to say, "Stop if you spend more than $5" or "Stop if you've been working for 1 hour."

2. The Solution: The "Agent Contract"

The authors propose a formal document (a tuple of data) that acts like a strict contract between you and the AI. It has seven key parts, which we can think of as the rules of a game:

  • The Job Description (Input/Output): "Here is the raw material you get, and here is the finished product you must return."
  • The Toolkit (Skills): "You are allowed to use a calculator and a web browser, but you are not allowed to access your own bank account."
  • The Wallet (Resource Constraints): This is the most important part. It says: "You have $5.00 to spend. You have 100,000 words of thinking space. You can only make 10 web searches."
  • The Stopwatch (Time Limits): "You have 30 minutes to finish. If the clock hits 30:01, you must stop immediately."
  • The Goal Post (Success Criteria): "You win if you find the answer with 90% accuracy. If you don't, you lose."
  • The "Kill Switch" (Termination): "If you run out of money, run out of time, or get stuck, the contract ends automatically."

3. The "Family Budget" (Multi-Agent Coordination)

What if you need a team of AIs? One to research, one to write, and one to edit?
Without contracts, the "Researcher" might spend all the money, leaving nothing for the "Writer."
The paper introduces Conservation Laws. Think of this like a family budget:

  • The parent gives the family $100.
  • The parent gives the Researcher $40 and the Writer $40, keeping $20 as a safety buffer.
  • Even if the Researcher tries to spend $50, the system stops them because the contract says, "You only have $40."
  • If the Researcher finishes early and only spends $30, that extra $10 goes back into the family pot for the Writer to use.

This ensures the whole team never overspends the original budget, no matter how many sub-teams they create.

4. How It Works in Real Life (The Experiments)

The authors tested this with four different scenarios, and the results were like magic:

  • The "Code Review" Test: They let an AI fix code. Without a contract, it went crazy and spent a fortune. With a contract, it spent 90% less money and was just as good at fixing the code. It stopped trying to fix things that were already perfect.
  • The "Research Team" Test: They had three AIs work together. Without contracts, one agent would sometimes go rogue and waste money. With contracts, zero agents ever broke the budget rules.
  • The "Speed vs. Quality" Test: They showed that you can tell the AI, "I need this fast, even if it's slightly less perfect" (Urgent Mode) or "I need this perfect, take your time" (Balanced Mode). The AI adjusted its behavior exactly as requested.

5. The Catch (The "Post-Call" Problem)

There is one small limitation. The AI doesn't know exactly how much it spent while it is thinking. It only knows the cost after it finishes a sentence.

  • Analogy: It's like ordering a pizza. You don't know the exact price until the delivery guy hands you the receipt.
  • The Fix: The system can't stop the current pizza order if it's too expensive, but it can cancel the next order immediately. This prevents the "runaway" scenario where the AI keeps ordering pizzas for 11 days.

Why This Matters

This isn't just about saving money. It's about safety and trust.

  • Predictability: You know exactly how much an AI task will cost before you start.
  • Accountability: If an AI fails, you know exactly why (it ran out of time, or it hit a quality limit).
  • Scalability: You can now build huge teams of AI agents without worrying that one of them will accidentally bankrupt your company.

In short: Agent Contracts turn AI from a "wild card" that might do anything, into a "reliable employee" who follows a strict rulebook, respects a budget, and clocks out on time. It's the difference between hiring a genius who might burn down the house and hiring a professional who gets the job done safely.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →