Est.

The Engineering Team's Audit Trail Starts the Moment Agent Config Enters a Pull Request

Versioning agent config in Git makes permissions reviewable before agents run.

· 9 min read
Cover illustration for “The Engineering Team's Audit Trail Starts the Moment Agent Config Enters a Pull Request”
Agent Governance · November 20, 2026 · 9 min read · 1,970 words

Agents-as-code means defining AI agents as YAML configuration files in Git, with their model version, system prompt, allowed tools, budget limits, and knowledge index under version control. The engineering team’s audit trail begins when that configuration enters a pull request, where permissions become reviewable and approval becomes attributable. That origin is authoritative only when sandboxed execution and tamper-evident logs connect each downstream action to the approved configuration.

Why agent config in a pull request is a governance event, not just a code change

The shift is from AI suggesting to AI acting. An autocomplete suggestion leaves a human responsible for accepting and applying the change. An agent that calls shell commands, modifies files, invokes MCP tools, or updates cloud settings can act within permissions already granted to it. Its configuration therefore sets policy as well as preferences. The pull request is where those permissions first cross a reviewable accountability boundary.

That distinction changes the role of the engineering pipeline. When an agent opens its own pull requests, runs CI pipelines, or interacts with infrastructure, the pipeline becomes a control point for its behavior. Reviewing application code alone does not show who approved the agent’s tools or how far the agent is allowed to go. The configuration that sets those limits needs the same approval gates and commit history as other infrastructure changes. Otherwise, the team can attribute a code change without being able to explain the authority under which it was produced.

Governance often arrives after deployment, when an unexpected action exposes a missing restriction. That order leaves the original permission decision outside the review process that could have constrained it. The problem begins before the agent runs. Treating configuration as policy brings that decision into code review, while the team can still check and approve what the agent is allowed to do.

What the governance gap looks like in a team that is already running agents

A majority of technical teams are testing or running agents, while only a small fraction have full IT and security approval across their entire agent fleet. A team may have working agents and familiar security controls without a continuous account of what each agent is authorized to do.

Static IAM roles, prompt-level rules, and after-the-fact logs were designed for services that do not reason through or compose actions. In a multi-step agent workflow, the agent makes decisions between the first request and the final output. A standing role states what authority is available, but it does not show whether the agent has task-scoped authorization. A prompt can state a restriction without proving that the runtime enforced it.

At the session boundary, an agent needs an identity distinct from the human who triggered it, credentials limited to its task, and policy enforcement during execution. Its audit trail must cover reasoning chains as well as final outputs. Delegation adds another boundary, because one agent’s scope must remain distinguishable from another’s. Without those distinctions, even a workflow with a log of each action can leave it unclear who had authority to do what.

Agents can modify CI/CD YAML. Those changes affect both the software being built and the pipeline that governs the agents themselves. Reviewing the resulting diff may reveal a proposed pipeline change without answering whether the agent should have been able to propose it under its existing permissions. The control mechanism is also an editable artifact.

Why the pull request is the right place to start the audit trail

The pull request supplies the missing point of authorization. It is the first moment when the agent’s configuration is human-readable, reviewable, and attributable to a person or trigger. Reviewers can examine proposed permissions before they become the basis for execution. The review records the decision process, while the merge establishes the approved version. Deployment then follows an authorization decision rather than becoming the first recorded governance event.

When agent configuration goes through the same reviewers, approval gates, and commit history as infrastructure changes, the repository records who approved what the agent is allowed to do. The trail does not require a separate retrospective account of that decision. Runtime evidence will still be needed, but it has a defined origin. Every session can be connected to the configuration under which it was authorized.

The agent manifest makes this relationship concrete. A YAML file committed through the CI workflow specifies a pinned model version, a system prompt with a hash, allowed tools, and a knowledge index reference. Version history establishes which definition was approved, while the session’s configuration reference establishes which definition actually ran. Together, those records answer which prompt was live for a particular task.

Cost policy needs to be part of the same review history. Budget limits, model routing rules, and hard-stop thresholds set what the agent may consume, just as tool permissions set what it may access. Keeping those decisions with behavioral configuration makes changes to spending authority attributable. It also prevents cost governance from becoming a separate, after-the-fact explanation of an otherwise approved run.

How do you define AI agents in YAML for version control and audit review?

An audit-ready manifest spells out decisions about how the agent should act before it runs. Its fields exist to answer future questions about the agent’s authority and operating context. The model pin identifies the specific model version authorized for the task. That pin prevents silent behavioral drift when a provider changes the underlying model. It also gives a reviewer a precise model reference.

The system prompt and its hash identify the standing instruction set. A prompt modification produces a new hash, making the change visible in the diff and attributable to a commit. The prompt is part of the governed definition. If reviewers check tool access without checking the instructions for using those tools, much of how the agent acts is left out of what they approve.

An explicit allowlist names the shell, file system, MCP tools, or APIs the agent may call, so authority is bounded before the session begins. Budget caps set hard-stop token or cost thresholds rather than leaving spending limits to retrospective monitoring. Both fields state enforceable limits. Their presence in Git makes changes reviewable, while their enforcement still depends on the runtime.

