Reconstructing the Exact Human or Automated Trigger Behind Every Agent Code Change
Agent logs show what ran, so capture who authorized it.

Full observability for AI coding agent sessions means that every tool call, file diff, and token count is linked to the trigger and authorization behind the run. That requires a session trace spanning the initiating event, agent delegation, and resulting action, backed by isolated sessions, scoped credentials, and versioned configuration. The chain must be recorded when the agent acts, because infrastructure logs cannot recover authorization context that they never recorded.
Why agent code changes are hard to attribute after the fact
An incident occurs, and a reviewer asks who triggered the agent’s code change. Application logs show what happened, CI logs show what ran, and git history names a bot. None answers the question of authorization. The gap is architectural rather than a failure of any particular product, because each record describes work at its own layer without necessarily preserving the event that authorized it.
Agents remove the human confirmation steps that ordinarily produce explicit audit entries. They can call APIs, write files, and execute commands using trust inherited from the host environment. That trust does not show who authorized a task. Once the session ends, an infrastructure identity may be the only identity left in the record, even though several people or automated triggers could have initiated the work.
Connecting timestamps cannot recover a delegation instruction or authorization context that was never captured. More logs alone cannot repair that omission. The required evidence is the relationship between the initiating event, the authority granted to the agent, and the change it produced.
What a complete attribution chain actually looks like across the trigger types
Imagine the chain as a spine with three vertebrae, namely trigger, delegation, and action. Each change has one immediate trigger class, which is a user message, cron schedule, webhook, or parent agent. The chain then reaches the human or service principal whose authorization supports the run. Parent-agent triggers make the spine longer while keeping its structure the same.
Each trigger needs its own identifying context. A user message requires the authenticated user, channel, and initiating timestamp, whether the channel is a terminal, Slack, GitHub comment, or API call. A cron trigger requires the schedule’s last modifier, job identifier, and scheduled wall-clock time. A webhook needs the source system, event type, payload hash, and service principal that accepted it. A parent-agent trigger needs the parent’s trace ID and delegation instruction.
Every event also needs the agent identity and version, authorization token or session reference, action type, inputs, outputs, decision summary, UTC timestamp, and execution result. W3C Trace Context provides a shared trace ID with span and parent-span IDs, so child activity can be linked without relying on an agent’s own account. Authorization remains a separate part of that record. Azarang’s accountability survey distinguishes traceability, reconstructing what happened, from justifiability, showing that it was authorized.
Why default infrastructure cannot reconstruct this chain and what goes wrong when it tries
CI logs record a job and its exit code, but those facts do not establish whether a person initiated it directly or an agent invoked it under earlier authorization. Git history identifies the commit author, which may be a shared service account or bot. Neither identity is sure to show which human authorized the task. A pull request adds evidence of review while leaving the upstream trigger uncertain.
Cloud-native audit logs record API calls and the cloud IAM identities used to make them. They cannot see the agent’s internal tool calls, model decisions, or initiating prompt. OpenTelemetry traces and APM tools provide distributed spans, but agent-to-human delegation requires deliberate instrumentation beyond ordinary service-to-service tracing.
Azarang’s survey of 47 delivery platforms, comprising 20 CI/CD and 27 model-serving and agent platforms, found no default record emitting a content-addressed identity of the full behavioral tuple. That tuple includes model version, instructions, tool definitions, retrieval, and runtime configuration. A version name alone does not give that same identity. Meanwhile, agents that run on laptops can bypass a central gateway entirely, so central records show nothing of what they do.
How do teams get complete visibility through a gateway layer?
Teams should send every agent request through a centralized gateway so that trigger context and actions are recorded the same way without having to instrument each agent on its own. The gateway sits between agents and model providers and tool endpoints, making recording an infrastructure property independent of an agent’s choice. Coverage depends on the route being unavoidable. Local AI traffic also needs an endpoint gateway agent to send it through the central proxy.
At that boundary, the record can include the requesting identity key, full prompt with injected trigger context, tool calls and results, token counts, and step latency. Per-project, per-team, and per-user virtual keys bind requests to a named human or service principal provisioned at session start. A shared git bot identity then stops being the attribution endpoint. For code changes, the action record must also preserve the file-change evidence needed to connect execution to the resulting diff, rather than treating token visibility as complete observability.
Logs must be immutable and tamper-evident through cryptographic signing or an equivalent mechanism, because append-only records can still be silently truncated. Redundant deployment addresses the single-point-of-failure concern. Dispensing with the central record leaves accountability dependent on disconnected evidence.
Isolating each agent session so credentials and context cannot bleed across triggers
The gateway record is trustworthy only when the session boundary is clean. Each session needs a consistent trigger, credential scope, and sandbox, so the recorded action belongs to the authorization shown beside it. Shared execution undermines that relationship even when logging is detailed. Trace completeness cannot compensate for ambiguous authority.
Consider two concurrent tasks sharing a session and host environment. The second can encounter credentials or tool context left by the first, while their file writes and API calls produce interleaved records. A timestamp may establish when an action occurred without establishing which trigger authorized it. Fresh credentials minted at session start and revoked at session end prevent authorization from persisting into a later run. Filesystem and network isolation keep parallel sessions from altering one another’s execution context.
NVIDIA’s OpenShell illustrates that isolation is a deployable primitive. Its declarative policies govern filesystem, network, process, and provider-credential protections, with inference routing handled separately through provider profiles. Attribution needs an execution environment with clear bounds as well as protection against unwanted access. A trace across a shared session may show what an action did without showing that it was authorized.
Capturing the multi-agent delegation chain without losing the original human trigger
When an agent spawns a child, the spine gains another delegation vertebra. The original human trigger must remain an explicit field in the child session’s log, together with the instruction that caused the handoff. Otherwise, the child records the parent’s instruction as its trigger and loses the authorization upstream. The local account can be accurate but incomplete.
W3C Trace Context provides the shared identity for this tree. Each child preserves the trace ID while adding its own span identity and parent relationship, so a recorded action can be followed back to the initiating event. The human trigger and policy context must travel with that linkage.
Park et al.’s supervision framework from KAIST describes how developers put a great deal of work into planning because it is harder to monitor and review the subtasks they delegate. That makes upfront trigger context useful for supervision as well as attribution. Databricks’ Omnigent, open-sourced in June 2026, provides a factual example of cross-harness policies and a uniform OS sandbox for multi-agent orchestration. Managed infrastructure running repository-defined YAML configuration can enforce propagation at the platform layer. This lets harnesses share an attribution convention.
Why agent configuration as versioned code is an attribution requirement, not just a practice preference
Runtime records still leave an upstream question unanswered. Which agent definition authorized the instructions, tools, and scope used during the run? An auditor who sees every tool call but cannot connect it to a reviewed definition has only half a record. Legal and operational interpretation depends on distinguishing approved behavior from an unreviewed configuration change.
Configuration that is version-controlled and content-addressed provides that missing identity. When a developer commits an agent’s YAML definition, the git commit hash identifies that configuration, and the session log can record the corresponding SHA. The identity covers what the committed artifact actually defines. The survey’s full behavioral tuple is still needed, because a configuration label alone does not identify model, retrieval, or runtime settings outside it.
CI/CD is the enforcement point for reviewed configuration changes. The agent lane can apply fast preflight checks for format, lint, typecheck, and secrets, followed by the full suite on a pull request and a post-merge canary with automated rollback. Branch protection and code-owner review stop the agent from merging its own configuration change. The merge then has a named human authorizer. Declarative sandbox policies belong to the same infrastructure-as-code artifact class and require the same versioning and review treatment.
Turning the attribution record into an operational signal for cost and reliability
Engineering leaders can see total usage and which workflows and initiating events led to token use and repeated failures. Each LLM call needs structured span attributes for input tokens, output tokens, model identifier, agent identity, workflow identifier, and tenant identifier.
Token budgets then become enforceable at the gateway. Per-request limits, rolling session budgets, monthly key caps, model-tier routing, and circuit breakers apply across agent frameworks when all traffic passes through that layer. The agent cannot simply bypass those controls. Without trigger-level attribution, a budget overrun may be visible while the workflow or human initiation behind it remains unknown.
Tool calls tagged with trace and trigger IDs expose retry storms and infinite tool-call recursion as patterns tied to particular trigger types. Jarmak’s engineering monograph on reliable coding agents treats evaluation and operation as a dependency chain in which weak observability can invalidate conclusions elsewhere. Attribution is therefore part of engineering evidence. It helps show whether a workflow is failing or error rates are rising more broadly.
What teams need to build from the start and what cannot be retrofitted
Teams should establish session isolation, content-addressed configuration, root trace propagation, and credential provenance before agents begin consequential work. Retrofitting these foundations requires revisiting session boundaries, credential flows, and configuration artifacts together. Historical ambiguity remains even after that work. Interleaved actions cannot be unambiguously reassigned to triggers, an unversioned definition cannot be recovered from a runtime log, and missing delegation context cannot be supplied retroactively by a child agent.
Other improvements can arrive incrementally once the routing foundation exists. Token and latency logging, budget caps, and circuit breakers can be added at the gateway, while richer workflow and tenant attributes can enter new deployments. HMAC signing can protect new records as they are created. It does not establish the integrity of records created before signing was applied, just as new span attributes do not enrich past sessions.
The practical test is whether logs alone identify who initiated a session, which configuration version ran, and what authorization existed at that time. If any answer requires interviews or reconstruction, incremental monitoring improvements are insufficient. Managed platforms can provide isolation, credential scoping, versioned configuration, and gateway logging by default, shifting the team’s work toward platform selection and configuration. The decisive requirement remains capture at execution time. After an incident, attribution should be retrieval of an existing chain.


