Who in your organization is spending how much on generative AI, and can that spending be stopped automatically at a limit? Amazon Bedrock cost tracking answers both questions with AWS features that already exist: per-identity attribution, billing reports and budget-triggered restrictions.
Amazon Bedrock is AWS’s managed service for calling AI models. AWS published a guide describing how to attribute its costs to individual IAM principals and enforce caps using AWS Budgets, with no application code needed for the common case. An IAM principal is simply the identity making a request: an IAM user or an IAM role, which is a set of permissions that people or applications can assume.
What problem does this approach solve?
AWS opens its guide by noting that generative AI spend is hard to attribute. Before expanding AI access, finance and technology leaders typically want three answers: what each person or team spends, whether spending can be capped, and how much effort it takes to get there.
An earlier AWS post described how Jamf built a custom enforcement loop using IAM Identity Center, Amazon Athena queries over Bedrock invocation logs, and AWS Lambda functions. AWS says that design gives near-real-time control but leaves the organization owning and operating code. The new guide targets teams that prefer to stay entirely within AWS-native features.
How does the three-part setup work?
AWS describes the solution as attribute, report, enforce.
Attribute: knowing who made each call
According to AWS, Amazon Bedrock automatically records the IAM user or role behind every inference request. No change to existing model calls is required. Where several people share one role, AWS says per-user detail can be added with session tags, which are labels passed at the moment a role is assumed. Where each person or application has its own role, tags attached to the role itself are enough.
Report: reading the numbers
Those tags are then activated as cost allocation tags, which makes them appear in billing data. AWS offers two ways to read the results. Cost Explorer provides a console-only view. A CUR 2.0 data export, short for Cost and Usage Report, delivers detailed line items that can be analyzed with SQL, typically through Amazon Athena.
Enforce: stopping spend at a threshold
AWS Budgets can be scoped to Amazon Bedrock and filtered to a single identity or tag value. A budget action attached to it applies a Deny IAM policy when the threshold is crossed, which restricts Bedrock access for that identity.
Which tagging method fits which team?
The guide’s first decision point is how identity maps to users, and the answer depends on how roles are organized.
- One role per person or application: principal tags are attached directly to each role or user. They are static and apply to every request from that identity. AWS’s example tags a role with keys such as user, team and CostCenter.
- A shared role or a gateway: principal tags cannot tell users apart, because every session carries the same tags. Session tags solve this. They can vary per session, and if a session tag and a principal tag share a key, the session tag wins for that session.
Session tags require the role’s trust policy to allow the tagging action. AWS lists three ways to pass them: assuming a role with tags directly, including them in an OpenID Connect token claim, or mapping attributes in a SAML assertion from the identity provider. AWS cautions that having an attribute available for another purpose does not automatically make it a session tag. The identity provider must map it separately to a PrincipalTag attribute. Up to 50 principal or session tags can be applied per user or role.
What does activating the tags involve?
Tags do not show in billing data until they are activated. In the AWS Billing and Cost Management console, an administrator opens Cost allocation tags, filters by type IAM principal, selects the tag keys and activates them.
In an AWS Organization, AWS states these tags must be activated in the management (payer) account, since member accounts cannot activate them independently. A tag key also appears in the list only after the principal has made at least one Bedrock call, so AWS suggests making a test call if the list looks empty. Billing Console access is managed separately from most IAM permissions, a point the guide asks readers to confirm before starting.
How does this compare with a custom enforcement loop?
The guide frames two approaches that AWS itself describes. The Jamf-style design reads Bedrock model invocation logs with Athena and uses Lambda to act on the results, which AWS says gives near-real-time control at the cost of code the organization must own. The budget-based design uses reporting and budget actions that AWS manages. AWS positions it as requiring no application code for the common case.
AWS has not said how quickly a budget action fires after spend crosses a threshold. Billing data can lag, and AWS notes tags may take up to 24 hours to appear after being applied. Teams that need hard, immediate cutoffs should check the current AWS Budgets documentation on update frequency before treating this as a real-time control.
A worked example: capping one developer’s monthly spend
Consider a company where each developer already has a personal IAM role for Bedrock access. Following AWS’s walkthrough, an administrator tags each role with the developer’s email, team and cost center, then activates those tag keys in the payer account after each person has made a first call.
Cost Explorer, filtered to Amazon Bedrock and grouped by the user tag, then shows spend per developer. For finer analysis, a CUR 2.0 export lands in an Amazon S3 bucket and can be queried in Athena. Finally, the administrator creates a budget filtered to one developer’s tag value and attaches a budget action that applies a Deny policy at the chosen threshold. AWS’s guide covers the enforcement step later than the portion supplied for this profile, so the exact policy configuration is not described here.
For a gateway that serves many staff through one role, the same flow applies, except the gateway passes the user’s identity as a session tag each time it assumes the role.
Prerequisites and access
AWS lists these requirements: an AWS account with Bedrock model access enabled; permissions to tag principals, activate cost allocation tags, create data exports, budgets and budget actions; Bedrock accessed through IAM roles or users; and a configured AWS CLI. A CUR 2.0 export with an S3 bucket and Athena are marked optional, needed only for detailed line-item analysis and querying. AWS has not stated pricing for the reporting or budgeting features.
Where to stay cautious
The approach depends on every user or application reaching Bedrock through an identifiable IAM role or user, so traffic arriving through other paths would not be attributed this way. Tag propagation delays and the separate Billing Console permissions can slow initial setup, and a budget cap restricts access only for the identities the budget filter covers. Teams should confirm current AWS documentation for update frequency, supported tag types and budget action behavior before relying on this for strict spending limits.