Agent in Production

Treating Agent Behavioral Drift as a Config Diff Problem Git Already Solves

Versioning prompts, models, tools, and permissions makes agent drift reviewable before it ships.

· 8 min read · Updated
Cover illustration for “Treating Agent Behavioral Drift as a Config Diff Problem Git Already Solves”
Agent-as-Code Patterns · November 14, 2026 · 8 min read · 1,889 words

Agents-as-code means putting AI coding agents in version-controlled YAML and related configuration files, then using the usual pull-request review, evaluation, and rollback for those definitions. Treating agent behavioral drift as a config diff problem puts the controllable causes of behavior, including prompts, model versions, tools, permissions, and memory policy, under Git. The goal is not identical responses, but a declared behavioral envelope whose changes are visible before deployment.

Why agent behavioral drift is a configuration problem, not a model problem

Drift feels like a model becoming unpredictable. Yet what changed may be a prompt edit, a different tool schema, broader credentials, or memory that built up without anyone reviewing it. The agent still runs, so infrastructure health checks can remain green while its output deteriorates. Gradual degradation during continued availability is harder to diagnose than a crash, which at least exposes a clear failure boundary.

A tool-call schema change illustrates the mechanism. When a tool returns unexpected data, the model can improvise around it and continue with corrupted context without raising an exception. The workflow seems to succeed even though it can no longer rely on the context for its next action. No model regression is needed to explain that failure. An interface change escaped the controls normally applied to application dependencies.

A model can remain unchanged while the system around it changes what it sees, what it may do, and when it acts. Without a record of those changes, an investigation cannot distinguish a model limitation from a deployment decision. Versioning provides the record needed to make that distinction.

What constitutes the full configuration surface of a coding agent

The prompt is only the starting point. It defines identity, instructions, guardrails, and expected output formats, often through a system prompt or CLAUDE.md file. The model version determines which model interprets those instructions, while tool bindings determine which capabilities it can invoke and through which schemas. These are separate axes, so reviewing a prompt alone does not establish that the agent's operating conditions stayed fixed.

Permission scope defines which credentials the agent uses, what it may read or write, and whether its actions are reversible. Accumulated session state can change later behavior even when the checked-in prompt remains untouched. Stateless agents remove that particular source of drift, while stateful agents require memory to be treated as part of the behavioral specification.

Delegation and initiation extend the surface further. Each Skill is a directory with a SKILL.md file and YAML frontmatter, and Subagents run in their own context windows. Scheduled triggers and webhook bindings decide when the agent begins work. Google Labs' proactivity taxonomy distinguishes reactive, scheduled, and situation-aware initiation modes, each with different behavioral implications. CLAUDE.md, subagent definition files, settings.json, and YAML policy files already provide natural representations for much of this surface, but they need the same versioning discipline as application code.

How do you define coding agents as version-controlled configuration files?

The agents-as-configuration pattern makes the behavioral specification explicit. Instead of allowing an agent's operating rules to emerge from runtime wiring, it places those rules in static, machine-readable files. The analogy to Terraform and Kubernetes is direct. Their declarative files describe desired infrastructure state, while an agent's Cognitive Blueprint describes its desired behavioral state. The runtime is responsible for applying that specification. Ellipsis, a cloud agent platform that runs coding agents on managed infrastructure from YAML definitions checked into the repository, is one runtime built around that model.

“Team-Shared Agent Configuration as Code” names the collaborative version of this pattern. Teams put agent definitions in version control so they can share the same configuration, use it to bring new people on board, and improve it through pull requests. YAML is useful as a declarative representation, but file format alone is not the achievement. The decisive criterion is whether the definition includes the behavioral controls that would otherwise live outside review. A YAML prompt wrapper with undocumented permissions still leaves a significant gap.

Static configuration does not require static responses. The definition governs the envelope, including tools, permissions, model selection, and guardrails. Google Labs' paper separates initiation policy from response content, which makes the boundary clear. When the agent acts belongs in the governed specification, while what it produces remains responsive to context. Stateless execution makes that boundary easier to check because memory that builds up does not quietly add to the declared configuration.

What Git's diff, review, and rollback primitives give you for free once agents are config files

Git makes behavioral changes legible before deployment. A model revision, prompt edit, tool-binding change, or broader permission scope appears in a diff that reviewers can check through the pull-request process they already use. The review artifact is the proposed operational change itself. That gives reviewers a concrete basis for deciding whether the new behavior is intended and whether its scope is acceptable.

Branches provide a place to evaluate the proposal. Evals can run against the changed configuration, with merge gated on passing results. Git history and blame then attribute the configuration change to a person or automated trigger. If the change causes a regression, rollback restores the earlier declared configuration without retraining the model. That guarantee covers configuration restoration only.

Form3's Patch Pilot illustrates why this control must include the harness. It keeps dangerous credentials such as GitHub write access in a deterministic orchestration layer. The orchestration layer is itself subject to configuration review. This separates an agent's proposed action from the authority needed to execute it, bringing the surrounding control mechanism into the same review boundary as the agent definition.

Applying version-controlled config to the axes that cause the most expensive drift

