Platform Engineering3 January 20278 min read

Build Lab: From Chain to Governed Agent — Part 8 of 8

Production packaging, version pinning and rollback

An agent's behaviour depends on its code, locked dependencies, runtime, model, prompts, tools, graph configuration and index, and any of them can change without a code commit. Part 8 of Build Lab: From Chain to Governed Agent defines the release manifest, the gate a release must pass, and why rolling back an agent is also a question about the threads already in flight.

#AI Agents#Release Management#Software Supply Chain#LangGraph#Production AI

Consider an illustrative Friday afternoon. The platform team rebuilds the agent's container to apply an operating system patch. Nobody touches the agent's code. One dependency was specified as "at least" a version rather than an exact one, so the rebuild picks up a newer minor release. The same afternoon, a prompt is edited in a web console to fix a typo, and the provider moves a model alias to a newer model. On Monday the regression evaluation that passed last week fails on a third of the exception cases. The team decides to roll back, and then discovers it cannot say what to roll back to. Reverting the code changes nothing, because the code never changed.

Agent stacks move quickly. Imports move, packages split, adapters are retired and small releases change event or tool-call behaviour. The third-party LangChain 101 manual that started this series recommends pinning every package to an exact version and installing from a lockfile, and gives an example of a minor release changing stream events. The official policy says the same thing from the other side.

Treat everything that can change an agent's behaviour as one release unit, pinned and recorded in a manifest, admitted only through an evidence gate, and rolled back as a unit with an explicit rule for the threads, checkpoints and side effects already in flight.

Semantic versioning promises compatibility, not identical behaviour

LangChain's versioning page (accessed 25 November 2026) states that its open-source packages follow MAJOR.MINOR.PATCH: major releases carry breaking API changes, minor releases add backward-compatible features and patches fix bugs. It also stated, on that date, that Deep Agents is a pre-1.0 package whose API may change between minor versions, and that the legacy LangChain 0.3 and LangGraph 0.4 lines would stay in maintenance until December 2026. A team still on those lines in January 2027 should check their current status before assuming any further fixes.

Two cautions follow. First, an API that is backward compatible can still change what your agent does, because an agent's behaviour depends on events, defaults and timing as well as function signatures. Only your own evaluations can tell you whether a release changed the outcome for your cases. Second, the interpreter is part of the pin. At the time of writing, PyPI listed langchain 1.5.2 with a requirement of Python 3.11 or later, and langgraph 1.2.24 with Python 3.10 or later. An environment on an older interpreter may quietly resolve an older line.

Package versions are only one layer. An AI bill of materials must include more than packages lists the rest, and Continuous learning must not silently change the rules puts prompts, models and indexes through one change gate.

The release manifest

The decision tool for this part is the release manifest. A release that cannot fill every row is not ready, and a running service that cannot report its manifest cannot be rolled back with confidence.

An agent release unit. The release manifest pins the runtime and image digest, the lockfile, the exact model identifier, the prompt version, tool and MCP server versions, the graph and configuration version, the index version, the policy version, the state schema version and the evaluation evidence. A promotion gate has six steps: a clean install from the lockfile, a regression experiment, resume safety tests, tool and MCP compatibility tests, a shadow run with no side effects, and a rollback plan that names the previous manifest. A promoted release writes its manifest into every trace. If it fails, it is rolled back as one unit, with rules for threads in flight: paused threads resume on the old release or drain on the new one, side effects need a compensating action, controls do not loosen silently, and old traces keep their versions. Rolling forward with a targeted fix is sometimes safer.RELEASE MANIFESTRuntime and image digestLockfileExact model identifierPrompt versionTool and MCP versionsGraph and configurationIndex versionPolicy versionState schema versionEvaluation evidencePROMOTION GATESTEP 1Clean installfrom lockfileSTEP 2RegressionexperimentSTEP 3Resumesafety testsSTEP 4Tool and MCPcompatibilitySTEP 5Shadow run, noside effectsSTEP 6Rollback plannames previousPromote: manifest written into every traceif it fails, roll back as one unitROLLBACK WITH THREADS IN FLIGHTPaused threadsresume on old ordrain on newSide effects needa compensatingactionControls do notloosen silentlyOld traces keeptheir versionsSometimes rolling forward with a targeted fix is the safer move
Reverting code is not a rollback when the code never changed. CloudNala analysis.
ComponentPin it asRollback note
RuntimeInterpreter version and container image digestKeep the previous image; never rebuild it to roll back
DependenciesExact direct pins plus a lockfile for the full treeRestore the lockfile, not a looser range
ModelExact model identifier and provider route, never a moving aliasConfirm the old model is still offered
Prompts and instructionsVersion identifier from a prompt registry or the repositoryRoll back with the release, not by hand in a console
Tools and MCP serversServer version and supported protocol versionOld and new servers may need to run side by side
Graph and configurationGraph version, assistant or configuration versionConfiguration and graph must match
Retrieval indexIndex version and source snapshot dateOld index must still exist
Policy and thresholdsApproval and escalation rule versionA rollback must not relax a control silently
State schemaVersion of the checkpointed state shapeDecide how old and new threads are handled
EvidenceEvaluation experiment and resume test resultsThe previous release's evidence must still be valid

