Skip to content
atom®technologiesBook a call
Production AI

AI agent in production: the per-step launch checklist for spend, fallback and human review

Before an AI agent goes to production, give each step one of three launch modes: autonomous, fallback-only, or human review. Three tests set the mode: a spend ceiling, a forced-fallback proof, and a side-effect check.

A packed auditorium during a technology keynote
The short answer

Assign every agent step a launch mode before it ships: autonomous, fallback-only, or a human review queue. Three tests set the mode: a spend ceiling from real prices and rate limits, a forced-fallback test with recorded attribution, and a side-effect check. A step with a non-idempotent side effect and no idempotency key starts behind human review.

The decision: a launch mode for every step

Before an AI agent goes to production, assign each step one of three launch modes: autonomous, fallback-only, or a human review queue, set by three tests rather than confidence: a spend ceiling from real prices and rate limits, a forced-fallback test with recorded attribution, and a side-effect check for idempotency. A step with a non-idempotent side effect and no idempotency key starts behind human review. This gate is our proposal; the sources support the mechanics, not the rule.

The decision is made per step, not per agent. An agent that reads a document, calls a model, then writes to a billing system is three steps with three different risk profiles, and a single launch decision for the whole agent hides the one step that can charge a customer twice. The failure mode is predictable: a team launches the agent autonomous because the demo worked, a transient error triggers a retry, and the side effect lands twice. The Amazon Builders' Library article on idempotent APIs describes exactly this pattern for service calls, and we extend its reasoning to agent steps as an inference, not as something the article claims.

The evidence that settles the decision is recorded before launch, in three parts: a written spend ceiling per step, a fallback test with attribution, and a side-effect classification. Who owns each part is a decision you should also write down: one engineer owns the spend ceiling, one owns the fallback test, and one reviewer owns the side-effect classification and the launch-mode assignment. The recommendation changes if a step is read-only with no external side effect, in which case the side-effect test is trivially satisfied and the step may launch autonomous once the spend and fallback tests pass.

Diagram: AI agent in production: the per-step launch checklist for spend, fallback and human review. 1. Spend ceiling: a price list is not a budget to Fallback proof: configuration is not evidence; 2. Fallback proof: configuration is not evidence to Side effects: the test that decides human review; 3. Side effects: the test that decides human review to Launch mode by agent step.

Spend ceiling: a price list is not a budget

Cloudflare's Workers AI pricing page states that Workers AI is priced at $0.011 per 1,000 Neurons, with a free allocation of 10,000 Neurons per day; usage above that requires the Workers Paid plan. The page also lists per-model token prices, for example $0.045 per million input tokens and $0.384 per million output tokens for the model Cloudflare names @cf/meta/llama-3.1-8b-instruct-fp8-fast. The same page states that limits reset daily at 00:00 UTC and that exceeding a limit causes further operations to fail with an error.

A per-step spend ceiling cannot be computed from a per-token price alone. This is our inference from the Cloudflare documents: you also need the expected input and output token volume per task, the number of tasks per time window, and the applicable rate limit, because the rate limit determines whether your traffic can even reach the spend you budgeted. Cloudflare's Workers AI limits page states that text generation carries a default limit of 300 requests per minute unless the model requires the Workers Paid plan, and that paid models are limited per account and per model to 20 requests per minute under standard Workers AI billing, or 50 requests per minute with prepaid AI Gateway credits. The limits page also states that beta models may have lower rate limits.

The concrete check: for each agent step, write a dollar ceiling per task and per time window, derived from the model's published price, your expected token or Neuron volume, and the rate limit for your billing mode. If the step runs on a beta model, check its model page for a lower limit before you trust the default. The ceiling is a number a reviewer can compare against actual usage, not a feeling that the model is cheap.

Fallback proof: configuration is not evidence

Cloudflare's AI Gateway fallbacks page states that Cloudflare can trigger a fallback provider in response to request errors or predetermined request timeouts, and that the response header cf-aig-step indicates which step successfully processed the request: 0 means the primary model was used, 1 means the request fell back to the second model, and each further fallback increments the step number.

A fallback configured to trigger on errors or timeouts does not by itself show that the fallback model has enough rate-limit headroom or its own spend ceiling for the traffic. This is our inference from reading the AI Gateway fallbacks page against the Workers AI limits page: the fallback mechanism is documented separately from the limits, so we propose the fallback path gets its own capacity check. If your primary model runs under prepaid credits at 50 requests per minute and your fallback runs under standard billing at 20, the fallback can become the new bottleneck the first time the primary fails under load.

The concrete check: before launch, force a request error and a timeout against the step, and confirm from cf-aig-step that the fallback actually processed the request. Record the fallback model's rate limit and spend ceiling next to the primary's. Keep those records; they are the evidence that changes the step's launch mode later. Note that these documents describe Cloudflare's own product; they are not independent evidence that another provider's fallback or limits behave the same way.

Side effects: the test that decides human review

The Amazon Builders' Library article states that retrying a service call as mitigation for a transient fault rests on a simplifying assumption: that the operation can be retried without side effects. The article states that the goal is to make sure the result of the call happens only once, even if the call is made multiple times. It gives the example of an EC2 instance launch workflow where retrying a failed call to create an EBS volume could end up with two volumes, and a case where an ambiguous timeout forces the caller into a reconciliation to determine whether the workload is running at all.

Applying this to agent steps is an inference, because the Amazon article is about service APIs, not AI agents. But the mechanism transfers: an agent step that sends an email, creates a charge, writes to a ledger, or provisions a resource has the same duplicate-risk under retry that the EC2 example has. For such a step, an ambiguous timeout followed by a retry can duplicate the effect unless the step carries an idempotency key or a reconciliation check.

