Guide

Budgeting an AI coding agent on Amazon Bedrock.

An agent spends your money through your own AWS account. This guide explains the layers that limit it, what each one can actually stop, and why the AWS bill remains the authority.

What drives the cost

On Amazon Bedrock you pay AWS for model usage under AWS’s published pricing, which varies by model. An agent that explores, plans, implements, verifies and reviews makes several model calls per task, so the choice of model for each stage matters. Topsoil routes each stage to the model you choose; a smaller model can explore while a stronger one implements.

Three layers, each doing what it can actually do

LayerSet byWhat it does
Run and loopThe person or scheduler running itCaps one /task, /goal or /loop pass, and a loop’s total of ten times its per-fire ceiling. An unattended run will not start without one.
Monthly user and accountYour admin, in one policy file in your own S3 bucketChecked before every model call, so a request over the limit is not sent. Per-user limits override a default. A warn mode measures before anyone is refused.
AWS budget and deny policyYour admin, from a CloudFormation template Topsoil providesAn AWS budget action attaches a Bedrock deny policy to the Topsoil role when the budget trips. AWS billing data lags by hours, so this is a backstop, not an instant breaker.

Stated honestly

  • A budget Topsoil enforces stops Topsoil. It does not stop Bedrock, because anyone holding bedrock:InvokeModel can call the API another way. That is why the AWS layer exists.
  • Dollar figures in Topsoil are its own estimate; the AWS bill is the authority.
  • Today the monthly policy is edited as a file, or with a budget script for customers Thazen runs it for. There is no admin screen for raising limits.
  • A turn already under way is never cut off; the check happens before the next call.

For schedulers and CI

A budget stop exits with code 3, distinct from a failure (1) or a run that did not start (2), so a scheduler knows that retrying changes nothing until the budget is raised or resets.

See it against your own codebase.

A pilot runs in your own AWS account, with your models and your material, and ends with findings you can act on.