Source-linked AI summary
Agent Contracts: A Formal Framework for Resource-Bounded Autonomous AI Systems
Qing Ye, Jing Tan
TL;DR
Agent Contracts address the lack of formal bounds on autonomous agents’ resource use and operating time by unifying specifications, constraints, temporal limits, and success criteria with delegation conservation laws. Across four experiments, the framework reduced tokens, lowered variance, achieved compliant delegation, and exposed quality-resource tradeoffs, while real-time hard enforcement remains infrastructure-limited.
Problem
Autonomous AI systems lack formal mechanisms to bound their resource consumption and operating duration, creating a need for explicit resource governance.
Method
The paper defines Agent Contracts as a formal tuple unifying input/output specifications, resource constraints, temporal boundaries, success criteria, and conservation laws for delegated budgets.
Results
Across four experiments, the framework achieved 90% token reduction, 525× lower variance, zero conservation violations, and measurable quality-resource tradeoffs.
Takeaways & Limitations
Agent Contracts provide formal foundations for governing autonomous AI through explicit resource and temporal constraints across individual and multi-agent execution.
Takeaways & Limitations
Real-time enforcement remains limited because APIs generally cannot interrupt generation mid-call, reserve tokens with hard guarantees, or support native budget-aware inference.
Abstract
from arXiv · showhide
The Contract Net Protocol (1980) introduced coordination through contracts in multi-agent systems. Modern agent protocols standardize connectivity and interoperability; yet, none provide formal, resource governance-normative mechanisms to bound how much agents may consume or how long they may operate. We introduce Agent Contracts, a formal framework that extends the contract metaphor from task allocation to resource-bounded execution. An Agent Contract unifies input/output specifications, multi-dimensional resource constraints, temporal boundaries, and success criteria into a coherent governance mechanism with explicit lifecycle semantics. For multi-agent coordination, we establish conservation laws ensuring delegated budgets respect parent constraints, enabling hierarchical coordination through contract delegation. Empirical validation across four experiments demonstrates 90% token reduction with 525x lower variance in iterative workflows, zero conservation violations in multi-agent delegation, and measurable quality-resource tradeoffs through contract modes. Agent Contracts provide formal foundations for predictable, auditable, and resource-bounded autonomous AI deployment.
1 Introduction
Autonomous agents can operate for extended periods without formal bounds on resource use or duration. Agent Contracts address this governance gap by combining execution specifications, constraints, lifecycle rules, and delegation conservation laws.
- Problem: A multi-agent system accumulated a $47,000 API bill after two agents ran undetected in a recursive clarification loop for eleven days.The system lacked stop conditions, budget limits, and real-time cost monitoring.
- Problem: Existing agent protocols address connectivity and interoperability but not how much agents may consume or how long they may operate.
- Approach: Agent Contracts extend contracting from task allocation to resource governance by asking within what bounds a task may be performed.The framework draws on contract theory, coordination theory, and resource-bounded computation.
- Contributions: The framework defines C= (I, O, S, R, T, Φ, Ψ), unifying input/output specifications, resource constraints, temporal boundaries, and success criteria.
- Validation: 90% token reduction, zero conservation violations, and measurable quality-resource tradeoffs were demonstrated across four experiments.
2 Theoretical Foundations
Agent Contracts combine ideas from contract theory, multi-agent coordination, bounded rationality, contract algorithms, and real-time systems. These foundations motivate explicit obligations, prohibitions, conservation laws, and resource-aware execution.
- Contract theory: Contract theory contributes moral hazard, incomplete contracts, and mechanism design for governing hidden resource use and separating success criteria from execution strategies.
- Multi-agent coordination: Classical multi-agent coordination established explicit contracting, while normative systems model obligations, prohibitions, permissions, and sanctions.
- Multi-agent coordination: Agent Contracts operationalize normative governance by treating resource constraints as prohibitions, success criteria as obligations, and violations as triggers for automatic termination.
- Conservation: Conservation laws require resources allocated to subtasks to remain within parent resources, despite stochastic token consumption and after-the-fact observability.
- Resource-bounded computation: Bounded rationality motivates satisficing through acceptable quality thresholds within resource budgets.
- Resource-bounded computation: Contract algorithms pre-specify computation budgets, while real-time systems distinguish hard constraints that terminate execution from soft constraints that permit graceful degradation.
3 Related Work
Existing agent frameworks and protocols provide coordination, connectivity, operational controls, and resource-efficiency techniques, but the supplied comparison identifies a remaining formal governance gap. Agent Contracts are presented as filling that gap with budgets, deadlines, success criteria, and delegation laws.
- Agent systems: ReAct, Chain-of-Thought, Toolformer, AutoGPT, and Generative Agents illustrate increasingly autonomous, tool-using systems with expanding resource-consumption profiles.
- Protocols: MCP and A2A standardize tool connectivity, discovery, and interoperability, while resource governance remains outside their stated scope.
- Resource efficiency: TALE reports 68% token reduction with less than 5% accuracy degradation, while token elasticity shows prompting alone is insufficient for strict budget enforcement.
- Resource efficiency: Equalized-compute evaluations find sophisticated reasoning strategies often do not outperform simpler baselines, highlighting the importance of explicit resource accounting.
- Infrastructure: Serving systems and LLMOps provide inference- or organization-level controls, but neither formally governs individual agents within multi-agent workflows.
- Formal governance: Formal verification checks whether systems satisfy properties, whereas Agent Contracts specify the resource constraints systems must satisfy.
- Framework comparison: Across eight frameworks, operational controls are present but cost budgets, temporal deadlines, success criteria, and delegation conservation laws are absent.
4 The Agent Contract Framework
An Agent Contract is a seven-component specification for bounded execution, covering inputs, outputs, capabilities, resources, time, success, and termination. Its lifecycle reserves and monitors resources, enforces constraints, and ends in one accountable terminal state.
- 4.1 Contract Definition: An Agent Contract is the seven-tuple C= (I, O, S, R, T, Φ, Ψ) specifying bounded agent execution.
- 4.2 Contract Components: Input and output specifications define accepted schemas, validation or preprocessing, deliverable schemas, minimum quality, and formatting requirements.
- 4.2 Contract Components: The skill set restricts agents to enumerated tools, functions, and knowledge domains, with associated costs or success probabilities where specified.
- 4.2 Contract Components: Resource constraints define multidimensional budgets whose consumption must satisfy ∀i: c_i(t) ≤ b_i across tokens, calls, iterations, searches, time, and cost.
- 4.2 Contract Components: Temporal constraints use activation time and duration, with deadlines represented as t_deadline= t_start+ τ.
- 4.2 Contract Components: Success criteria combine weighted measurable conditions against a threshold, while output quality is only one possible condition among others.
- 4.2 Contract Components: Termination occurs on any resource-budget breach, duration expiration, explicit cancellation, or unrecoverable error.
- 4.3 Lifecycle: Contracts transition from DRAFTED to ACTIVE and then exactly one of FULFILLED, VIOLATED, EXPIRED, or TERMINATED, enabling resource release and audit logging.
5 Resource Tracking and Monitoring
Resource tracking decomposes consumption into measurable categories and monitors both resource and temporal utilization during execution. Budget-aware communication enables agents to adapt their strategies as constraints tighten.
- Scope: Multiple resource types—including tokens, API calls, tool invocations, compute time, and cost—are tracked, with emphasis on token categories and runtime visibility.The section focuses on decomposing token budgets and monitoring constraint utilization.
- Token Budget Decomposition: Token budgets separate input, reasoning, and output tokens, making reasoning and output the controllable portion after task-context tokens are accounted for.The controllable budget is B_ctrl = B_tok − r_in.
- Runtime Monitoring: The monitor returns resource consumption, element-wise resource utilization, and elapsed-time utilization from a contract and the current time.These values expose both budget use and temporal progress during execution.
- Runtime Monitoring: Utilization ranges from 0 to 1 and is monotonically non-decreasing because cumulative consumption cannot decrease.Agents can query utilization during execution to adapt their strategies as constraints tighten.
- Aggregate Monitoring: An aggregate utilization value identifies the most-constrained resource and supports threshold policies such as warnings above 80% utilization.This avoids requiring sophisticated optimization for basic constraint-aware control.
- Communicating Budget to Agents: Budget-aware prompts and dynamic status updates communicate remaining resources, enabling agents to produce concise outputs or explore more when resources permit.Prompt-based communication is presented as a practical mechanism with current infrastructure.
6 Multi-Agent Coordination Under Contracts
Agent Contracts extend resource governance to multi-agent systems by treating contracts as delegation units and enforcing conservation across coordination hierarchies. Allocation, pooling, routing, and orchestration patterns remain bounded by parent budgets.
- Coordination Problem: Multi-agent governance must divide parent budgets among child agents while ensuring aggregate consumption remains within the original constraint.The problem includes over-allocation by one agent while others remain under budget.
- Contract-Based Delegation: Contracts provide a natural delegation unit for shared token, cost, API-call, compute-time, and other constrained resources.The framework applies coordination principles beyond token budgets.
- Conservation Laws: Conservation requires total resource consumption to remain within the system budget regardless of sequential, parallel, hierarchical, or competitive execution.This invariant governs resource flow between collaborating agents.
- Initial Allocation: Initial allocations may be equal or negotiated, with negotiated budgets capped to prevent over-claiming when task complexity or agent requests differ.Equal allocation applies when complexity is unknown.
- Dynamic Reallocation: Unused budget returns to a shared pool as agents complete, allowing efficient agents to subsidize resource-intensive agents while preserving total budget discipline.Dynamic reallocation improves overall throughput through budget pooling.
- Contract-Centric Patterns: Contracts organize routing, orchestration, parallelization, and iterative refinement by making resource constraints govern each pattern’s behavior.Task routing and delegation decisions receive particular emphasis, while sequential and parallel execution compose orthogonally.
- Routing: Routing can reserve branch budgets and return unused allocations, while explicit contracts match requirements against capabilities, resource profiles, and success criteria.Contracts can also specify dynamically instantiated agents rather than only selecting from a fixed pool.
- Orchestrator-Workers: Orchestrators issue worker subcontracts specifying tasks, budgets, and success criteria, with subcontract allocations constrained by the parent resource budget.This makes contracting a capability required for effective delegation.
7 Fundamental Limitations and Practical Enforcement
Agent Contracts enforce resource limits most effectively between actions, because token usage becomes observable only after an LLM call completes. Soft prompting supports self-regulation, while hard monitoring can halt later actions after violations.
- Single-Call Constraint: Token consumption is unknown during an LLM call and becomes available only after the API returns.This creates an observability boundary for enforcement.
- Single-Call Constraint: Because usage metadata arrives after generation, contracts cannot prevent one expensive call from exceeding budget but can block subsequent calls.Their primary value is protection across multiple calls.
- Enforcement Layers: Soft enforcement communicates remaining resources through prompts for cooperative self-regulation, but agents may ignore or exceed stated constraints.The text associates this limitation with token elasticity.
- Enforcement Layers: Hard enforcement uses an external monitor to track consumption after each action and halt execution when constraints are breached, regardless of agent behavior.This follows an infrastructure-layer harness pattern that wraps and intercepts agent actions.
- Enforcement Coverage: Hard enforcement fully supports cumulative multi-call budgets, iteration limits, API-call limits, and duration limits, while cost ceilings are approximate.Cost is bounded through cumulative tracking and max_tokens.
- High-Value Scenarios: Contracts are especially valuable for retry loops, validation cycles, multi-agent workflows, tool-heavy agents, and long-running sessions.These scenarios involve repeated calls, downstream work, cumulative tool costs, or many interactions.
- Future Infrastructure: True intra-call guarantees require interruptible generation, token reservation, and budget-aware inference capabilities that current infrastructure lacks.Until those changes exist, enforcement is hard between actions and soft within a generation.
8 Empirical Evaluation
Four experiments evaluate Agent Contracts across runaway prevention, multi-agent budget conservation, crisis communication, and quality-resource tradeoffs. Together, the results show bounded execution, lower resource variance, enforced delegation budgets, and configurable quality-speed behavior.
- Experimental Design: Four experiments validate enforcement mechanisms and coordination primitives across single-agent and multi-agent settings.The experiments use Google ADK or LiteLLM reference implementations with Gemini 2.5 Flash and Flash-Lite.
- Runaway Prevention: 90% token reduction and 525× lower variance distinguish CONTRACTED from UNCONTRACTED code-review execution.The comparison used a 50K token budget and maximum three iterations for CONTRACTED execution versus no token limits and up to six iterations for UNCONTRACTED execution.
- Failure Prevention: 23% token reduction with statistically equivalent quality was achieved in 24 time-critical crisis communication scenarios using explicit quality thresholds and iteration limits.The quality threshold was Q≥0.80.
- Runaway Prevention: Iteration governance prevented failure: UNCONTRACTED execution remained stuck in an evaluation loop, while CONTRACTED execution succeeded.The success-rate difference was 7.1 percentage points and was not statistically significant.
- Conservation Laws: Zero conservation violations occurred across 50 research-pipeline trials, and runtime enforcement detected and halted an agent exceeding its 40K token budget.The pipeline delegated sub-contracts while enforcing the invariant ∑b_i≤B and per-tool limits; the runaway agent consumed 56K tokens before termination.
- Quality-Resource Tradeoffs: BALANCED mode reached 86% success versus 70% for URGENT, investing 75% more tokens for 16 percentage points higher success.URGENT used no extended reasoning and a 30-second timeout; BALANCED used medium reasoning effort and a 90-second timeout.
- Overall Findings: Across experiments, contracts transform unpredictable agent behavior into bounded, auditable operations rather than merely optimizing cost.The evaluation combines resource enforcement, conservation laws, runtime runaway detection, quality thresholds, and configurable satisficing tradeoffs.
9 Conclusion
Agent Contracts formalize bounded autonomous execution by combining resource, temporal, and quality governance with conservation laws for delegation. The reported results show practical reductions in resource variance, full conservation compliance, and configurable quality-resource tradeoffs, while future extensions remain under investigation.
- Conclusion: Agent Contracts unify resource, temporal, and quality governance in a formal specification with conservation laws for multi-agent delegation.The contract specification is C=(I,O,S,R,T,Φ,Ψ).
- Conclusion: 90% token reduction with 525× lower variance, 100% multi-agent conservation compliance, and a 70%→86% success gradient demonstrate practical governance.These findings summarize the empirical validation across resource control, delegation, and contract modes.
- Future Work: Runtime cancellation, learning-based contract design, formal verification, human-in-the-loop approval, and milestone-based governance remain future extensions.Runtime cancellation would require API-level support from model providers to halt mid-execution.