Why it matters
- Prompt text is business logic. Untracked changes can introduce risk or inconsistent behavior.
-
Most compliance frameworks require that production code (including prompts) is:
- Immutable after deployment
- Peer‑reviewed before release
- Traceable with a full audit trail
-
Bundling a
prodPrompt Template into an artifact that lives in Git provides these guarantees with almost zero additional tooling. - This also protects your application in the unlikely event that you’re application cannot connect to the Freeplay platform
Prerequisites for this guide
- GitHub repository
- GitHub Actions enabled
- Freeplay CLI
- A Prompt Template already promoted to the
prodenvironment
Step 1 · Bundle the production prompt
Run during your release pipeline:- Prompt text
- Model/provider selection
- All request parameters
Step 2 · Open a pull request if the bundle changes
Add the following workflow file to.github/workflows/prompt-bundle-guard.yml:
What happens?
- Bundle – Regenerates the prod bundle.
-
Diff – If anything changed inside
bundled_prompts/, the workflow:- Pushes the change on a new
auto/prompt-bundle-*branch. - Creates a draft PR that a human must review & merge.
- Pushes the change on a new
- Once merged, the new bundle is locked in Git history.
Tip: Protect main with “Require PR approval” to enforce peer review.
Step 3 · Pin the Bundled Prompt for production systems at runtime
Compliance mapping
| Framework | Requirement | How the workflow satisfies it |
|---|---|---|
| SOC 2 CC4.1 | Peer review of production changes | PR approval required before merge |
| ISO 27001 A.14.2.5 | Secure engineering principles & immutable artifacts | Bundled Prompt is hashed & version‑controlled |
| PCI‑DSS 6.4.5 | Formal approval prior to production | PR review & protected branch policies |
| HIPAA §164.308(a)(1)(ii)(D) | System activity review & audit trails | Git + GitHub Actions logs show who changed what, when |
FAQ & Troubleshooting
Q : What if we maintain multiple prod environments (e.g., per‑tenant)? A : Runfreeplay download --env prod-<tenant> (or similar, given your environment naming conventions) for each environment and store each bundle under its own path.
Q : Can I use Bitbucket Pipelines or GitLab CI instead? A : Yes mirror the same logic: re‑bundle, diff, and open a merge request when changes are detected.
Q : How do I invalidate a bad prompt quickly? A : Revert the bundle commit or promote a previous prompt template version in the Freeplay dashboard and re‑run the workflow.
