PM-201c · Module 3

Prompt Deployment Patterns

3 min read

Where you store a production prompt determines how quickly it can be updated, who can update it, and whether a change requires a code deployment. Three options exist: embedded in code, externalized to config files, or stored in a database. Each represents a different tradeoff between control, flexibility, and operational complexity. The right choice depends on how frequently prompts change and who is responsible for maintaining them.

  1. Pattern 1: Embedded in code The prompt lives in the application code as a string constant. Changes require a code commit, code review, and deployment. Use this when: prompt stability is high, prompts must be reviewed by engineers before deployment, and the overhead of a code deployment is acceptable. Benefit: full version control with your codebase. Cost: any prompt update requires a deployment cycle.
  2. Pattern 2: Externalized to config files The prompt lives in a configuration file (YAML, JSON, TOML) that is loaded at application startup. The config file is version-controlled but can be updated separately from the application code. Use this when: prompts change frequently but do not need runtime modification, and non-engineers need to review prompt changes. Benefit: prompts can be reviewed and merged without touching application logic. Cost: still requires a deployment for updates.
  3. Pattern 3: Database storage The prompt lives in a database and is loaded at runtime. Updates are made through an admin interface — no deployment required. Use this when: prompts change frequently, business users need to modify prompts without engineering involvement, and different users or tenants need different prompt variants. Benefit: instant updates without deployment. Cost: prompts are no longer in version control unless the database system provides audit logs; harder to test before live deployment.

Do This

  • Match the deployment pattern to the update frequency and ownership model
  • Implement audit logging regardless of which pattern you choose
  • Use code or config patterns when engineering review is required before changes go live
  • Use database storage only with compensating controls: audit log, approval workflow, automated testing

Avoid This

  • Do not use database storage without audit logging — undocumented changes will occur
  • Do not embed prompts in code if business users need to modify them on a weekly cadence
  • Do not choose a deployment pattern based on convenience alone — consider the governance implications
  • Do not mix patterns for the same prompt across environments without documenting the mapping