Skip to content

AI uses for records

Multi-agent shared state provenance: which agent changed it, and why?

By SourceX Editorial · Updated

9 sections

Short answer

Give every write to shared state its own record: the acting agent and its configuration, the delegation chain up to an accountable person or system, the grant that allowed the write, the task or handoff that caused it, the state versions it read, the requirements it cited and the before and after values. Traces and checkpoints show who ran; that record is what explains why.

Agent run

Multi agent shared state

This page covers multi-agent shared state provenance: which agent changed it, and why.Illustrative

Key takeaways

  • Attribute each change with a write record, not by reading transcripts after the fact.
  • Record the delegation chain up to an accountable person or system, as the W3C PROV model does for responsibility.
  • Store the authority grant once and reference it from every write, so scope and limits can be checked mechanically.
  • Require prior_version on every write to catch agents that overwrite a human edit they never read.
  • Carry requirements forward as structured fields, because filtered handoff history can drop them silently.
  • Score long workflows on the record trail: attribution, in-grant writes, stale writes, constraint retention and human edit preservation.

How do you identify which agent changed shared state and why?

Make every write to shared state produce a write record that names the acting agent and its configuration, the principal it acted for, the authority that allowed the write, the task or handoff that caused it, the state versions it read, the requirements it relied on and the value before and after. Who comes from the actor and delegation fields. Why comes from the inputs read, the requirements cited and the stated reason, checked against each other.

Most multi-agent stacks already record part of this. Traces show which agent ran, checkpoints show what the state looked like after each step, and task protocols group related work. None of them, on its own, joins a specific change in a specific field to the authority and the requirement behind it. That join is the provenance schema this page describes.

The question matters for training and evaluation as much as for debugging. A long-horizon dataset where state changes cannot be attributed teaches an agent that edits simply happen. A dataset where each change carries its actor, authority and basis lets a team measure whether constraints, permissions and human edits survive handoffs.

What do traces and checkpoints already capture, and what is missing?

They capture who ran and what changed, but rarely on whose behalf, under what grant, or against which requirement. A quick look at four widely used conventions shows where each one stops.

OpenTelemetry's GenAI conventions, still at Development status, define invoke_agent spans with a gen_ai.agent.id for a stable agent identifier, gen_ai.agent.name and a gen_ai.conversation.id for the session or thread. The OpenAI Agents SDK records traces with a trace_id and an optional group_id that links traces from one conversation, and wraps each agent run, tool call and handoff in its own span. LangGraph saves a checkpoint at each super-step whose metadata records a source of input, loop or update, the writes keyed by node, the step counter and a pointer to the previous checkpoint.

Put together, a team can usually say that a node or agent wrote a key during a step. What stays missing is the delegation chain, the scope of the permission used, the state version the agent believed it was changing, and the requirement it thought it was satisfying. LangGraph's own documentation adds a further caveat: each subgraph manages its own checkpoint namespace, so a parent graph may not see a subgraph's update immediately.

What do traces and checkpoints already capture, and what is missing?
ConventionWhat it recordsUseful for provenanceWhat it does not record
OpenTelemetry GenAI agent spansinvoke_agent spans with agent id, agent name and conversation idA stable, cross-vendor actor identifier per invocationWhich state key the agent wrote, or on whose authority
OpenAI Agents SDK tracingTraces with trace_id and group_id; agent, function and handoff spansOrdering of agent runs, tool calls and handoffs inside one workflowVersion of shared state read or written, outside tool inputs and outputs
LangGraph checkpointsState snapshot per super-step, with source, writes by node, step and parent checkpointExact before and after state and which node produced the writeWho triggered an update-source write, or why the node wrote it
A2A tasksTask ids, a contextId grouping related tasks and messages, referenceTaskIds, and artifacts as outputsLinks between delegated tasks across agents and vendorsField-level changes to state that lives outside the task's artifacts
W3C Trace Contexttraceparent with a trace-id for the whole trace and a parent-id for the calling requestJoining records from different services into one causal treeAnything about meaning, authority or state; it is linkage only

Who acted for whom, and how does the PROV model keep them apart?

The W3C PROV data model already separates the three ideas a multi-agent log tends to blur: what was produced, what activity produced it and which agent bears responsibility. It defines delegation as the assignment of authority and responsibility to an agent, by itself or by another agent, to carry out a specific activity as a delegate or representative.

Mapped onto shared state, each new version of a state key is an entity, each write is an activity, and each AI agent, service account or person is an agent. A worker agent's write is associated with that worker, and the worker acted on behalf of the planner, which acted on behalf of the person or system that started the job. Recording the full chain matters because responsibility in PROV is shared along it: the principal at the end of the chain keeps some responsibility for what its delegates did.