An alert reports spending after it has occurred, while budget enforcement stops further LLM calls until a human or policy resumes execution. The enforceable boundary belongs at the gateway, expressed as policy. Microsoft's TokenOps and Agent Control Specification reflect this runtime-control approach. Snowflake's Cortex AI Gateway likewise places tool access, model access, and AI spend within an agent governance layer.

Permission changes can have a much larger consequence than their diff suggests. Amazon's Kiro agent was given operator-level credentials that bypassed existing guardrails, including a standard two-person approval requirement that did not apply to AI-initiated actions. The resulting AWS Cost Explorer outage lasted 13 hours. The failure concerned an identity and authorization boundary. Declaring that boundary in configuration gives reviewers a place to examine whether an agent receives authority that ordinary approval controls do not cover.

Tool architecture deserves equally explicit review. Microsoft Research's COLM 2026 study looked at 11,700 agent trajectories and found that changing how tools were organized and exposed changed behavior even when what the tools could do stayed similar. Consistency across repeated attempts, repository exploration breadth, and token usage shifted with those choices. Tool wiring is therefore a behavioral decision. A reviewable definition must capture both the agent's access to capabilities and how those capabilities are exposed.

What the config diff must include to satisfy audit and compliance requirements

An audit needs more than an action log. Execution observability records what an agent did, while intent observability records the declared configuration and authorization under which it acted. A configuration commit gives that record without claiming to explain how the model reasoned internally. Connecting that record to execution tracing makes it possible to examine an action against the rules that were meant to govern it.

The Singapore IMDA Model AI Governance Framework for Agentic AI, issued in January 2026, calls for a digital identity that can be verified and an audit trail showing which agent acted and who authorized it. Declared identities and permission scopes support that requirement more directly than inherited credentials. NIST's CAISI launched its AI Agent Standards Initiative on February 17, 2026. Its program covers standards led by industry, work to develop open-source protocols, and research into agent security and identity. Versioned, scoped, attributable configuration provides a useful foundation for that work, rather than a substitute for the standards themselves.

The record must also reach the execution layer. Prompt versions, guardrail verdicts, eval scores, tool calls, and policy decisions should be first-class span attributes so an audit export connects declared controls with observed decisions. Such evidence supports EU AI Act Article 12 and related obligations, as well as NIST AI RMF functions. Git history records configuration changes and needs supplementary records to account for every runtime action. The compliance asset is the combined record, produced as a byproduct of engineering discipline.

Where sandbox and infrastructure design fit into the config-as-control-plane model

Budget caps, permission scopes, and tool restrictions need an execution layer that the agent cannot get around. For production agents, the emerging pattern keeps the agent loop outside the sandbox and exposes the sandbox as a tool. Anthropic describes this as decoupling the brain from the hands. Credentials stay outside the sandbox, a sandbox crash does not end the session, and the control layer can inspect traffic between the agent and its tools.

The isolation boundary is itself a governed choice. Hosted agent sandboxes commonly use microVMs for untrusted model-generated code, providing kernel-level isolation. Daytona moved its production codebase to a closed-source repository in June 2026, citing the risk that AI-assisted attackers could use public isolation and kernel-boundary implementations as an exploit blueprint. The infrastructure beneath an agent is not separate from the policies meant to constrain it.

Local execution adds no sandbox cost but shares the developer's machine and cannot supply enforcement for a server-side or CI agent. Cloud execution provides separation for those environments. Azure and Cloudflare primitives can suit teams that already work within those controls, though building applications with them may take more work than using managed platforms built for agents. Self-hosted alternatives require assessment of licensing, maintenance, kernel and VM security, and operational burden before they can be treated as managed-service replacements.

What the config-diff workflow looks like in practice for an engineering team

Most teams already have the necessary review primitives. Start by defining each behavioral axis in a checked-in file, including the system prompt, model version and pinned revision, tool bindings and schemas, permission scope, budget caps per session and per period, and scheduled triggers. Skills and subagent definitions belong in the same review boundary. Each SKILL.md and subagent file can change the parent agent's effective behavior, even if the parent's own configuration stays untouched.

A configuration change opens a pull request, runs evals on a branch, requires review, and merges only on passing. Credential references belong in the definition, but credential values do not. Secrets stay in a vault and outside the agent's runtime environment, while configuration declares which credential the session uses. That distinction lets reviewers assess authority without placing secrets in the repository.

When a configuration change causes drift, the recovery action is a git revert. Its purpose is to restore the previous declared operating conditions, with the scope of the commit defining the configuration being rolled back. Enforcement and execution tracing remain necessary after that restoration.

Greater autonomy makes this discipline more necessary. Google Labs' proactivity paper identifies situation-aware agents that update their own interruption policy from feedback as the next frontier. Such adaptation expands the configuration surface because the rules for initiating work become more complex. The stronger case for Git is therefore not that agents will become static, but that increasingly adaptive systems need an explicit, reviewable account of the rules under which they change.

Sources

  1. Agentic Coding Needs Proactivity, Not Just Autonomy
  2. The Devil Is in the Interface: Evaluating How Tool Architecture Shapes Coding Agent Behavior

More in Agent-as-Code Patterns