PrepGenAICerts

System vs. User Placement & Prompt Templates

Core

Design system prompts, templates, and guardrails · Difficulty 2/5

0%
system-prompttemplatesprompt-designcaching

Explanation

System vs. User Placement

An architect separates prompt content by stability, not just by role:

  • **System Prompt**: stable rules, role, tone, and constraints that hold across every request
  • User message: the specific request and per-request data that varies call to call

This separation does double duty. It keeps behavior consistent across requests, and it keeps the stable content together as a single block -- which matters for Prompt Caching, since only a stable, unchanging prefix is cacheable.

Templates

Templates parameterize the variable parts of a prompt (the specific document, user query, or record being processed) while keeping the surrounding scaffold -- instructions, format spec, examples -- constant. This improves two things at once:

  1. Consistency: the same scaffold produces comparable output across many requests
  2. Cache hit rates: a constant scaffold is exactly the stable prefix that caching rewards

Design Pattern

Treat the System Prompt as a reusable, versioned artifact -- not an ad-hoc string assembled per request. Changes to it should go through the same review/eval discipline as code.

Common exam traps

  • Mixing stable and per-request content together in one blob, which both hurts consistency and breaks the cacheable prefix.
  • Treating templates as a UX convenience only, missing that they also drive cache economics.

Key Takeaways

  • Stable rules, role, tone, and constraints belong in the system prompt; the specific request and data belong in the user message
  • This separation improves consistency and keeps the stable content cacheable
  • Templates parameterize variable parts while holding the scaffold constant
  • Treat system prompts as versioned, reviewed artifacts, not ad-hoc strings

Glossary Terms

Related Concepts

PrepGenAICerts is an independent exam-prep site. It is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. Claude and Anthropic are trademarks of Anthropic, PBC. Exam details are taken from publicly available Anthropic and Pearson documentation. About PrepGenAICerts.