Teams do not need to adopt PROV serializations to benefit. Borrowing its vocabulary keeps the schema honest about the difference between the agent that typed the change, the agent that asked for it and the person whose authority it ultimately used.

What should the actor and decision provenance schema include?

One write record per change to a shared state key, linked to a separate authority grant record and to the task or handoff that caused it. The fields below are the minimum; each has a rule a validator can apply without reading the prose.

At a glance

What should the actor and decision provenance schema include

What should the actor and decision provenance schema include?
FieldPurposeExample value (illustrative)Validation rule
write_id, state_key, prior_version, new_versionIdentifies the change and the exact version it replacedw-0412, po-881.delivery_date, v6, v7prior_version equals the latest committed version at write time
actor_id and actor_config_hashThe agent that performed the write and the prompt, tools and model configuration it ran withscheduler-agent, cfg-3b9eResolves to a registered agent and an archived configuration
on_behalf_of chainOrdered delegation from the actor up to a human or system principalscheduler-agent, planner-agent, buyer J. (role: purchasing)Ends at a human or a named system principal; no cycles
authority_refThe grant that permitted this write: scope, action, limits and expirygrant-77: update delivery_date on open POs, up to 5 business days laterGrant covers state_key, action and value change at the write time
trigger_refThe task, handoff or event that caused the writeA2A task t-52 in context c-9; handoff h-3Resolves to an existing task or handoff record
inputs_readState keys and versions the agent read before decidingsupplier_eta v3, po-881.delivery_date v6Each version existed at read time; flags any key changed between read and write
requirements_cited and reason_codeConstraints the agent claims to satisfy, and a coded reasonREQ-2 (no delivery after promised ship date to customer), reason supplier_delayEvery cited requirement id exists and is active for this job
human_edit flag and editor_idMarks writes made directly by a person, including edits through a UIfalseIf true, editor_id is a person and actor_id is empty or a UI service
trace_id and span_idJoins the write to telemetryW3C trace-id and parent-id valuesResolves to a span whose agent id matches actor_id

What slips through a handoff: requirements, permission scope or the latest state?

Three things go missing most easily: a constraint stated early in the job, a narrowing of permission that applied only to one branch, and the fact that someone else changed the state after the receiving agent last read it. Each one fails silently, because the next agent still has enough context to act.

Framework defaults explain part of it. In the OpenAI Agents SDK, a receiving agent sees the prior conversation history unless an input filter or history setting changes it, so a filter written to save context can drop the turn where a requirement was stated. The SDK's documentation also says that a handoff's is_enabled check runs before the model returns its handoff arguments, so authorization that depends on those arguments has to happen at the start of the on_handoff callback.

A2A gives cross-agent work a contextId that groups related tasks and messages, and asks clients to use referenceTaskIds when a message builds on earlier tasks. Those links say the tasks are related. They do not carry the requirement list or the permission scope forward, so the schema stores requirements_cited and authority_ref on every write rather than trusting the next agent to inherit them.

Checklist · 4 items

  1. Lost requirement: the planner was told no delivery date may pass the customer's promised date; the scheduler, after a filtered handoff, never sees it.
  2. Widened permission: a grant scoped to one supplier's orders is reused by a worker acting on a different supplier.
  3. Stale read: an agent read version 6, a person edited to version 7, and the agent wrote version 8 on top of the human change.
  4. Orphaned human edit: a person changes the value in the UI, the change has no actor record, and later agents treat it as their own earlier output.

0 of 4 ticked. Tick each item as you go.

Worked record: who moved the purchase order date (illustrative)

The scenario is invented for illustration and is not drawn from any customer's data. A planner agent coordinates a supplier-follow-up agent and a scheduler agent on an open purchase order. A purchasing buyer started the job and granted the planner authority to move delivery dates on open orders by up to five business days.

Steps

Worked record: who moved the purchase order date (illustrative)

The sequence below is the valid version. Each step is one record, and the last line shows the question the schema answers.

  • Job start: buyer J. creates the job with requirement REQ-2 (no delivery date after the date promised to the end customer) and grant-77 to the planner.
  • Read: the supplier-follow-up agent reads supplier_eta at v3 under task t-51 and reports a four-day slip as an artifact.
  • Handoff: the planner hands off to the scheduler with trigger h-3, passing REQ-2 and grant-77 as structured handoff metadata rather than relying on chat history.
  • Human edit: the buyer moves the delivery date by two days in the ERP screen; write w-0411 records human_edit true and editor_id buyer J., v5 to v6.
  • Agent write: the scheduler reads v6, checks REQ-2, and writes w-0412 moving the date two more days, v6 to v7, citing REQ-2 and reason supplier_delay, on behalf of planner then buyer J.
  • Answer: the date moved twice; the first change was the buyer's own, the second was the scheduler's under grant-77, and both stayed inside the promised customer date.

