

# Managed harness

When you run on the Amazon Bedrock AgentCore managed harness, cost works automatically, and you want to confirm it shows with no setup, so you can move straight to using it.

## What you get with no configuration
<a name="_what_you_get_with_no_configuration"></a>

On the managed harness, AgentCore:
+ Creates the session identity and the agent identity and propagates them for you.
+ Instruments the agent so its spans carry the identity and usage cost needs.
+ Attributes every in-path primitive automatically.
+ Turns on tracing for the agent runtime and for each AgentCore resource it uses, so their spans reach Observability with no action from you.

You write no telemetry code and set no environment variables for cost attribution.

## Confirm cost appears
<a name="_confirm_cost_appears"></a>

1. Invoke the agent so it does some work. The invoke call is `InvokeHarness` on the `bedrock-agentcore` data plane. Pass a `runtimeSessionId` (33 or more characters) and reuse it for every turn in one conversation; the harness generates one if you leave it out. Pass an optional `baggage` entry for per-tenant cost, and the `messages` for the turn:

   ```python
   import boto3
   
   client = boto3.client("bedrock-agentcore", region_name="us-west-2")
   response = client.invoke_harness(
       harnessArn="arn:aws:bedrock-agentcore:us-west-2:111122223333:harness/<harness-id>",
       runtimeSessionId="my-conversation-0001-0123456789abcdef0123",  # 33+ characters; reuse for every turn
       baggage="aws.tenant.id=<your tenant>",                          # optional: per-tenant cost
       messages=[{"role": "user", "content": [{"text": "Summarize last week's sales."}]}],
   )
   for event in response["stream"]:   # contentBlockDelta, metadata (token usage)
       print(event)
   ```

1. In AgentCore Observability, open the cost view and find the agent. See [See your first agent cost in the console](acv-see-your-first-agent-cost.md).

## Cost dimensions covered
<a name="_cost_dimensions_covered"></a>

All in-path primitives are covered: model inference, Runtime compute, Gateway, Memory, Browser, Code Interpreter, and online evaluations when they are in the path. See [Cost estimate coverage and limits](acv-cost-coverage-by-primitive.md).

## Set a tenant, if you need per-tenant cost
<a name="_set_a_tenant_if_you_need_per_tenant_cost"></a>

Per-tenant cost is optional. To get it, pass a tenant value in the `baggage` header on each invoke (`aws.tenant.id=<your tenant>`). The per-tenant figure is an estimate calculated from public list prices and can differ from your AWS bill; the tenant value is whatever you pass.