Amazon Bedrock AI Development Tool Cost Attribution and Control Complete Guide

Amazon Bedrock provides native IAM principal-based zero instrumentation cost attribution. When major AI coding tools such as Claude Code, Codex, and ChatGPT Work invoke inference through the two endpoints, bedrock-runtime and bedrock-mantle, the caller's full IAM ARN is automatically recorded in the line_item_iam_principal column of CUR 2.0. By propagating session tags (team, cost center) through integration with IAM Identity Center and external IdPs (Okta, Entra ID, Ping Identity), user and team-level spending can be viewed in real-time in Athena and Cost Explorer without API code changes. By hierarchically combining Application Inference Profiles, Projects/Workspaces, and request metadata tagging, full-spectrum visibility from invoice-level dollars to prompt-level tokens is secured.

Background: The Gap in Cost Visibility with the Spread of AI Tools

As generative AI coding assistants and productivity tools become standard on developer workstations, the concerns of FinOps and platform leaders about "who, how much, and what value was used" are deepening. The latest post on the AWS Machine Learning blog systematically organizes Amazon Bedrock's native answer to this question. The key is that it allows the identity of the caller to flow into CUR 2.0 and Cost Explorer for every inference call without separate instrumentation code (IAM principal tracking). Data does not leave the AWS security perimeter.

"Amazon Bedrock provides built-in, zero-instrumentation cost attribution that traces every inference call back to the IAM principal that made it."

How the Bedrock Native Cost Attribution Mechanism Works

Bedrock captures the full IAM ARN of the caller at the two inference endpoint layers: bedrock-runtime and bedrock-mantle. For federated users, the session name is included, which is recorded in the `line_item_iam_principal` column of CUR 2.0. Billing data is aggregated by subject and usage type at each export interval (hourly for 1 hour, daily for 1 day). Since CUR does not have request-level costs, if detailed analysis at the prompt level is needed, model call logs or request metadata tagging must be used in conjunction.

Optionally, if tags are attached to the IAM principal or session tags (team, cost center, etc.) are passed during integration, these tags appear in CUR 2.0 with the `iamPrincipal/` prefix and as filterable dimensions in Cost Explorer. This structure allows for automatic propagation to the organizational level (team, cost center, project) without API call code changes.

Four Access Patterns and Tool-Specific Endpoint Mapping

The article presents four access patterns, focusing on the federated identity pattern in this post. Understanding which endpoint each AI tool uses and how the required IAM actions differ is key to practical implementation.

AI ToolInference EndpointRequired IAM Action (Representative)Resource Scope
Claude Code, Claude Desktopbedrock-runtime`bedrock:InvokeModel`, `bedrock:InvokeModelWithResponseStream`Model ARN
OpenAI Codex, ChatGPT Workbedrock-mantle`bedrock-mantle:CreateInference`, etc.Project Resource
OpenCodebedrock-runtime / bedrock-mantleDepends on tool settingsBased on the respective endpoint

In the federated pattern, each developer logs in individually, so the session name becomes the user login name. If all users assume a shared role with the same fixed session name, or if they pass through a single role of the LLM gateway, CUR will aggregate spending under a single principal. IAM Identity Center resolves this issue by individualizing session names.

Practical Implementation: From IAM Identity Center Integration to Athena Dashboard

The article lists seven prerequisites and provides a three-step implementation guide. The main prerequisites are as follows:

Step 1: Configure External IdP as Identity Center Identity Source

1. IAM Identity Center → Settings → Identity Source → Change 2. Select "External Identity Provider" and configure SAML 2.0 or SCIM connection 3. Enable SCIM provisioning for automatic synchronization of user, group, and organization attributes (team, department) 4. In Settings → Access Control Properties, map IdP organization attributes to session tags

Step 2: Create Bedrock Access Permission Set

Each user will have a unique session within this permission set. Since the required actions differ by endpoint, permission sets should be designed to separate or combine according to tool combinations.

Step 3: Ensure Continuous Visibility with Athena Queries and Dashboard Options

Once CUR 2.0 data is loaded into S3, join `line_item_iam_principal`, `iamPrincipal/Team`, `iamPrincipal/CostCenter`, etc. in Athena to visualize user, team, and daily spending trends on the dashboard. The article presents a GitHub sample query as a starting point.

  1. IdP Integration·SCIM Synchronization
  2. Session Tag Mapping
  3. Permission Set Creation·Deployment
  4. CUR 2.0·Athena Dashboard Configuration
  5. Spending Limit Policy Application

Additional Attribution Layers and Usage Control: Granular Strategies

When IAM principal tracking alone is insufficient, Bedrock provides three additional mechanisms. These can be used alone or in combination depending on the purpose.

MechanismApplicable EndpointUnitMain Use
Application Inference Profilesbedrock-runtimeWorkload/ApplicationInvoice-level dollars + workload tags
Projects & Workspacesbedrock-mantleProject/WorkspaceIsolated spending boundaries, team-level budgets
Request Metadata TaggingBoth (call logs)Prompt/TokenDetailed analysis of prompt-level tokens and costs

The article cites the example of "using IAM principal attribution to view invoice dollars by user while analyzing prompt details in logs with request metadata tags". The selection criterion is "what is the goal" (refer to Track usage and costs in Amazon Bedrock).

With native usage control, spending limits policies can be set at the project, workspace, and inference profile level in the Bedrock console. If limits are exceeded, subsequent inference requests are blocked to prevent budget overruns.

Implications: What FinOps and Platform Teams Should Prepare Now

1. Meaning of Zero Instrumentation: Identity propagation is completed at the infrastructure layer without modifying application code. The attribution pipeline remains intact even when switching tools (e.g., Claude Code → Codex). 2. Session Tag Design Equals Governance: The quality of subsequent query, notification, and budget automation depends on how precisely team, cost center, and project attributes are mapped in the IdP. 3. Endpoint-Specific Permission Separation is Essential: Codex/ChatGPT Work using bedrock-mantle requires Project resource permissions, while Claude Code using bedrock-runtime requires model ARN permissions. In mixed environments, permission set design should be reviewed in advance. 4. Understanding CUR 2.0 Aggregation Intervals: Since only hourly/daily aggregation is provided, if real-time notifications are needed, model call log streaming must be configured separately. 5. Claude Platform/Enterprise is a Separate Track: Since it passes through Anthropic's managed infrastructure, only workspace and API key-level details appear on the AWS bill. User-level details must be checked in the Anthropic management console and Usage and Cost API.

Verified figures

Our take

Bedrock's zero instrumentation attribution is significant in providing standardized cost visibility at the infrastructure layer in an era of fragmented AI tools. However, since CUR 2.0 aggregation intervals and prompt-level log separation still require separate pipelines, it is practical to gradually introduce hierarchical configurations according to organizational maturity.

Open questions

Source

Back to catalog