Back to guides

Guide · AI Lifecycle

Version Prompt and Context Artifacts in Production

If prompts live only in a Slack paste or an untracked YAML on one laptop, you cannot roll back a bad change. Production AI needs prompts and context packs as versioned artifacts.

Unversioned prompts are untracked deploys—APRF expects prompt and context packs as release artifacts. Primary control: Prompt Engineering

Prompts are deploys

A system prompt pasted from Slack, edited live in a vendor console, or shipped as an env var from one laptop is an untracked release. When quality or refusals collapse, you cannot restore yesterday's text. APRF Prompt Engineering (and Context Engineering for packs) treats those strings as artifacts: ID, version, review, pin, rollback.

A coding agent once shipped a new system prompt via laptop env. Hallucinated file deletes spiked. Nobody had the prior text. Rollback was guesswork until prompts lived in git with semver and PR review.

What to version together

A context pack is the bundle that assembles what the model sees: instructions, tool schemas, retrieval/policy snippets that ship as a unit. Pin:

- `prompt_version`

- `context_pack_version`

- `model_id` (Model Governance—change one at a time when debugging)

Serve from git tags, an artifact registry, or immutable DB rows with history—not a single mutable string titled "the prompt."

Release path

1. PR with eval evidence (Evaluation gate)

2. Canary via feature flag on the new versions

3. Full pin in production config

4. Every request log carries the three IDs above

If you cannot answer "which prompt served this harmful answer?" from logs, the Observability side of the gate is still open.

Assess against APRF Core

Run the Core Profile quiz — gated pass/fail blockers for AI production readiness, not a vanity score.

Frequently asked questions

Should prompts live in the database?
You can serve from a DB, but treat rows as immutable versions with audit history—not a single mutable string. Prefer git or an artifact store as the source of truth.
What is a context pack?
The versioned bundle of instructions, schemas, and retrieval policies that assemble the model context—beyond a single system prompt string.
How does this relate to model versioning?
APRF Model Governance pins model IDs the same way. Pin model + prompt + context pack together so incidents are reproducible.