The knowledge index reference identifies the data context available to the agent. Pinning that reference makes a stale-context failure traceable to a specific version of the index, rather than leaving the team to reconstruct what information was available. Context is therefore part of the approved definition. A model version and prompt alone cannot explain a task whose result also depended on a changing knowledge source.

The “propose/dispose” CI pattern gives the manifest an operational boundary. The agent runs against a read-only repository, with write access limited to a designated output directory and all tool calls routed through an audit log. It cannot merge its own pull request. Human review is therefore structurally required, so proposing a change does not also grant authority to approve it.

How sandboxed execution extends the audit trail from config review through runtime

A reviewed manifest establishes intent. The runtime must enforce it. Without isolation, a credential that survives its session or a tool call outside the allowlist can undermine the approved configuration. The review records what should have happened and leaves what was permitted during execution unverified. Sandboxing closes that gap only when its controls preserve the connection between configuration, session identity, and action.

Each session runs in its own container or microVM. Parallel agents do not share a filesystem or credential store, which prevents a failure from spreading through that shared state. Credentials are minted at session start and revoked at session end. This removes persistent session authority after the task finishes. It also gives the audit record a defined interval during which those credentials were available.

Per-tool-call logging records execution at the same granularity as the permissions being enforced. Every tool invocation, diff, and reasoning step is timestamped and tied to the session identity. Egress controls restrict network access to an allowlist. These controls connect the approved scope to observable runtime behavior. Without session-scoped credentials and per-call records, activity cannot be reliably attributed to the reviewed definition.

Isolation also has an infrastructure constraint. Docker containers add negligible CPU overhead, and Firecracker microVMs start in well under a second, so operational complexity is the stronger obstacle described here. Local microVM execution requires KVM. Running KVM inside a CI VM requires nested virtualization, which limits where that model can operate. Cloud-based sandboxes do not need that host support, so they are a practical default when CI runners cannot launch local microVMs.

What the audit trail must cover to satisfy a SOC 2 auditor or regulatory reviewer

An external reviewer needs more evidence than a task that ended successfully. When a SOC 2 auditor asks what an agent did and why, timestamps and tool calls establish only part of the answer. Decision logic and reasoning chains provide the record between the request and the output. Identity mappings must also identify the initiating human or trigger, the credentials used, and when those credentials were revoked.

A budget cap in YAML proves that a limit was defined, but not that execution stopped at that limit. An allowed tools field likewise records what the agent was allowed to call without proving that an out-of-scope call was blocked. Runtime records must show that those policies were enforced.

Integrity is the strongest limitation of a Git-first audit trail. The 2026 arXiv paper LLM Agents Can Easily Tamper With Their Own Traces shows that agent-produced logs are not automatically tamper-resistant. A record the agent could modify cannot serve as independent evidence of its behavior. The pull request remains the authorization boundary and must be paired with tamper-evident runtime logging, including the cryptographic integrity guarantees emerging in “agent flight recorder” approaches.

When events are kept in a separate, agent-specific system, the security team may not see them or be able to link them to other security events. Volume makes retrospective inspection an inadequate substitute for real-time queries. Routing agent events into the enterprise SIEM allows those records to be examined within the broader security context.

How the full lifecycle connects: from YAML review to sandbox run to attributable log entry

Diagram: From YAML Review to Attributable Log: The Agent Lifecycle. Visualizes: Visualize the five-stage sequential lifecycle of a governed AI agent as described in the article: (1) Config Pull Request — model pin, prompt hash, tool allowlist…

The lifecycle begins when the configuration pull request opens. The model pin, prompt hash, tool allowlist, budget cap, and knowledge index become available for review before execution. Human approval is recorded when the change is reviewed and merged. The merged commit identifies the approved configuration at that point in history. That version becomes the reference that connects later sessions to the original authorization.

A session trigger then turns the approved definition into an execution boundary. A fresh sandbox is created, credentials are minted for that session, and egress is restricted to the configured allowlist. During execution, tool calls, diffs, and reasoning steps receive timestamps and the session identity, with events routed to the team’s SIEM. Each record has a specific attribution purpose. It links what happened during the run to both its initiating trigger and its governing configuration.

Credentials are revoked, the sandbox is destroyed, and the closed log remains attributable to the trigger and merged configuration. When an audit question asks what the agent did on Tuesday and who approved its operating scope, the answer spans two connected records. The commit history shows what was authorized, while the tamper-evident session history shows what ran.

Managed infrastructure makes that continuity a platform responsibility. Where sandbox creation, credential minting, session logging, and budget enforcement are platform features, governance does not depend on each team remembering to assemble the same controls for every run. The platform still needs to keep the configuration reference throughout the run. That connection is what makes a YAML file in Git more than a stored agent definition and turns its review into the beginning of an accountable lifecycle.

Sources

  1. From Traceability to Justifiability: Accountability Structures in Agentic Software Engineering
  2. Decision Evidence Maturity Model for Agentic AI: A Property-Level Method Specification
Filed underAgent Governance

More in Agent Governance