Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Treating Prompts as Configuration
Python & Django

Treating Prompts as Configuration

Managing prompts as versioned configuration in a live AI system: testing every change against an evaluation set, one-step rollback and version tracking.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Prompts belong in versioned configuration, not in code. Every change should run against the evaluation set before deployment, and rollback should be one action.

Prompts change more often than code

A prompt is adjusted when output quality shifts, when the business changes its terminology, or when a provider updates a model. That happens far more often than the surrounding code changes.

A prompt embedded in a function requires a deployment to change. In configuration, it requires an evaluation run and a configuration update, which is the right level of ceremony.

What good management looks like

  1. Versioned, with a history of what changed and why
  2. Tested against the evaluation set before going live
  3. Rollback in one action to the previous version
  4. Recorded on every output, so results can be explained
  5. Reviewable by someone who understands the business, not only a developer

Test every change

  • Run the full evaluation set before deploying
  • Compare the score against the current version
  • Look at what changed, not just the total
  • Block the change if the score drops beyond normal variation

Prompt changes have side effects. Improving one behaviour frequently degrades another, and only the evaluation set reveals it.

Record the version on every output

When an output is questioned months later, the answer requires knowing which prompt and which model produced it. Recording both costs nothing and is the difference between explaining and guessing.

It is also what lets you correlate a quality change with the change that caused it.

Keep them readable

PracticeWhy
Plain language, not shorthandOthers must be able to change it
Comments on non-obvious instructionsNobody removes them by accident
One prompt per taskTestable independently
Examples in the prompt kept currentThey drift from reality
No hard-coded business rulesThose belong in code

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

Should prompts be in a database or files?

Either, versioned. Files in version control give you history and review for free; a database gives non-technical editing.

Who should be able to change prompts?

Whoever understands the business requirement, with an evaluation run gating the change. Not only developers.

How often do prompts need changing?

Every few months in a stable system, more often initially. Provider model updates are a common trigger.

What about prompt injection?

Treat all user input as untrusted, keep it clearly separated from instructions, and never let it reach a tool call without validation.

Keep reading

More on Python & Django

Python & Django

An API Other Systems Can Depend On

Designing a Python API service others can depend on: validation at the boundary, consistent errors and status codes, early versioning and documentation.

Python & Django

Moving and Transforming Data Reliably

Building data pipelines in Python that cope with malformed input: restartable stages, quarantining failures, reconciling counts and alerting on absence.

Start here

Prompts buried in code?

Moving them to versioned configuration is a small change that makes everything else easier.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →