Day 94: Change Management for Prompts

Day 94: Change Management for Prompts

Hot-editing the system prompt in a Lambda env var is how you ship an incident without a diff. Prompts are code: version, review, eval, pin.

⚡ TL;DR: Store prompts in Bedrock Prompt Management or git. Pin versions in the gateway. Promote with CI eval gates. No console edits in prod.

Change flow

PR (prompt + eval delta) → CI eval → stage pin → prod pin → monitor
# ✅ Gateway resolves pin, not "latest"
def resolve_prompt(prompt_id: str, env: str) -> tuple[str, str]:
    pin = registry.get_pin(prompt_id, env)  # e.g. "v12"
    body = registry.fetch(prompt_id, pin)
    return pin, body
Rule Why
Diff in PR Reviewable
Eval required Catch regressions
Pin in gateway Determinism
Rollback = repin Minutes, not archaeology

PROMPT=$(curl raw.githubusercontent.com/.../main/...) at runtime.

Failure modes

Two gateways pinning different versions after a partial deploy. Pin config in a single store with atomic swaps. “Emergency” console edits without a follow-up PR — detect drift jobs that diff live vs git.

Closing checklist

  • [ ] Prompt registry with versions
  • [ ] Gateway pins per env
  • [ ] CI eval on prompt PRs
  • [ ] Console write access removed in prod
  • [ ] Rollback runbook = previous pin

Series navigation

Day 93: SLOs for AI Features · Day 95: Incident Response When the Agent Goes Wrong

Last updated September 11, 2026


Discover more from CheatCoders

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply