Applying Developer-Grade Dependency Rigor to AI Coding Agent Environments
Pinned, versioned environments make agent sessions reproducible.

AI coding agents need declarative, pinned, reproducible environments for both their execution runtime and their MCP servers. Applying developer-grade dependency rigor means versioning that specification with the code, installing it deterministically, and retaining a known-good state for rollback. This makes the environment a verifiable input to every session rather than something each agent must discover and repair.
Why AI coding agents inherit the environment reproducibility problem — and amplify it
An agent that plans work, runs commands in its own session, and returns a finished change is an orchestrator. Its environment shapes every step, including how it verifies success. A change in tool version can therefore change the plan, how the agent carries it out, and the evidence it uses to judge its output. The failure need not stop at one command. Without a human supervising environment state, an agent can continue through a broken setup, spending tokens on work that the next session cannot reproduce.
The 2026 study AI-Generated Code Is Not Reproducible (Yet) found that only 68.3% of generated projects executed out-of-the-box in a clean environment using the dependencies the model declared. Declared dependency lists expanded by more than an order of magnitude on average to reach what execution required. The declaration was not the complete environment. Reproducibility is consequently a prerequisite for verifying or deploying an agent’s work.
What breaks when an agent bootstraps its own environment from scratch each session
BootstrapAgent research documents a familiar sequence of repository exploration. An agent reads the README, inspects package metadata and CI workflows, infers setup commands, executes them, observes failures, and attempts repairs. Successful discoveries remain trapped in the conversation. The next session has no record of which dependencies were resolved, which working-directory corrections were made, or which repairs worked, so it can repeat the same search. The research reports that a failed baseline bootstrapping attempt used roughly 185,000 tokens and nearly two hours before giving up.
The repository’s existing documentation does not necessarily resolve that ambiguity. README files may explain package usage rather than development setup, while CI workflows can depend on secrets, caches, service containers, or specialized hardware unavailable locally. Package metadata rarely supplies the minimal command that proves a checkout is usable. These are different kinds of missing information. Installing the declared packages alone cannot tell an agent which working directory to use or how to check that the setup works.
The reproducibility study also found that most execution failures came from fundamental code generation errors. Malformed syntax, incorrect file paths, and uninitialized variables complicate any diagnosis that treats installation as the entire problem. Wrong assumptions about the runtime can shape the generated code itself. Yet HumanEval and MBPP assume that a reproducible environment already exists and test functional correctness within it. Those benchmarks leave the prerequisite unmeasured, obscuring the setup failures that prevent an otherwise useful agent from completing real work.
How do agents use the exact same dependencies every run? Developer-grade rigor defines the requirements
Developer-grade dependency rigor requires pinned toolchains, versioned manifests, deterministic installs, and rollback capability. These controls must govern both the dependency files the agent writes into a project and the runtime where it executes. Pinning states which tools, runtimes, and libraries to use, so they do not have to be resolved from whatever is available when a session starts. The environment also includes the toolchain and other execution dependencies that a language-specific dependency list may not describe.
The requirement is a single source of truth that is both human-readable and machine-verifiable. A declarative manifest makes the intended environment reviewable, while version control makes changes attributable to a particular revision. Deterministic installation then turns that specification into a repeatable result. For a given supported target, the same inputs must produce the same environment, even when other sets of versions might work together. Supporting multiple platforms does not remove the need to define and reproduce the environment on each target.
Rollback completes the standard because updates can break agent behavior even when the change was deliberate. A team must be able to recover the last known-good environment without reconstructing it from logs. That requirement also applies to individual sub-agents. Replacing or upgrading one sub-agent is not an independent change if its runtime is shared and mutable. Pinning and versioning each runtime preserves the boundary that a modular agent architecture is supposed to provide.
How the MCP layer introduces a new category of environment dependency that must be version-pinned
MCP servers belong in the environment specification because they supply capabilities the agent depends on at runtime. Git servers, file-system servers, and database connectors can drift just as application libraries can. Their behavior can still change when protocol compatibility stays the same. MCP separates tool capability from agent identity, but that separation does not guarantee that two versions of a server expose the same tool schemas. An agent configuration pointing to mcp-filesystem:latest can therefore change behavior after a breaking schema update without any corresponding change to the agent’s own code.
The dependency-management response is to treat each server as a pinnable artifact. A proposed MCP reproducibility pattern combines containerized servers with immutable image tags pinned in agent configuration. It also serializes the tools/list response as a fixture so that CI can fail on schema drift. Health endpoints expose server versions and tool hashes. Together, those controls distinguish the intended server from the capabilities it actually presents, rather than assuming that a successful connection proves compatibility.
This extends the scope of a reproducible Python environment for an MCP server beyond its Python packages. The runtime, server version, and tool definitions are all part of the agent’s execution contract. Each needs an explicit place in that contract. Versioning MCP configuration in a shared manifest also gives platform teams a central point of control over the tool surface available to different agents, independent of which agent vendor supplies the caller.
Why the supply chain risk of agent-generated code exceeds what an SBOM alone can govern
An AI coding agent affects the software supply chain in two places. It installs packages into its own runtime and introduces dependencies into the code it generates. Model weights and container images add further provenance questions when they come from unverified sources. Traditional package scanners cannot read an AI model in the same way they inspect an ordinary dependency. Governance must therefore account for the agent as an actor that selects and uses inputs.
An SBOM remains necessary for identifying components and their versions. Its boundary is behavior. A package with a clean dependency tree can still do harm, and generated code can pass inventory checks while adding security risks that show up only when it runs. SBOM validation must be supplemented by runtime controls and evidence of what the agent did.
An input-derived hash attached to the environment definition shows the exact environment state linked to an introduced CVE, while structured logs record what ran for compliance and debugging. Neither replaces the component inventory. Together, the SBOM, environment identity, and audit trail connect the ingredients to the runtime and its actions. The practical security boundary is therefore broader than the generated artifact, extending to the environment in which the agent selected dependencies, executed tools, and produced that artifact.
How persisting bootstrap knowledge as a verifiable contract breaks the ephemeral-session failure loop
The response to repeated bootstrap exploration is to preserve its successful results as a reusable contract. BootstrapAgent implements this pattern through a persistent .bootstrap contract containing environment setup, diagnostic checks, minimal verification commands, and accumulated repair knowledge. Recording commands is not enough on its own. The framework replays the contract deterministically in a clean Docker environment before producing the final version.
That verification separates a reusable procedure from a transcript of one successful session. Warm repair allows fast iteration within the same container, but the final contract must survive a cold-start replay. Otherwise, setup could depend on state left behind during exploration. Delta repair with a sanity check addresses a different failure mode, in which an agent weakens a verification step while leaving the underlying problem unresolved. The contract must preserve the meaning of success as well as the steps that reach it.
The BootstrapAgent paper reports a 92.9% bootstrap success rate on three benchmarks, with downstream token usage reduced by roughly a quarter and build time by roughly a fifth. Exploration becomes durable only when its output can be replayed and tested. A human-readable, version-controlled contract gives subsequent agents access to that output, while a clean replay establishes that the setup does not rely on hidden session state.
What reproducible agent environments look like in practice — pinned manifests, runtime governance, and rollback
A production environment combines a pinned manifest, deterministic runtime governance, and generation-based rollback. The manifest describes the full dependency graph in a reviewable file rather than making a container image the only record of the environment. It includes the execution dependencies and the MCP tool surface. Changes can then be reviewed as changes to the environment specification, with container artifacts derived from that specification where needed.
For teams implementing this pattern, Flox is one option that uses a version-controlled manifest.toml to give agents and human developers the same hash-pinned, reproducible environment. It supports rollback to an earlier environment generation when an update breaks behavior.
Runtime governance supplies a different control from dependency pinning. Policy decisions must be enforced deterministically below the model layer, before actions reach the wire, rather than depending on the model to comply with an instruction. A pinned environment keeps dependencies from drifting between sessions. It does not, on its own, authorize every action available within that environment. Keeping those responsibilities distinct makes it possible to review both what the agent can execute and what it is permitted to do.
Generation-based rollback makes recovery concrete. Each environment change creates a new generation with a known-good predecessor, so a broken update can be reversed by restoring the manifest and pulling the previous generation without rebuilding an image. An input-derived hash shows which state is being restored. The same rules apply across Linux and macOS, x86-64 and ARM, and CI, with reproducibility defined for each supported target. A complete declarative dependency graph can also produce a deterministic SBOM from the same inputs that built the environment, so the inventory comes from the specification without a separate step to piece it back together.
Applying environment rigor at the platform level so every agent session inherits it automatically
Repository-level rigor is necessary, but it remains fragile if every new team or agent must assemble the controls independently. A platform makes the approved environment the starting point. Platform teams publish named, versioned environments, and agent sessions pull the full stack when needed with a single command. Each pull is pinned to a specific generation. A later session therefore gets the same environment unless a planned and reviewed update changes the selected generation.
The DORA 2025 Report found a direct correlation between how good an internal platform is and how much value an organization can get from AI. That finding supports treating environment infrastructure as part of agent delivery. The onboarding benefit follows from the same mechanism. A new agent or human developer pulls a named artifact instead of interpreting setup instructions and resolving their omissions. Agents can share access without sharing mutable state because the environment’s identity stays tied to a versioned generation.
The platform also gives governance a durable point of attachment. Versioned changes and input-derived hashes show which environment was deployed, while structured audit logging records what ran and human oversight hooks let people step in. The platform should make them inherited properties of every session from the start. Dependency rigor enters the workflow either through a platform designed to provide it or through the repair work after a reproducibility failure in production.


