Skip to content
AgenticAIWiki
  1. Learn
  2. Part 13
  3. 72. Rollouts and incident response
  4. 72.1

Lesson 72.1 · 1 of 7 · 4 min read · Reviewed 24 Nov 2026

Versioning prompts, tools and models

By the end, you can

  • Version prompts, tools and model choices.
  • Trace every answer back to the versions that made it.

A model-backed feature has more moving parts than ordinary code: prompt text, examples, tool descriptions, model idModel id: The exact string that names a model in an API request, such as a specific model version., settings and retrieval config. Any of them can change behaviour.

Version everything

release: support-bot 2026.11.3
  system_prompt: v14
  few_shot_examples: v5
  tools: v6 (lookup_order, issue_refund, escalate)
  model: <exact model id>
  effort: low, max_tokens: 800
  retrieval: index v9, top_k 6

Store this in source control, review it like code, and deploy it like code.

Log versions on every trace

Put the release id (or each component version) on every traceTrace: A record of everything that happened during one request or agent run, as a tree of timed steps.. When metrics move, filter by version and compare.

Pin exact model ids

Use the exact model id from the models page in production. If you use an alias that can move to a newer model, you’ve let someone else ship a change to your app. Upgrade deliberately (72.4).

Small changes, often

Change one thing per release where you can. Three changes at once make it hard to tell which helped and which hurt.

Key points

  • Treat prompts, tool definitions and model ids as versioned config, stored in source control.
  • Log the versions on every trace so you can tell which change caused a behaviour.
  • A release is a specific combination: prompt v14 + tools v6 + model id; test and ship them together.
Hands-on labRuns in the Playground

Pin a release and trace answers to it

Treat a release as one versioned combination, tag traces with it and find the change that moved a metric.

You will have: A release check that rejects moving aliases, per-release resolution rates and a diff between two releases.

Steps

  1. Run the starter: one mixed resolution rate, and the alias release passes.
  2. Reject a model id ending in -latest.
  3. Group the traces by release and compare resolution rates.
  4. Diff the two releases to find the one component that changed.

Done when

  • Release 2026.11.4 is rejected for using an alias.
  • Resolution falls from 82% to 71% between releases.
  • The diff shows only system_prompt v14 -> v15.

Open in the Playground No API key needed.

Starter code (Python)
# Treat a release as one versioned combination, tag every trace with it, and find which change moved a metric.
import hashlib
import json

RELEASES = {
    "2026.11.2": {"system_prompt": "v14", "examples": "v5", "tools": "v6", "model": "claude-sonnet-5-5", "max_tokens": 800},
    "2026.11.3": {"system_prompt": "v15", "examples": "v5", "tools": "v6", "model": "claude-sonnet-5-5", "max_tokens": 800},
    "2026.11.4": {"system_prompt": "v15", "examples": "v5", "tools": "v6", "model": "claude-sonnet-latest", "max_tokens": 800},
}


def fingerprint(cfg):
    return hashlib.sha256(json.dumps(cfg, sort_keys=True).encode()).hexdigest()[:8]


def check_release(cfg):
    # TODO 1: reject a model id ending in "-latest": it is an alias someone else can move
    return "ok"


for rid, cfg in RELEASES.items():
    print(f"{rid} [{fingerprint(cfg)}] {check_release(cfg)}")

# Traces from production, each tagged with the release that produced it: (release, ticket resolved?)
TRACES = ([("2026.11.2", i % 100 < 82) for i in range(300)]
          + [("2026.11.3", i % 100 < 71) for i in range(300)])


def rate_by_release(traces):
    # TODO 2: group by release instead of mixing every trace into one number
    return {"all": sum(ok for _, ok in traces) / len(traces)}


rates = rate_by_release(TRACES)
for rid, rate in rates.items():
    print(f"resolution rate {rid}: {rate:.0%}")


def diff(a, b):
    # TODO 3: list each component whose version differs, as "name old -> new"
    return []


print("changed between 2026.11.2 and 2026.11.3:", "; ".join(diff("2026.11.2", "2026.11.3")))
Show a solution
# Treat a release as one versioned combination, tag every trace with it, and find which change moved a metric.
import hashlib
import json

RELEASES = {
    "2026.11.2": {"system_prompt": "v14", "examples": "v5", "tools": "v6", "model": "claude-sonnet-5-5", "max_tokens": 800},
    "2026.11.3": {"system_prompt": "v15", "examples": "v5", "tools": "v6", "model": "claude-sonnet-5-5", "max_tokens": 800},
    "2026.11.4": {"system_prompt": "v15", "examples": "v5", "tools": "v6", "model": "claude-sonnet-latest", "max_tokens": 800},
}


def fingerprint(cfg):
    return hashlib.sha256(json.dumps(cfg, sort_keys=True).encode()).hexdigest()[:8]


def check_release(cfg):
    if cfg["model"].endswith("-latest"):
        return "rejected: model is an alias that can move; pin the exact id"
    return "ok"


for rid, cfg in RELEASES.items():
    print(f"{rid} [{fingerprint(cfg)}] {check_release(cfg)}")

# Traces from production, each tagged with the release that produced it: (release, ticket resolved?)
TRACES = ([("2026.11.2", i % 100 < 82) for i in range(300)]
          + [("2026.11.3", i % 100 < 71) for i in range(300)])


def rate_by_release(traces):
    out = {}
    for rid in sorted({r for r, _ in traces}):
        rows = [ok for r, ok in traces if r == rid]
        out[rid] = sum(rows) / len(rows)
    return out


rates = rate_by_release(TRACES)
for rid, rate in rates.items():
    print(f"resolution rate {rid}: {rate:.0%}")


def diff(a, b):
    return [f"{k} {RELEASES[a][k]} -> {RELEASES[b][k]}" for k in RELEASES[a] if RELEASES[a][k] != RELEASES[b][k]]


print("changed between 2026.11.2 and 2026.11.3:", "; ".join(diff("2026.11.2", "2026.11.3")))
Quick checkQuality dropped yesterday and three things changed. What lets you find which one caused it?
How sure are you?
Pick an answer and how sure you are