Skip to main content
Connect your AI

AWS Bedrock invocation logs

If your people or your software call models on Amazon Bedrock, Bedrock can write every model invocation to a bucket in your AWS account. AI Governance reads those files and adds the calls to your…

Written By Christopher Scaminaci

Last updated 13 days ago

If your people or your software call models on Amazon Bedrock, Bedrock can write every model invocation to a bucket in your AWS account. AI Governance reads those files and adds the calls to your Spend and Activity views. StackJack reaches your bucket through a role you create, and never writes to your account.

At a glance

  • What it does: reads Amazon Bedrock invocation logs from a bucket in your AWS account.
  • Plan: every plan. Scanning text with rules needs Pro.
  • Who: an Administrator.
  • Where you set it up: AI Governance → Connected accounts → Cloud AI.
  • Where you see the data: Activity → Activity explorer and Activity → Spend.

You set it up on AI Governance → Connected accounts → Cloud AI. The page shows the steps and the two policies for the account, region and bucket you type.

This source is available only where AWS access is set up. Where it is not, the Cloud AI page says: "AWS sources are not available in this region yet."

What it reads, and what it never reads

  • It reads the invocation log files Bedrock writes under one folder of one bucket. It lists that folder and reads the files in it.
  • It reads the time, the model, the token counts, who called (see below), and, at a capture level that keeps text, the input and the output.
  • Its permissions are read only: list the bucket (limited to the log folder), read the objects under the log folder, and read your Bedrock logging settings. It cannot write or delete anything, and it cannot read any other folder.

Set it up

  1. Turn on model invocation logging in Amazon Bedrock settings: send the logs to the bucket and folder you will name, in the same account and the same region, and turn Text data delivery on. The bucket needs a policy that lets Bedrock write there. The Cloud AI page shows the statement AWS documents, and AWS explains it at https://docs.aws.amazon.com/bedrock/latest/userguide/model-invocation-logging.html.
  2. Add the source on the Cloud AI page: a name, your 12-digit AWS account number, the region, the bucket and (if you use one) the folder prefix. StackJack generates an external id for the source. The id is not a secret.
  3. Create the role. In your AWS account, create an IAM role with the trust policy the page shows. It trusts StackJack's AWS account, and only with this external id. Attach the permissions policy the page shows.
  4. Allow the KMS key, if the bucket uses one. If the bucket is encrypted with a KMS key, add kms:Decrypt on that key for the role. The key's own policy must allow it too. Without it, StackJack cannot read the files.
  5. Paste the role ARN on the Cloud AI page and select Save role. The role must be in the same account as the bucket.

StackJack then assumes the role and lists the log folder. The page shows Role verified with the time, or "Waiting for the first read" until then. A second source cannot claim a bucket and folder that another source has already verified.

The page also shows the state of your Bedrock logging in words: on and writing text, off, writing somewhere else, text delivery off, or could not be read. If logging is off or goes elsewhere, StackJack tells you and keeps reading what is already in the bucket.

Who made the call

An AWS record names the caller by an ARN. StackJack treats a caller as a person only when it is an assumed-role session whose name is an email address, as Identity Center and SAML sign-ins make them. Every other caller (an application role, an IAM user, the root user) is counted without a person: it is shown as a source, and it never counts toward your staff.

What you should know

  • Calls through bedrock-mantle are not logged by AWS, so StackJack never sees them.
  • Large inputs and outputs are stored by AWS as separate objects. At a text level StackJack reads such an object only if it is in your own bucket under the log folder, with a limit on how many and how large. A part that is skipped is left out and counted.
  • Cost figures can be missing. StackJack has list prices for only a few Bedrock models. Any other model shows as unpriced, never as free.
  • Two views of one call are two facts. A call that Claude Code reports and that Bedrock logs is counted once for each source, and the two are never added together.

What we have not confirmed

These points follow AWS's published pages and are not confirmed against a live account:

  • The folder layout inside the log folder. StackJack looks under AWSLogs/{account}/BedrockModelInvocationLogs/{region}/ by year, month, day and hour. AWS names the bucket-policy path but not every folder below it. If the layout differs, StackJack finds no files and reads nothing: it does not read wrong data. Ask support to check.
  • How a failed invocation is marked in a record. StackJack counts every record as a call.
  • The field names of a stored large body. StackJack looks for any value that ends in S3Path inside the input or output.

Where the data goes and what stops it

Files from a bucket in another region are copied into your StackJack region, and the setup page says so. You can stop the source in three ways: switch it off on All sources; turn model invocation logging off in Bedrock; or delete the role or its trust, which stops StackJack at once. StackJack can also switch AWS access off for the whole region. Ask support.

Tell your staff

Your staff notice must say that AI Governance reads the model invocation logs of AI calls made through your AWS account. The exact wording is for your legal adviser to confirm.