Skip to content

Implementation / Field notes

Track prompt versions through a production release

Resolve the prompt revision actually used by each request, including rollbacks and in-flight requests, without retaining raw prompt text.

By DriftRail · Updated

Track a prompt version by resolving an immutable revision when the request starts and writing that revision into the request’s event record. A mutable name such as “production” is a deployment pointer, not evidence of which prompt produced an answer.

The in-flight request problem

A request starts with revision P7. While it runs, deployment changes the production pointer to P8. If telemetry looks up that pointer only when the request ends, it labels P7’s output as P8. The resulting comparison can blame the new prompt for an answer it never generated.

Preserve the resolved revision

  1. Resolve the prompt and revision together before generation.
  2. Carry that revision through model, validation, and final outcome events.
  3. Record application release, model identifier, and retrieval configuration separately.
  4. On rollback, record the restored revision rather than creating an artificial new content revision solely for deployment.

Use hashes carefully

A content digest can help detect accidental changes to a revision, but it is not an access-control mechanism or a safe substitute for secret handling. A digest of low-entropy content may be guessable. Keep full prompt content in the appropriate protected configuration store, and put only necessary identifiers in telemetry.

Verify a rollout and a rollback

The fixture changes a deployment pointer after a request starts and confirms that the request keeps its original revision. In a real rollout, include concurrent requests and a rollback event, then verify that investigators can reconstruct the exact prompt and release without relying on the current pointer.

Run the worked example

Save the synthetic Node.js example and run node track-prompt-versions-in-production.mjs with Node.js 22 or newer. The assertions check the illustrated records and calculations; they do not test a deployed provider, SDK, or access control. No credentials or network connection are needed.

// Synthetic teaching fixture. No credentials, network calls, or production verification.
import assert from 'node:assert/strict';

let deploymentPointer = 'prompt-p7';
const inFlight = { request: 'r1', promptRevision: deploymentPointer };
deploymentPointer = 'prompt-p8';
const later = { request: 'r2', promptRevision: deploymentPointer };
deploymentPointer = 'prompt-p7';
assert.equal(inFlight.promptRevision, 'prompt-p7');
assert.equal(later.promptRevision, 'prompt-p8');
assert.equal(deploymentPointer, 'prompt-p7');
console.log('r1 used p7; r2 used p8; rollback restored p7.');

References and further reading

Maintained by DriftRail. AI assisted the October 2026 content and template revision. Examples are illustrative; they are not measured product benchmarks. Suggest a correction.

From understanding to evidence

Observe your AI in production.

Explore event logging, detections, and review workflows in DriftRail.

Open DriftRail ↗Read the documentation →