Agent Attribution
Control how witn calculates the billing unit when multiple events carry a quantity.
What is agent attribution?
When an outcome confirms, witn multiplies price_per_unit by a billing unit to produce the charged amount. The billing unit comes from the properties.attribution values in the events you submitted.
If you submit only one event with a quantity, there is nothing to decide. If you submit multiple events carrying a quantity, agent attribution determines which value counts.
The field on the agent contract is attribution_method. It accepts five values: first, last, min, max, sum. The default is last.
The five methods
| Method | Billing unit |
|---|---|
last | Most recent numeric properties.attribution |
first | Earliest numeric properties.attribution |
min | Smallest numeric properties.attribution across all events |
max | Largest numeric properties.attribution across all events |
sum | Sum of all numeric properties.attribution values |
Applied at confirmation time, across every event regardless of action type.
If no event carries a numeric properties.attribution, the billing unit is 1. A flat agent with no quantity events always bills one unit.
Choosing a method
last works for outcomes where the final observed quantity is authoritative. A metered usage event that updates throughout the period, or a score that changes as new signals arrive.
first works when the quantity is established at the start and should not be revised. A seat count locked in at contract signing.
sum works for outcomes that aggregate partial quantities. Multiple delivery events each carrying a weight, count, or dollar amount that should be totalled.
min and max work for outcomes with a guaranteed floor or ceiling. Bill the worst-case or best-case observation.
How to configure
Open an agent and find the Billing section. The Agent Attribution field is a selector with all five options.
Agent attribution is snapshotted onto each outcome when it opens. Changing an agent's attribution method does not affect outcomes already in progress.
Examples
Metered usage: last value wins
An agent charges per API call. The client submits a running total once per hour. You want the final count at confirmation time.
{ "attribution_method": "last" }Events submitted:
{ "key": "acme:api:nov", "action": "api_call", "properties": { "attribution": 0.4 } }
{ "key": "acme:api:nov", "action": "api_call", "properties": { "attribution": 0.9 } }
{ "key": "acme:api:nov", "action": "api_call", "properties": { "attribution": 1.2 } }Billing unit: 1.2. Amount: price_per_unit × 1.2.
Partial deliveries: sum of quantities
An agent charges per kilogram delivered. Each delivery event carries its weight.
{ "attribution_method": "sum" }Events submitted:
{ "key": "order:88", "action": "delivered", "properties": { "attribution": 0.4 } }
{ "key": "order:88", "action": "delivered", "properties": { "attribution": 0.5 } }
{ "key": "order:88", "action": "delivered", "properties": { "attribution": 0.6 } }Billing unit: 1.5. Amount: price_per_unit × 1.5.
Guaranteed minimum: max of observations
An agent bills on peak concurrent sessions. Submit session counts throughout the period.
{ "attribution_method": "max" }Events submitted:
{ "key": "tenant:xyz:q1", "action": "session_count", "properties": { "attribution": 0.4 } }
{ "key": "tenant:xyz:q1", "action": "session_count", "properties": { "attribution": 1.2 } }
{ "key": "tenant:xyz:q1", "action": "session_count", "properties": { "attribution": 0.8 } }Billing unit: 1.2. Amount: price_per_unit × 1.2.
Relationship to billable conditions
Agent attribution and billable conditions operate independently.
For condition evaluation, a leaf { "fact": "csat", "operator": "gte", "value": 4 } checks the latest properties.value submitted for the csat action.
Agent attribution operates on all numeric properties.attribution values at confirmation time, regardless of action type.
An agent can use a condition that gates on a minimum score while using sum attribution to total quantity across all events. These settings do not interfere with each other.