The rule we propose: put a step behind a human review queue at launch if its side effect is non-idempotent and the team has not implemented an idempotency key or a reconciliation check. Move it out of the queue only after the spend ceiling, the fallback test and the side-effect test all pass on production-like traffic. For framing, NIST's AI Risk Management Framework page, in its January 26, 2023 announcement, describes guidance that aims to improve the trustworthiness of AI and is intended for voluntary use. The page we reviewed is an overview of the framework's aims, so treat the human-review rule as our proposed gate, not a standard requirement.

Launch mode by agent step

The format below is our proposal, not a source's. Fill one row per step before launch.

Step: read-only retrieval or summarization. Launch mode: autonomous, once spend and fallback tests pass. Evidence to record: spend ceiling, forced-fallback result with the cf-aig-step value, confirmation the step writes nothing externally.

Step: model call that drafts content a person already reviews downstream. Launch mode: fallback-only. Evidence to record: spend ceiling for primary and fallback, fallback rate limit, timeout fallback confirmed.

Step: non-idempotent write, such as a charge, an email, or a ledger entry, with no idempotency key. Launch mode: human review queue. Evidence to record: side-effect classification, the missing idempotency key or reconciliation check, and the test results required before a mode change.

Step: non-idempotent write with an idempotency key and a reconciliation check. Launch mode: fallback-only, moving to autonomous after the duplicate-injection test passes. Evidence to record: the key's behavior under a forced ambiguous timeout.

Who owns the gate and when it changes

Ownership should be explicit and written. We propose: the engineer building the step owns the spend ceiling and the fallback test; a second engineer or the tech lead owns the side-effect classification; and one named reviewer signs the launch-mode assignment. If you run the work as a managed team run by our tech lead, that sign-off sits with the tech lead, who owns code review, quality and releases; if you use developers in your team, your engineering manager directs the work and the sign-off should sit on your side. The two models also differ in how they end: a developer in your team needs 30 days' notice after the initial term, while a managed team needs 30 days' notice to remove one person and 60 days to end the team.

The conditions that change the recommendation are concrete. A step moves from the review queue toward autonomy only when all three tests pass on production-like traffic, with the results recorded. A step drops back a mode when the model changes, when the prompt materially changes, when expected volume grows past the tested rate limit, or when a fallback test stops showing the expected cf-aig-step value. Re-run the three tests on any of those changes; a launch-mode assignment made against last quarter's model and volume is stale evidence.

The checklist

  1. List every step in the agent and classify each as read-only or side-effecting, naming the exact external effect (charge, email, ledger write, resource creation).
  2. For each step, write a dollar spend ceiling per task and per time window, derived from the model's published price and your expected token or Neuron volume.
  3. Confirm which billing mode applies to each model you use; Cloudflare states paid models are limited to 20 requests per minute under standard billing and 50 with prepaid AI Gateway credits.
  4. Check whether any model you rely on is beta, since Cloudflare states beta models may have lower rate limits.
  5. Confirm what happens when a limit is hit: Cloudflare states free-allocation limits reset daily at 00:00 UTC and that exceeding a limit makes further operations fail with an error.
  6. Force a request error against each step and confirm the cf-aig-step response header shows the fallback step number, not 0.
  7. Force a predetermined timeout against each step and confirm the timeout fallback fires and is attributed in cf-aig-step.
  8. Record the fallback model's own rate limit and spend ceiling next to the primary's, and check the fallback is not the tighter bottleneck.
  9. For every side-effecting step, verify an idempotency key or a reconciliation check exists in code, not in intent.
  10. Inject an ambiguous timeout into a side-effecting step in a test environment and verify the retry does not duplicate the effect.
  11. Assign each step a launch mode (autonomous, fallback-only, human review queue) in writing, with the three test results attached as the justification.
  12. Name the person who signs the launch-mode assignment and the person who signs any later mode change.
  13. Define in writing which events force a re-run of the three tests: model change, prompt change, volume growth past the tested rate limit, or a failed fallback check.
  14. Keep the fallback test records and spend ceilings in the repository or runbook the team actually uses, so the evidence survives personnel changes.

Questions

How much should I budget per agent step on Workers AI?

Cloudflare's pricing page states $0.011 per 1,000 Neurons above the free allocation of 10,000 Neurons per day, plus per-model token prices such as $0.045 per million input and $0.384 per million output tokens for the fp8-fast 8b model. In our inference, the price list alone does not give a budget; you also need your expected token volume and the rate limit for your billing mode.

Does configuring a fallback make a step safe to run autonomously?

Cloudflare's AI Gateway documentation states fallbacks trigger on request errors or predetermined request timeouts, with cf-aig-step showing which step processed the request. Whether that makes a step safe is a separate question. In our inference, spend, rate-limit headroom on the fallback path and duplicate side effects under retry sit outside what the fallback mechanism addresses, so they need the other two tests.

Do these rate limits apply to other inference providers?

The limits cited here are Cloudflare's own, from Cloudflare's documentation. They describe Cloudflare's product, not general provider behavior. Check your provider's published limits separately.

How long should a step stay in the human review queue?

Our proposal is until the spend ceiling, fallback test and side-effect test all pass on production-like traffic, with results recorded. How long that takes depends on the idempotency work and the tests, not on a fixed timeline.

What if a step has no side effects at all?

If a step only reads or summarizes and writes nothing externally, the side-effect test is satisfied trivially. Under our proposed gate it can launch autonomous once the spend and fallback tests pass.