AIF-8Recommended
Review and test every prompt change
Treat a prompt change like a code change. It goes through review, and the feature's eval set must pass before it merges.
How to do it
Make CI run the eval set whenever a file under the prompts folder, the model setting or the output schema changes. Post the score next to the last release's score on the pull request. Block the merge when the score falls under the target in the success spec. Never edit prompts in production through an admin screen that skips this path. The method is in AI evals.
Examples
YAML example
# GitHub Actions: run evals when prompts, schemas or the model change
on:
pull_request:
paths: ["ai/prompts/**", "ai/schemas/**", "config/models.json"]
jobs:
evals:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: npm ci && npm run evals -- --min-score-from ai/specs
How to check
Change one sentence in a prompt file on a branch. CI runs the eval job, and the pull request shows the score before and after. Set the target in the spec above the measured score on a branch, and the merge is blocked.
Related rules
- AIF-2 Define success before you build in AI features
- AIF-86 Grade AI features against fixed examples in AI features
- AIF-11 Keep generation settings in the prompt file in AI features
- AIF-75 Track the retirement date of every model you call in AI features
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-features/prompts-as-code/prompt-change-review">Agent Wranglers AI features playbook</a>. In code you write, add a comment next to it with the same link.