Three rows need comment. For MCP, the versioning page (accessed 25 November 2026) explains that protocol versions are dates marking the last backwards-incompatible change, that the current version on that date was 2026-07-28, and that each request declares the version it uses, so a server may accept or reject requests per version. Record which protocol versions your client and each server support. An MCP upgrade is a production change works through a compatibility matrix.

For configuration, LangSmith's assistants page (accessed 25 November 2026) describes an assistant as an instance of a graph with a specific configuration, such as prompts, model and tools. Each update creates a new version, any version can be promoted to active, and rolling back means setting a previous version active. That is useful, but it versions configuration only. The code, lockfile and image behind it still need their own pins.

For state, a checkpoint written by one release must be readable by the next, and by the previous one if you roll back. If a release changes the shape of the state, version it and decide in advance whether old threads finish on the old release or migrate.

Packaging and the promotion gate

LangGraph's application structure page (accessed 25 November 2026) describes a langgraph.json configuration file naming the dependencies, the graphs and an env file, alongside a dependency file such as pyproject.toml or requirements.txt. The page does not discuss pinning. The configuration says what to install, and your lockfile has to say exactly which versions.

Make the service check its own manifest at start-up, so a drifted environment fails loudly instead of answering people.

# Illustrative; check against the current documentation.
import sys
from importlib.metadata import version

MANIFEST = {"python": "3.12", "langgraph": "1.2.24", "langchain": "1.5.2"}

def check_release_manifest() -> None:
    running = f"{sys.version_info.major}.{sys.version_info.minor}"
    if running != MANIFEST["python"]:
        raise RuntimeError(f"Python {running}; manifest expects {MANIFEST['python']}")
    for package, pinned in MANIFEST.items():
        if package != "python" and version(package) != pinned:
            raise RuntimeError(f"{package} {version(package)} is not pinned {pinned}")

The values are examples taken from PyPI on 25 November 2026, not a recommended set. Write the full manifest into every trace's metadata as well, so Part 7's fifth question always has an answer.

The gate before promotion. A candidate release is promoted only when it can show:

  1. a clean install from the lockfile on a machine that has never seen the project;
  2. the regression experiment from Part 7 passing on the full dataset, compared with the current release;
  3. the resume safety tests from Part 6 passing, including restart and duplicate resume;
  4. tool and MCP compatibility tests against the server versions in the manifest;
  5. a shadow or limited run on real request shapes with no side effects;
  6. a written rollback plan naming the previous manifest.

A migration note goes with every framework change: what moved, which imports changed, which behaviour was re-tested.

Rolling back an agent means handling its state

Rolling back a stateless web service means routing traffic to the previous build. An agent is not stateless. At the moment of rollback there may be threads paused for approval, checkpoints written by the new release and actions already taken.

  • Paused threads. Decide whether they resume on the old release, which must then read their checkpoints, or are drained on the new release before it is switched off.
  • Side effects. A message sent or a record changed is not undone by a rollback. It needs a compensating action, recorded like any other action, and the idempotency keys from Part 6 stop a resumed thread repeating it.
  • Controls. If the new release tightened an approval threshold, rolling back must not quietly loosen it. Policy versions roll forward independently when needed.
  • Evidence. Traces from the bad release keep their version metadata, so complaints about that period can still be reconstructed.

Sometimes the safer move is to roll forward with a targeted fix. The manifest makes that a decision with evidence instead of a reflex.

What this means for NalaTolika

NalaTolika is a CloudNala concept and reference architecture for governed language interpretation. It has no customers, deployments, pilots, data or results. Its release unit would include the language glossaries and the language-route configuration alongside the model, prompts, index and policy, because a glossary change alters an interpreted answer as surely as a new model does. The series design rule holds at release time: the chains that interpret, the graphs that control decisions and the human approval thresholds all ship, and roll back, as one recorded unit.

How CloudNala can help

CloudNala helps teams turn an agent prototype into a releasable unit. We draw up the release manifest with your platform and service owners, set up exact pins and a lockfile, add a start-up manifest check and version metadata to traces, build the promotion gate around your evaluations and resume tests, and rehearse a rollback with paused threads in flight.

This is the last part of the series. Read all eight parts on the series page, work through the Chain-to-Governed-Agent Readiness Checklist, and see the companion insight, The framework is not the product. Previous: Part 7, Tracing, evaluations and failure reconstruction.

Sources and limits: this article is CloudNala analysis. LangChain, LangGraph and LangSmith policies and features are described from docs.langchain.com pages, MCP versioning from modelcontextprotocol.io, and package versions and Python requirements from PyPI, all accessed on 25 November 2026; all of these change. The LangChain 101 manual at aiengineeringfromscratch.com is a third-party source, cited for its pinning advice only. The code is illustrative. The Friday scenario is illustrative and describes no real service. NalaTolika is a concept with no deployments.


Work with CloudNala

CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.

Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.

Book an AI Production Readiness Review or write to us at consult@cloudnala.co.za

Found this useful?

Share