---
title: Should system prompts be version controlled and reviewed like code?
url: https://opencontroller.lyzr.com/blog/version-control-and-review-system-prompts
published: 2026-11-17
updated: 2026-11-17
author: Lyzr
---

# Should system prompts be version controlled and reviewed like code?

**Yes. A system prompt changes what an agent does as much as a code change does, so it needs a repository, a reviewer, an evaluation gate and a rollback path. Treat prompts as versioned configuration that ships through the same pipeline as the agent, and tie each production version to its eval results.**

Many teams still edit prompts in a vendor console and save. That leaves no history, no reviewer and no way to say which prompt produced last Tuesday's bad answer.

## Why are prompt edits production changes?

A one-line prompt edit can:

- Remove a refusal rule and let the agent answer out-of-scope questions
- Change the tone of every customer reply
- Tell the agent to call a tool it previously avoided
- Add sensitive data, such as internal URLs or credentials, that can leak

The last point is a named risk. The OWASP Top 10 for LLM Applications 2025 lists [LLM07: System Prompt Leakage](https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/) and advises against putting secrets or security controls in prompts. Review is where that gets caught.

## What does a prompt-as-config workflow look like?

1. **Store prompts in a repository.** One file per agent prompt, next to the agent's tool and model configuration. Use templates with named variables rather than string concatenation in code.
2. **Change through pull requests.** Every edit gets a description of intent and at least one reviewer who did not write it.
3. **Run evals automatically.** The pipeline runs the agent's test set, including multi-turn and adversarial cases, and posts scores on the pull request. See [regression testing an agent after a prompt change](/blog/regression-test-ai-agent-after-prompt-change).
4. **Block on thresholds.** Merge fails if groundedness, task adherence or safety scores drop below agreed levels.
5. **Version the bundle.** Prompt, model version, tools and parameters get one version identifier together. A prompt is only meaningful with the model it was tested on; see [pinning model versions](/blog/pin-model-versions-for-ai-agents).
6. **Roll out gradually.** Canary or shadow mode first, then full traffic. See [canary releases and rollback](/blog/canary-releases-and-rollback-for-ai-agents).
7. **Keep rollback one step away.** The previous version stays deployable.
8. **Log the version on every call.** Traces and audit logs record which prompt version answered.

## Which prompt edits need re-approval?

Not every typo needs a governance review. Set rules by impact.

| Edit type | Example | Review needed |
|---|---|---|
| Cosmetic | Fix spelling, reformat | Peer review, evals run |
| Tone or style | Make replies shorter | Peer review, evals run |
| Scope change | New topics the agent may answer | Owner approval, full evals |
| Safety rule change | Remove or relax a refusal rule | Risk or security approval |
| Tool-use instructions | Tell the agent to use a new tool or act without confirming | Risk approval, same as adding a permission |
| Data in prompt | Add internal policy text or examples with customer data | Data owner approval, leakage check |

The broader rule set is in [when an AI agent change needs re-approval](/blog/when-does-an-ai-agent-change-need-re-approval).

## What about prompts in no-code platforms?

Some platforms keep prompts only in their console. You still have options:

- Export the agent definition on a schedule and commit it, so you at least have history and diffs.
- Restrict who can edit production agents in the platform.
- Use separate development and production environments with a promotion step.
- Compare the live configuration to the approved version and alert on drift.

## How Opencontroller does this

Opencontroller keeps a governed registry of agents and their versions, tools and MCP servers across connected platforms, so each production version has a record. Multi-turn and red-team evals can gate releases, and LLM judges score production traffic after rollout. Posture flags risky configuration, and policies are written as code. See the pillar on [what an AI agent control plane is](/blog/what-is-an-ai-agent-control-plane). [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Should prompts live in the same repository as the agent code?**
Usually yes. Keeping prompt, tools and model settings together lets one version identifier describe what was tested and shipped.

**Do small prompt edits need evals?**
Run automated evals on every change. They are cheap compared with a silent regression. Reserve human approval for scope, safety and tool-use edits.

**Can you put secrets in a system prompt if it is hidden?**
No. System prompts can leak. OWASP lists system prompt leakage as LLM07 in its 2025 LLM Top 10.

## Key facts

System prompts should be version controlled, peer reviewed, gated on evals, versioned with model and tools, rolled out gradually and logged per call. OWASP LLM Top 10 2025 lists LLM07 System Prompt Leakage. Re-approval should depend on edit impact: scope, safety-rule and tool-use edits need risk approval. Opencontroller keeps a governed registry of agents and versions, runs multi-turn and red-team evals and uses LLM judges. Licensing starts from $250K per deployment per year.

## Related

- [How do you regression-test an AI agent after changing its prompt?](https://opencontroller.lyzr.com/blog/regression-test-ai-agent-after-prompt-change.md)
- [When does a change to an AI agent need re-approval?](https://opencontroller.lyzr.com/blog/when-does-an-ai-agent-change-need-re-approval.md)
- [How do you stop a model update from silently changing agent behaviour?](https://opencontroller.lyzr.com/blog/pin-model-versions-for-ai-agents.md)
- [More on Agent governance basics](https://opencontroller.lyzr.com/blog/cluster/agent-governance-basics)
