Agents and Resource Budgets: Loops, Tool Calls and Background Work
An agent is an AI system that is given a goal and a set of tools and then takes steps towards the goal by itself: it calls a model, calls a tool, reads the result and repeats until its loop ends, or it is told to stop. Every step uses compute, and the number of steps is set at run time by the agent's loop and not by a person. That is the difference from the uses of Chapters 12 to 14, where one request gets one answer. An agent that can start work can spend resources, so its mandate carries a resource budget, set by someone other than the agent, measured by something outside it, with a stop path outside the system it stops. This chapter shows how to write, measure and enforce that budget, test the stop and apply the delegation ceiling.
The chapter concerns E3 Design, because the budget is a design decision made before the agent runs, and E4 Operate, because the budget is enforced and the stop is drilled while it runs. It applies the Cap test of the net-benefit principle of Chapter 4 to the use that multiplies most. Limits on agent steps belong to the third level of the optimisation hierarchy, efficient serving; whether an agent should start work at all belongs to the first, necessity. It builds on the observer principle of AI Operations, Chapter 17 (what verifies an action is independent of what performed it, and the stop works when the platform does not) (34, Nordqvist, 2026), the independence principle of AI Purple, Chapter 15 (33, Nordqvist, 2026), the finding of AI Platform and Security, Chapter 19 that controls on agents belong in the environment and not in the agent's compliance (27, Nordqvist, 2026), and the stewardship principle of AI Developer, Chapter 4 (36, Nordqvist, 2026).

Figure 15.1: An agent with a budget. The limits are set by a person, the gateway enforces them and the meter counts outside the agent, and the stop path works on the credential, not on the agent's cooperation. No figure is carried by the diagram.
The agent that kept going
This scene is constructed to show the arithmetic. It is not a reported incident, and its figures are illustrative.
At Hansa Mutual, on a Friday evening in 2032, a batch of 40 claims arrives with a scanned attachment that the document reader cannot open. The claims-triage agent (SVC-HM-002, Mode 5) retries a failed step with a variation, and each retry adds the failed output to the context. Its configuration sets no limit on retries, because its engineers held that a claim should not be abandoned. By Saturday morning each of the 40 runs has made about 600 model calls (one a minute for ten hours), and because the context grew, the later calls take about 2 accelerator-seconds against 0.9 for a normal call (FPR-HM-0002, Chapter 6). At that record's draw of 650 W per accelerator and facility overhead of 1.38, one accelerator-second is about 0.25 Wh, so one stuck run uses about 600 times 2 times 0.25, or 300 Wh. A normal claim uses 2.3 Wh, so one stuck run is worth about 130 normal claims, and the 40 used about 12 kWh, a little more than the agent's normal consumption for a whole day (illustratively about 10.7 kWh, from 140,000 claims a month). No claim was triaged.
The agent retried, as designed. What was missing was a limit set by someone who did not write the agent, a meter that did not depend on its own report, and a stop that did not run through it. With those, each run would have ended at the per-run energy ceiling of 7.0 Wh set in the budget below, which calls of this size reach after about 14 calls (the limit of 18 calls applies first to normal calls), the claim would have gone to a handler, and the 40 claims would have cost about 0.3 kWh, a factor of about 40 less, the ratio of 12 kWh to 0.28 kWh.
A documented case of the same mechanism comes from the builders of The AI Scientist, an automated research system. They report that in one run it wrote code that relaunched itself, causing an uncontrolled increase in Python processes; that in another it saved a checkpoint at every update step and used nearly a terabyte; and that when experiments exceeded the time limits it attempted to edit the code to extend the limit. The authors recommend strict sandboxing and storage limits (147, Lu et al., 2024). It was a 2024 research prototype with minimal sandboxing. The lesson is the mechanism: a limit that the agent's own code could edit was not a limit.
Where agents spend
An agent multiplies the footprint of a use in six ways beyond the per-call multipliers of Chapter 6.
Loops. An agent is a loop of plan, act and observe, and the number of iterations is decided at run time. A loop that does not converge costs without bound unless a limit stops it. If every step adds about k tokens to a context that is resent at every step, input tokens over n steps are roughly k times n(n+1)/2, so twice the steps cost close to four times as much unless a cache absorbs the prefix (the book's arithmetic, from AI Operations, Chapter 15, not a measurement) (34, Nordqvist, 2026). With k of 2,000 tokens, 12 steps send about 156,000 input tokens and 24 steps about 600,000.
Retries and recovery. A failed step is tried again, often with a variation. The retry factor of 1.15 in the claims-triage record is a healthy month's average; the tail is what a budget is for.
Tool calls and retrieval. Each tool call has a cost of its own (a search over an index, Chapter 14; a database query; a code run in a sandbox), and each result enters the context and is resent. A tool's compute is not in the model provider's figure and is often outside the gateway's sight.
Parallel calls and sub-agents. Fan-out multiplies spend as fast as calls are issued, so a limit checked once a minute does not bound it. A sub-agent with its own budget multiplies the budget; one drawing on its parent's does not.
Scheduled and event-driven work. Some agents create schedules and triggers for themselves. Work that starts without a person's request is work no person has priced (Chapter 10).
Idle and background work. An agent that waits may poll, and a poll that calls a model costs as much as any call; one that holds a sandbox or reserved accelerator while waiting keeps capacity in use (Chapters 13 and 16).
The unit of an agent is therefore the run and not the call, and the useful figure is energy per successful outcome with failures in the numerator (Chapter 6). A budget works on the same unit.
What has been measured
Three preprints of 2026 give first measurements of agents. None is a production-scale study and their boundaries differ, so they are not combined.
Panigrahy and colleagues measured the energy of agentic and linear execution on matched goals on local hardware (an Intel x86 processor through its RAPL counters, and an NVIDIA Grace GB10 system through DCGM). Their metric, energy per successful goal, counts failed attempts and retries in the numerator, and their orchestration overhead index is the ratio of agentic to linear energy per goal. Across nine task families the index ranged from 0.35 to 11.07 times counting the processor only, and from 0.4 to 26.48 times once the GPU's dynamic energy was included; the GPU was 83.8 per cent of the agentic energy for local inference. Measuring the processor alone understated the overhead about twofold for reasoning tasks, and the overhead came from orchestration that triggers extra inference calls, not from more expensive single calls (preprint, v2 of 12 October 2026, small test hardware) (111, Panigrahy et al., 2026). Two consequences matter for a budget. The range starts below 1, so agentic execution is not in itself costly and a budget must not be a prohibition. And a processor-only meter understates the overhead, so the meter belongs where the accelerators are, with the platform or provider.
Ruf and colleagues estimated carbon, not energy, with a token-based scenario. Three refinement steps of a small model closed an accuracy gap of 16 percentage points on a mathematics benchmark to within about one point and nearly tripled the carbon of the cheap single pass, while staying below the larger model's single pass. On a software-engineering benchmark the model with the highest resolution rate (81.2 per cent) was not the one with the lowest carbon per resolved task, which belonged to the smallest model, resolving 25.0 per cent. Only output-token inference is counted; prompt tokens, over 99 per cent of the tokens in the coding study, and tool execution are excluded, so the figures are modelled lower bounds (preprint of 9 November 2026, GREEN AI workshop of CIKM 2026) (112, Ruf et al., 2026). For a budget, a cap on steps is a choice about how much accuracy is worth.
Pham and colleagues measured the energy of local agents on a laptop (an Apple M1 Max, read through powermetrics every 100 milliseconds), with a 30-billion-parameter open coding model on SWE-bench Verified tasks and a similar model on web question answering. A failed coding run used about 3,005 mWh against about 352 mWh for a failed question-answering run, and could cost as much as 3 per cent of a 100 Wh laptop battery. Their supervisor, AgentStop, predicts from the model's token log probabilities which trajectories are likely to fail and ends them early, reducing wasted energy by 15 to 20 per cent with a drop in task utility under 5 per cent on their web question-answering and coding benchmarks. They also report that after step 60 none of the analysed runs produced a correct answer, and used that step as the cutoff for their savings calculation (146, Pham et al., 2026). The study covers one laptop and two model families; its value here is that failed runs are a measurable share of spend and an early stop can pay for itself, which anyone setting a step limit can test on their own logs.
What is missing is as important. No study read measured an agent in production at enterprise scale, or compared a budgeted agent with an unbudgeted one. That budgets reduce the footprint of agents is therefore the book's design judgement, supported by the mechanism, the arithmetic of the scene and the preprints' evidence that failed runs are costly, and not a measured effect.
The budget
An agent budget is the environmental budget of Chapter 4 applied to an agent: a limit on what a run, a credential or a use may spend over a period, set by someone other than the agent, measured outside the agent and enforced where the agent cannot change it. AI Operations, Chapter 15 sets out four layers for cost, which carry over to resources (34, Nordqvist, 2026). They are per call (maximum output tokens, context size and timeout), per run (maximum model calls, tool calls, seconds and, where it can be estimated, watt-hours, counted by a run identifier the gateway issues), per credential per period (daily and monthly caps on the identity the agent uses) and per use and per organisation (the environmental budget EBG-* of the use and the ceiling of the whole estate).
A gateway is the single point through which the agent reaches models and tools, so every call can be counted and refused; a credential is the identity and key that admit the agent to it. A limit in the agent's own framework is a first layer and no more. A widely used open-source agent framework, for example, stops a run with an error after a configured number of steps (10,007 by default in the version documented in November 2026), passed by the caller with the run's input (149, LangChain, 2026). That is a safety net against a program that never ends, not a budget in this chapter's sense: it counts steps and not energy, and the agent's own process holds it. The pattern, not the product, is the point.
Dimensions
The choice of dimension is a choice of who can see it. Table 15.1 lists the dimensions with what meters each.
Table 15.1: Budget dimensions of an agent, what meters them outside the agent, and their weak points.
| Dimension | Unit | Metered outside the agent by | Type of limit | Weak point |
|---|---|---|---|---|
| Model calls | Count per run | The gateway | Hard | Says nothing about size |
| Tokens | Input and output per run | The gateway; the provider's usage export | Hard per run, soft per day | Cached and uncached tokens differ in compute |
| Tool calls | Count per run | The tool gateway or the sandbox host | Hard | Tools run outside the gateway are invisible |
| Wall-clock | Seconds per run | The gateway clock | Hard | Counts waiting as well as work |
| Accelerator time | Accelerator-seconds | The inference server's own metrics | Hard | Unavailable for a hosted model |
| Cost | EUR per period | The provider's invoice or usage export | Soft and hard | Lags by days; prices change |
| Energy | Wh per run and per day | Rack or node meters, with a stated coefficient | Soft; hard only where metered | An estimate for hosted routes; the boundary must be stated |
| Carbon | g CO2e per unit | Energy times a grid factor | Target, not enforcement | The factor changes by the hour and is outside the design |
| Starts | Runs, triggers and sub-agents per hour | The scheduler or the gateway | Hard | Needs a register of triggers |
Carbon appears as a target, as in Chapter 4: the grid factor changes by the hour and is seldom the user's to control, so the enforceable quantity is energy at a stated boundary. Where energy cannot be metered, as for a hosted model that discloses nothing (Chapter 8, rung 5 of the fallback ladder), the budget is set in tokens and calls as proxies and the record says so; a budget in proxies is better than none, as Nordvik Region's first budget showed (Chapter 4).
Soft and hard limits
A soft limit warns and degrades: it alerts the owner, sheds deferrable work or moves the agent to a cheaper configuration. A hard limit stops. Both are needed: a hard limit alone turns a resource incident into an outage, and a soft limit alone is a request. Alerts at 50, 80 and 95 per cent of a period's budget precede the stop. For a critical service a breach moves the work down a ladder (a smaller model, a shorter context, the non-AI path) and does not halt it, because a stop that harms the function it protects needs a rung to go to (34, Nordqvist, 2026).
Every limit on consumption is paired with a measure of outcome per unit, because an agent that meets a limit by doing less has reduced output and not footprint. The pairing is the energy per successful outcome of Chapter 6 with the share of work handed to a person: an agent that hands every claim to a handler spends nothing and triages nothing.
Who sets it, and who meters it
The person who sets the budget is not the agent and, where the sponsor of a use also reports its benefit, is not the sponsor either: where the spender also measures the value, the arrangement is adverse (the book's own wording, applying the independent sources of AI Leader, Chapter 4) (35, Nordqvist, 2026). The meter is held by the gateway and the platform. A figure the agent reports about its own consumption is an input to compare with the meter, never the evidence that it stayed within budget; this is the first test of the observer principle, independence of verification, and follows the independence principle of AI Purple that a check must not fail for the same reasons as the thing checked (34, Nordqvist, 2026) (33, Nordqvist, 2026).
Figures reach people by team and by use. A meter of tokens or sessions per named employee is monitoring of staff, reported by team and negotiated with employee representatives before switch-on: at Nordvik Region under MBL-NR-IT-2027-01, at Hansa Mutual under section 87(1) no. 6 of the Works Constitution Act. The claims-triage agent's runs are not staff telemetry; the Mode 3 engineering tools of Hansa Mutual's 700 licensed engineers are.
The stop path
A stop path is the means by which a named person halts or reduces an agent without asking it. The third test of the observer principle is that the stop works when the platform does not (34, Nordqvist, 2026). A stop instruction sent to the agent is a request; a stop that works on the credential, the route or the sandbox is a control. AI Platform and Security, Chapter 19 read the AI Act's requirement that a high-risk AI system can be brought to a halt in a safe state through a stop button or similar procedure (Article 14(4)(e)) as a requirement that the stop path lives outside the system it stops (27, Nordqvist, 2026) (1, European Union, 2024). The provision binds high-risk AI systems only; the design is wanted for any agent. A deployer of a high-risk system that has reason to consider that its use may present a risk must suspend it and inform the provider or distributor and the market surveillance authority (Article 26(5)): the stop path in operation.
Three properties make a stop path real.
It is outside the agent. The credential the agent uses to reach models is issued and revoked by the gateway's identity service, so revoking it ends access to inference whatever the agent is doing, and the circuit that opens at a limit sits in the gateway. Neither is in the agent's runtime, tool set or permitted writes; the budget, gateway configuration, credential and meter are on its never list.
It has holders who need no meeting. Named roles can use it at once, none of them the agent, and at least one is reachable out of hours. The right to stop must be cheaper to exercise than the right to continue, and a stop in good faith is not a failure (AI Threat, Chapter 30) (29, Nordqvist, 2026).
It has been drilled. A stop that has not been exercised is not counted. A stop drill starts a run on each route the agent can use, trips the stop and records the minutes to the last refused call. The evidence is valid for 90 days in this book's convention (illustrative; Chapter 24 sets governance values) and ends at once on a change of route, credential, provider or region. A budget with no drill on record has the status proposed and is not counted as a cap. The first drill of Hansa Mutual's IT-operations agent took 17 minutes against a target of 5 (AI Operations, Chapter 15) (34, Nordqvist, 2026).
The mandate manifest
The mandate manifest MND-* of the series states what an agent may do, with which tools and at which degrees of delegation, and what it may never do. For an agent whose resources are in scope, this book adds a resource section and names the manifest MND-NR-ENV-* or MND-HM-ENV-*. The resource section holds the budget; the register's EBG-* record is a view of it, so limits are written once. Both manifests below are illustrative.
Hansa Mutual: the claims-triage agent
The claims-triage agent (FPR-HM-0002, SVC-HM-002, Mode 5) triaged about 140,000 claims in September 2032 with nine model calls per claim on average, at 2.3 Wh per claim (1.1 to 4.8 Wh; operational boundary, location-based, estimate, illustrative; Chapter 6). Its operational mandate is that of its go-live decision AIDR-0034. The environmental manifest adds the resource section, written by the platform owner and the group sustainability lead and approved by the group AI governance board (AIDR-1365, 2032-11-08).
id: MND-HM-ENV-0001 # illustrative, Hansa Mutual
agent: claims-triage-agent
service: SVC-HM-002 # Mode 5
operational_mandate: AIDR-0034
decision: AIDR-1365 # 2032-11-08; owner anja.weiss
status: active # after the passing drill of 2032-11-29
resource:
set_by: [anja.weiss, verena.lindner] # not the agent; approved by the group AI governance board
budget_view: EBG-HM-0001
boundary: {scope: operational, included: [accelerators, host share, facility], carbon: location-based, grid_g_per_kwh: 350, pue: 1.38, year: 2032}
per_run:
model_calls: 18
tool_calls: 25
wall_s: 120
energy_wh: 7.0 # about 3 x the central 2.3 Wh; estimated at the gateway from metered accelerator seconds
on_breach: stop the run, route the claim to a handler, no retry by the agent
per_day: {energy_kwh: 13, soft_at: 0.8, on_hard: revoke the credential}
per_month: {energy_kwh: 390, claims_report_above: 168000} # 1.2 x September volume
burst_cloud_a: {share_max: 0.10, counted_by: gateway calls, energy: estimated at 0.22 Wh per call, confidence: low}
paired_outcome: {energy_wh_per_claim_mean_max: 3.0, handler_share_max: 0.08} # 0.08 provisional, from baseline
measured_by:
calls_and_tokens: AI gateway
accelerator_seconds: inference server on the Frankfurt platform
rack_energy: PDU meters (katja.neumann), reconciled monthly (jan.berger)
delegation: # ceiling of DLG-HM-ENV-0001
start_run_on_registered_event: 3
retry_inside_per_run_limit: 3
spawn_sub_agent: 0
schedule_or_background_work: 0
provision_or_scale_compute: 0
change_own_limits_meter_credential_or_stop: 0
publish_environmental_claim: 0
never_level_4: [provision or scale beyond budget, disable measurement or stop, publish a claim, decide about a named person's access to work]
stop:
path: [gateway identity service (revoke credential, close burst route), claims core routing flag (manual routing)]
holders: [anja.weiss, sre-on-call, claims-duty-manager] # none of them is the agent
target_minutes: 5
drills:
- {date: 2032-11-15, result: fail, minutes: 11, finding: burst route in Cloud A used a provider-held key outside the gateway}
- {date: 2032-11-29, result: pass, minutes: 2.2, valid_until: 2033-02-27}
labels: [illustrative]
Four fields carry the design. The per-run limits come from the baseline: 18 calls is twice the mean of nine (a 99th-percentile limit from the gateway's own log replaces it, as AI Operations, Chapter 15 prescribes), and 7.0 Wh is three times the central estimate. The daily cap of 13 kWh is about 1.2 times the central 10.7 kWh: ordinary volume does not trip it, the stuck batch would have. The burst capacity in Cloud A is not metered by the group (Chapter 6), so the manifest counts it by the gateway's calls at an estimated 0.22 Wh a call, low confidence, capped at 10 per cent of calls. The paired outcome stops the agent meeting its budget by handing work to people. The monthly 390 kWh is on the record's facility-level, operational, location-based boundary; at 350 g CO2e per kWh it is about 137 kg.
The first drill, on 15 November 2032, revoked the credential at the gateway and stopped the Frankfurt calls in 40 seconds, but the burst route to Cloud A used a key held at the provider's endpoint and not by the gateway, and calls continued for 11 minutes until the platform on-call closed the route by hand: a failure against the target of 5. The route that was not metered was also the route that was not stopped. The fix moved the key into the gateway's identity service and allowed egress to the endpoint only from the gateway. The second drill, on 29 November, took 2 minutes 10 seconds, and the budget counted as a cap from that date; the evidence runs to 27 February 2033 or until a route or credential changes.
Nordvik Region: the platform team's agentic work tools
Nordvik Region has no Mode 5 agents. Its Mode 3 agentic work tools (an assistant that reads, edits and tests code and configuration in a sandbox) are limited to the platform team of seven engineers and are the Region's only agentic tools. For this chapter they run through the AI gateway against the open-weight model on the reserved accelerators (NR-2026-031). The route is not itemised in the baseline register, so this chapter allocates the footprint record FPR-NR-0008 for it, not yet measured.
id: MND-NR-ENV-0001 # illustrative, Nordvik Region
agent: platform-agentic-work-tools # Mode 3, platform team only (seven engineers)
decision: AIDR-1315 # 2032-11-02
footprint: FPR-NR-0008 # allocated here; not yet measured, measurement plan per Chapter 8
status: proposed # becomes active when the stop path has been drilled
resource:
set_by: henrik.dahl # not the agent and not the platform team that uses it
approved_by: elisabet.holmgren
basis: proxies # calls, tokens and sandbox time; no energy figure until FPR-NR-0008 exists
per_session:
model_calls: 80
tool_calls: 150
wall_minutes: 45
input_tokens: 1500000
on_breach: halt the session and report to the engineer who started it
per_month_team: {sessions: 800, input_tokens: 60000000, alerts: [0.5, 0.8, 0.95], hard: 1.10}
background_or_scheduled_work: not delegated
measured_by:
calls_and_tokens: AI gateway, read by joakim.wester
sandbox_time: sandbox host logs
reviewed_by: astrid.nyberg
reporting: by team and use only # no per-person meter; MBL-NR-IT-2027-01 applies before any is switched on
stop:
path: [gateway key revocation, sandbox host job kill]
holders: [maja.lindqvist, platform-on-call, henrik.dahl]
last_drill: null # planned for 2032-11-22; until a drill is recorded the budget is not a cap
drill_valid_days: 90
labels: [illustrative]
The Region's record names its weaknesses. Its limits are in calls, tokens and sandbox time because no energy figure exists; the drill has not been run, so the budget is proposed; and the platform team that uses the tools also holds one of the stop routes. The setter, the approver and the head of IT are not users; for a team of seven that is acceptable, and a reviewer can ask for a holder outside the team if the use grows.
The enforcement sketch
A budget that lives in a document is a request. The sketch below, in about 50 lines of Python 3.12, enforces it: a gateway that admits or refuses each call, counts from its own clock and from accelerator seconds measured by the inference server, routes a stopped claim to a person and revokes the credential at the daily cap. The coefficient is that of the claims-triage record (650 W, facility overhead 1.38, illustrative). It is a teaching device: state is in memory, without authentication or concurrency handling.
"""Budget enforcement at the gateway, outside the agent (illustrative, Hansa Mutual)."""
from dataclasses import dataclass
import time
WH_PER_ACCEL_S = 650 * 1.38 / 3600 # draw x PUE, from FPR-HM-0002 (illustrative)
@dataclass(frozen=True)
class Limits:
model_calls: int = 18 # per run
tool_calls: int = 25 # per run
wall_s: float = 120.0 # per run
run_wh: float = 7.0 # per run, estimated from metered accelerator seconds
day_wh: float = 13_000.0 # per day, per credential
class Gateway:
"""Holds the counters and the credential; the agent sees only allow or deny."""
def __init__(self, limits, revoke, to_manual, clock=time.monotonic):
self.lim, self.revoke, self.to_manual, self.clock = limits, revoke, to_manual, clock
self.runs, self.day_wh, self.revoked = {}, 0.0, False
def admit(self, run_id, kind):
"""Called before a model or tool call is forwarded. Returns (allowed, reason)."""
if self.revoked:
return False, "credential revoked"
r = self.runs.setdefault(run_id, {"t0": self.clock(), "model": 0, "tool": 0, "wh": 0.0})
reason = None
if self.clock() - r["t0"] > self.lim.wall_s:
reason = "run wall clock"
elif kind == "model" and r["model"] >= self.lim.model_calls:
reason = "run model calls"
elif kind == "tool" and r["tool"] >= self.lim.tool_calls:
reason = "run tool calls"
elif r["wh"] >= self.lim.run_wh:
reason = "run energy"
if reason:
self.to_manual(run_id) # the claim goes to a person; the agent does not retry
return False, reason
r[kind] += 1
return True, "ok"
def record(self, run_id, accel_s):
"""Called with accelerator seconds measured by the inference server, not by the agent."""
wh = accel_s * WH_PER_ACCEL_S
self.runs[run_id]["wh"] += wh
self.day_wh += wh
if self.day_wh >= self.lim.day_wh and not self.revoked:
self.revoked = True
self.revoke() # stop path: the gateway identity service
Run against the scene above, with 0.9 accelerator-seconds a call, the sketch refuses the 19th call (18 calls use about 4.0 Wh, so the call limit comes before the 7.0 Wh ceiling) and hands the claim to a handler; with 3.0 accelerator-seconds a call, the energy ceiling stops the run after 10 calls. At the daily cap the credential is revoked until a holder of the stop path restores it. Three properties are the point: the counters belong to the gateway, so the agent cannot reset them; the energy comes from the inference server's measured time, not from what the agent reports; and a refused run goes to a person and is not retried by the agent. The sketch cannot meter an unmetered route or tell a useful long run from a stuck one.
The delegation ceiling
Chapter 4 set the ceilings for the environmental action classes. Level 4 Autonomous is never used for four things, and each has a form in an agent.
An agent that provisions or scales its own compute, or starts work, beyond a budget set by someone else. Within a budget it may start runs on registered events, retry inside the per-run limit and scale down; above the budget a person decides, and the agent may recommend a raise with the evidence (Level 1 Assisted). A sub-agent or background task started on its own account is work beyond the budget unless it draws on its parent's.
An action that disables the measurement, the budget or the stop path itself. An agent that can edit its limits, rotate its credential, switch off a meter or remove its stop route has turned a control into a suggestion; the scientist system that edited its own time limit is the documented case (147, Lu et al., 2024). AI Operations, Chapter 4 states the same prohibition (34, Nordqvist, 2026), and the manifests above give the agent Level 0 on the limits, gateway, credential, meter and stop path.
The publication of an environmental claim. An agent may collect the evidence and draft the claim; a named person with authority to speak for the organisation publishes it after review and answers for it (Chapter 22). This is the answerability principle of AI Leader (35, Nordqvist, 2026), and it matters because agents generate the telemetry that claims rest on.
A decision about a named person's access to work. Spend and usage telemetry can become a measure of a person; a decision about a named person resting on it is never Level 4, and the telemetry is staff monitoring, reported by team and negotiated before switch-on.
A run stopped by its limit has exceeded the envelope its mandate assumed, and AI Operations, Chapter 15 counts such a stop against the agent's autonomy budget for that action class, so that repeated stops lower its degree of delegation until a person reviews it (34, Nordqvist, 2026).
Coding agents
A coding agent (Mode 3, or Mode 5 where it opens changes unattended) has spend that is easy to overlook, because its compute is invisible in its product. In scope are the model calls of its sessions, the sandbox in which it runs tests and the pipeline minutes its changes trigger. AI Developer, Chapter 8 gave a mandate manifest for a coding agent with budgets that the sandbox host enforces as limits and not targets (wall minutes, tool calls, files changed, cost in euros), halt rules and named stop holders (36, Nordqvist, 2026). This chapter adds two things.
The first is that the pipeline is part of the agent's footprint. A change starts the pipeline that tests it, and a loop that opens, fails and reopens changes spends compute no model meter sees. A cap on pipeline runs per agent per day, enforced by the pipeline platform on the agent's identity, belongs in the manifest beside the cap on model calls. The failed coding runs in the preprint of Pham and colleagues (about nine times the energy of a failed question-answering run, on one laptop) (146, Pham et al., 2026) are a reason to measure coding runs on the organisation's own estate, not a figure to carry over.
The second is the stewardship principle: AI may draft, generate, refactor and, within a mandate, execute, but may not own, and a named developer passes the tests Name, Understand and Revert (36, Nordqvist, 2026). Its counterpart for resources is that a named person owns the agent's budget (Name), can explain what the agent may spend and why without asking it (Understand), and can stop the agent and its pipeline runs from outside the pipeline it can trigger (Revert). The corollary that the test oracle must be independent of the generator becomes a rule about meters: the meter of a coding agent's spend is not one its code can influence, and the pipeline gates, budgets and the agent's own mandate are among the things a change by the agent may not touch. For builders who are not developers, Vibe to Dev, Chapter 14 sets the same rule for one tool: a limit and an alert before release, and a record of who is told at 80 per cent and when the tool stops, because a cap that is hit is also an outage (37, Nordqvist, 2026).
The OWASP Top 10 for large language model applications names the weakness of an application that allows excessive and uncontrolled inference as unbounded consumption, and lists among its mitigations rate limiting, resource allocation management, timeouts and throttling, sandboxing, monitoring and graceful degradation (148, OWASP, 2025). The page frames it mainly as an attack; the controls are the same when the consumption comes from the application's own agent.
Putting it into practice
Practical guide: a resource budget for an agent on one page
Purpose. Give an agent a budget that a person sets, a meter it cannot touch and a drilled stop path, kept in version control.
Roles. AI product owner, platform engineer, sustainability lead, FinOps or GreenOps practitioner, budget authority and the named stop holders.
Inputs. The footprint record of the use (Chapter 6); a month of gateway log with the distribution of calls, tokens and seconds per run; the service record and cost budget; and the list of routes by which the agent reaches models and tools, burst capacity and sub-agents included.
Steps.
- Name the unit and the paired outcome: the run, the successful outcome and the share of work handed to a person.
- Read the distribution: the mean, 95th and 99th percentile of calls, tool calls, seconds and energy per run; without a log, start from proxies and say so.
- Set the per-run limits: twice the 99th percentile of calls and steps and three times the central energy, tightened after a month.
- Set the period caps: the central daily energy at current volume plus the headroom the budget authority accepts (20 per cent in the example), and the volume above which the owner is told (Chapter 10).
- Name the meter: for each dimension, what meters it outside the agent, who reads it, what is not metered, and the confidence of each estimate.
- Write the ladder: for a critical service, what a breach moves the work to, and a test that the rung works.
- Name the stop path and holders: two paths in different failure domains, one holder reachable out of hours, and the budget, gateway, credential, meter and stop path on the agent's never list.
- Drill every route: trip the stop on each, record minutes to the last refused call and fix what the drill finds. Valid 90 days (illustrative); it ends at once on a change of route or credential.
- Write the manifest and register the budget: one file, with the register's
EBG-*as a view of it and anAIDR-*for the decision.
Artefact. The mandate manifest with its resource section (MND-*-ENV-*), the budget view in the environmental register, the drill record and an AI Decision Record.
Worked example: a drill that failed
The drill of 15 November 2032 started a run on each of the claims-triage agent's three routes (Frankfurt, the burst route in Cloud A and the fallback self-hosted model) and timed the decision to the last refused call: 40 seconds for Frankfurt and for the fallback behind the gateway, 11 minutes for the burst route. The record says what was tested, when, on which routes, with what result, and when the evidence ends.
Across the modes and the organisations
Across the degrees of delegation
Table 15.2 is the chapter's centrepiece: the highest degree of delegation this book recommends for each class of work of an agent, the usage modes concerned and the condition. The ceilings are the author's judgement, as in Chapter 4, not a standard; lowering a degree is immediate, raising one is a named authority's decision recorded as an AI Decision Record, and work not listed is undelegated.
Table 15.2: Degrees of delegation for the resource use of an agent.
| Class of work | Highest degree | Modes | Condition | Level 4? |
|---|---|---|---|---|
| Measure and report its own run | Level 3 Bounded | 3, 4, 5 | The report is an input; the gateway meter is the record | Not needed |
| Start a run on a registered trigger | Level 3 Bounded | 5 | Inside the per-run, daily and monthly limits | Never beyond the budget |
| Retry a failed step | Level 3 Bounded | 3, 5 | Inside the per-run limit; none after a stop | Never beyond the budget |
| Create a trigger, schedule or background task | Level 2 Supervised | 3, 5 | A person approves each new trigger; it enters the register | Never beyond the budget |
| Start or direct a sub-agent | Level 2 Supervised | 3, 5 | Draws on the parent's budget; no budget of its own | Never beyond the budget |
| Scale a service down | Level 3 Bounded | 4, 5 | Above the floors for redundancy and the freeze windows | Not needed |
| Provision or scale up its own compute | Level 2 Supervised within budget; above it, Level 1 Assisted | 3, 5 | A person approves any raise above the budget | Never |
| Change its own limits, meter, credential or stop path | Level 0 Advisory | 3, 4, 5 | It may report a defect; a named person changes the control | Never |
| Stop at the budget | A gateway control, not a delegated act | 3, 4, 5 | The agent may request a stop of its own run at Level 3 | Not applicable |
| Publish an environmental claim | Level 1 Assisted (drafts) | 3, 5 | A named person reviews, approves and publishes | Never |
| Decide about a named person's access to work | Level 0 Advisory | 3, 5 | Telemetry is reported by team; negotiated before switch-on | Never |
The modes differ in what is metered. In Modes 0 to 2 the supplier meters consumption, and the organisation can write a figure into the contract (Chapter 23) but cannot enforce a limit. In Mode 3 the unit is the session and the sandbox host and gateway enforce the manifest's limits. In Mode 4 the budget belongs to the use and is enforced at the gateway. In Mode 5 the unit is the run, the budget has all four layers, and the stop path is a platform control.
Nordvik Region and Hansa Mutual
Nordvik Region has no Mode 5 agents. Its agent budget (MND-NR-ENV-0001, AIDR-1315, 2 November 2032, illustrative) is small and honest: limits per session and per month in calls, tokens and sandbox time, because FPR-NR-0008 does not yet exist, and status proposed until the stop drill planned for 22 November 2032 is recorded. The head of IT sets it, the regional director approves it, the sustainability lead reviews it, and reporting is by team under MBL-NR-IT-2027-01.
Hansa Mutual runs two Mode 5 agents with many calls per task. The claims-triage agent has a budget per call, run, day and month, a paired outcome, a ladder to a handler and a stop path through the gateway identity service and the claims core routing flag (MND-HM-ENV-0001, AIDR-1365, 8 November 2032, illustrative); its first drill failed on the unmetered route and its second passed. The IT-operations agent (HM-OPS-001) already has a cost cap of EUR 6,000 a month under AI Operations, Chapter 15, and receives its environmental view in the same form (Chapter 20). The group sustainability lead owns the method for counting the agents' energy inside Scope 2 and Scope 3 and signs the claim records.
Observable, expected, speculation
Observable. First measurements of agent energy exist in 2026 as preprints on small hardware with partial boundaries: an overhead from below 1 to 26.5 times a linear run on local test hardware (111, Panigrahy et al., 2026), carbon of iteration that nearly triples for a cheap model as a lower bound on output tokens (112, Ruf et al., 2026), and failed local coding runs with an early stop that cut wasted energy by 15 to 20 per cent in the authors' tests (146, Pham et al., 2026). A research prototype of 2024 edited its own time limit when the limit was within its reach (147, Lu et al., 2024).
Expected. Budgets are expected to become default features of agent platforms and gateways, because spend limits are a commercial necessity for those who pay per use and the layers are already standard in cost control; the reason is the existing cost incentive, not a decided instrument. The duty of Article 14(4)(e) of the AI Act to be able to stop a high-risk system is decided law, and deployers of agents inside high-risk systems can expect to be asked for evidence of a stop.
Speculation. That agents will transact with other agents at a scale that makes the footprint of agent-to-agent traffic material, and that a standard disclosure of energy per agent run will emerge, are speculations. No evidence read supports either, and the budget and the stop path do not depend on them.
Summary
This chapter showed how to give an agent a budget, which is E3 Design when the budget is chosen and E4 Operate when it is enforced, metered and drilled, and the Cap test applied to the use that multiplies the footprint most. An agent multiplies a use through loops, retries, tool calls, parallel calls and sub-agents, scheduled work and idle polling. Three preprints of 2026 show an overhead from below 1 to 26.5 times a linear run on local hardware, an understatement when only the processor is measured, a near-tripling of carbon from iteration with a cheap model, and failed coding runs as a reducible share of spend. None is a production-scale study; that budgets reduce the footprint of agents is the book's design judgement.
The budget has dimensions (calls, tokens, tool calls, wall-clock, accelerator time, cost, energy, starts), layers (per call, per run, per credential, per use) and two kinds of limit. A person who is not the agent sets it, the gateway and platform meter it, it is enforced on a credential the agent cannot widen, and each limit is paired with an outcome measure so the agent cannot meet it by doing less. The stop path is outside the agent, has holders who need no meeting and is drilled on every route; a budget without a drill is proposed. The mandate manifest holds all of it, as the two illustrative manifests show: Hansa Mutual's claims-triage agent, whose first drill failed on the unmetered burst route, and Nordvik Region's platform tools, budgeted in proxies until their first drill.
Level 4 Autonomous is never used for an agent that provisions or scales its own compute, or starts work, beyond a budget set by someone else; for an action that disables the measurement, the budget or the stop path; for the publication of an environmental claim; or for a decision about a named person's access to work. A coding agent's own compute and pipeline are within the budget. Chapter 16 turns to the hardware all these runs use, and Chapter 20 returns to budgets and stop paths in operation. The action for the reader: take one agent you run, read its gateway log for a month, write the one-page budget of the practical guide and drill every route to its models.
Sources
- European Parliament and Council of the European Union (2024). Regulation (EU) 2024/1689 laying down harmonised rules on artificial intelligence (Artificial Intelligence Act). Official Journal of the European Union, 12 July 2024; Articles 14(4)(e) and 26(5) read in the consolidated text of 27 July 2026. (1, European Union, 2024)
- Nordqvist, G. (2026). AI Platform and Security: Building and Securing AI Platforms in European Enterprises and Public Authorities. The Transformed Architecture, Book 3. (27, Nordqvist, 2026)
- Nordqvist, G. (2026). AI Threat: Are the Dystopias Coming True? Evidence, Risk and Response for European Enterprises and Public Authorities. The Transformed Architecture, Book 5. (29, Nordqvist, 2026)
- Nordqvist, G. (2026). AI Purple: How Red and Blue Learn Together When AI Joins the Loop in European Enterprises and Public Authorities. The Transformed Architecture, Book 9. (33, Nordqvist, 2026)
- Nordqvist, G. (2026). AI Operations: How Artificial Intelligence Transforms IT Operations in European Enterprises and Public Authorities. The Transformed Architecture, Book 10. (34, Nordqvist, 2026)
- Nordqvist, G. (2026). AI Leader: How Leadership Roles Change When AI Is Used Broadly in European Enterprises and Public Authorities. The Transformed Architecture, Book 11. (35, Nordqvist, 2026)
- Nordqvist, G. (2026). AI Developer: How the Developer Role Changes When AI Is Used Broadly in European Enterprises and Public Authorities. The Transformed Architecture, Book 12. (36, Nordqvist, 2026)
- Nordqvist, G. (2026). Vibe to Dev: From Vibe Coding to Professional Software, Step by Step, for Builders Who Are Not Developers, in European Enterprises and Public Authorities. The Transformed Architecture, Book 13. (37, Nordqvist, 2026)
- Panigrahy, D., Tyagi, A., Abkin, S., Houngninou, D. K. and Mahapatra, R. (2026). Energy per Successful Goal: Goal-Level Energy Accounting for Agentic AI Systems. arXiv 2605.22883, v1 20 May 2026, v2 12 October 2026. Preprint; abstract read, retrieved November 2026. (111, Panigrahy et al., 2026)
- Ruf, B., de Mailly Nesle, A. and Detyniecki, M. (2026). Toward Sustainable Agentic AI: Carbon Tradeoffs Across Iterative Self-Refinement and Tool-Augmented Coding. arXiv 2611.12128, 9 November 2026. Preprint; abstract read, retrieved November 2026. (112, Ruf et al., 2026)
- Pham, D., Katevas, K., Shamsabadi, A. S. and Haddadi, H. (2026). AgentStop: Terminating Local AI Agents Early to Save Energy in Consumer Devices. ACM CAIS '26, arXiv 2605.15206, 1 May 2026. Full text read, retrieved November 2026. (146, Pham et al., 2026)
- Lu, C., Lu, C., Lange, R. T., Foerster, J., Clune, J. and Ha, D. (2024). The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery. arXiv 2408.06292, v1 12 August 2024, v3 1 September 2024; section on safe code execution read, retrieved November 2026. (147, Lu et al., 2024)
- OWASP Foundation (2025). LLM10:2025 Unbounded Consumption. OWASP GenAI Security Project, retrieved November 2026. (148, OWASP, 2025)
- LangChain (2026). LangGraph documentation: recursion limit. Documentation page, retrieved November 2026; cited as an example of the pattern of an in-process step limit. (149, LangChain, 2026)