What do a passing and a failing record look like to the validator?

The validator replays the write records in commit order and checks each one against the grant, the version history and the requirement list. Write w-0412 above passes every check. The variants below each break one rule, and each describes a failure a reviewer would otherwise have to discover by reading transcripts.

What do a passing and a failing record look like to the validator?
Variant of w-0412 (illustrative)DefectRule that failsWhat it means for the dataset
prior_version is v5The scheduler read before the buyer's edit and overwrote itprior_version must equal the latest committed versionLabel as a lost update; useful as a negative example, not a demonstration
Date moved seven business daysValue change exceeds the grant's limitauthority_ref must cover the value changeUnauthorized write; exclude from imitation targets
on_behalf_of ends at planner-agentNo human or system principal at the end of the chainDelegation must terminate at an accountable principalResponsibility cannot be assigned; hold for repair
requirements_cited is emptyThe handoff dropped REQ-2Each write to a constrained key must cite the active requirementsCounts as a constraint retention failure in evaluation
span agent id differs from actor_idTelemetry says a different agent made the calltrace link must match actorAttribution conflict; resolve before release

How should the schema be used to score long multi-agent workflows?

Score the record trail, not the final message. A run can end with a confident summary while the trail shows an overwritten human edit or a write outside its grant.

Useful measures, each computed from the write records: the share of writes whose actor and delegation chain resolve; the share of writes inside their grant; stale writes, where prior_version was not the latest; constraint retention, the share of writes to constrained keys that cite every active requirement, broken down by number of handoffs since the requirement was stated; and human edit preservation, the share of human writes not overwritten without a recorded reason. This page reports no results for any system; these are definitions for a team to apply.

Report each measure with the number of writes behind it and the run count, and keep tasks from the same job template in one split so a model is not tested on a scenario it saw in training.

Can provenance like this come from real business records?

Partly. Business systems that keep field-level change history, approval records and delegated-authority settings already hold the human half of the trail: who changed which field, when, from what value and under which approval limit. Those records are the realistic backbone for multi-agent tasks, with agent steps added in a sandbox around them.

Field-level change histories like these can be sourced by SourceX from U.S. businesses when an AI team asks; there is no standing inventory, and the team spells out scope, volume, language, format, timing and licensing terms. No contributing business hands over records until it has approved the scope and terms and signed.

Frequently asked questions

What is shared state provenance in a multi-agent system?

It is the record of who changed each piece of shared state, on whose behalf, under what authority and for what reason. It joins telemetry about which agent ran with the state versions it read and wrote and the requirements it relied on.

Is an OpenTelemetry trace enough to attribute a state change?

Usually not. GenAI agent spans identify the agent and the conversation, and Trace Context links calls across services, but neither records the state version written or the grant that allowed it. Add a write record and join it to the span by trace and span ids.

How do I record a person editing state in the middle of an agent workflow?

Write it as its own record with a human edit flag, the person's id, and the prior and new versions. Agents that write later must show they read that new version, or the validator flags the later write as a stale overwrite.

Why store the authority grant separately from the write?

One grant covers many writes and has its own scope, limits and expiry. Storing it once and referencing it lets the validator check each write against the same terms and shows when a grant was reused outside its scope.

Does LangGraph record which node changed the state?

Its checkpoints record writes keyed by node in each snapshot's metadata, along with a source of input, loop or update and a pointer to the previous checkpoint. That shows which node wrote, but not the delegation chain or the requirement behind the change.

Sources

  • The W3C PROV data model defines delegation as assigning authority and responsibility to an agent to carry out an activity as a delegate or representative. Source
  • OpenTelemetry GenAI conventions define invoke_agent spans with agent id, agent name and conversation id attributes, at Development status. Source
  • The OpenAI Agents SDK records traces with a trace_id and optional group_id and wraps agent runs, tool calls and handoffs in spans. Source
  • In the OpenAI Agents SDK, the receiving agent sees prior history unless an input filter changes it, and argument-dependent authorization belongs in on_handoff. Source
  • LangGraph saves a checkpoint per super-step whose metadata records the source, writes by node, step and parent checkpoint. Source
  • The A2A specification groups related tasks and messages with a contextId, uses referenceTaskIds for follow-ups and returns outputs as artifacts. Source
  • W3C Trace Context's traceparent header carries a trace-id for the whole trace and a parent-id for the calling request. Source

Tell us what data you need

Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.

See if your company qualifies