2.2 · Lesson 2 of 5
Design system prompts, templates, and guardrails
What You Need to Know
Strong system prompts state explicit criteria, output formats, and boundary conditions — not vague style advice. Templates keep multi-step workflows consistent so each stage has stable slots for inputs, checks, and outputs. That is Domain 2 craft: shaping model behavior with clear instructions and reusable structure.
Architects must also place hard safety and must-always rules correctly. Prompts are probabilistic guidance; they can reduce mistakes but cannot guarantee enforcement. Irreversible exports, allowlisted transfers, and similar constraints need deterministic controls on the tool or API path (blocks, hooks, policy checks) — the same judgment Domain 5 deepens, framed here as “what belongs in the prompt versus outside it.” Soft guidance stays in prompts; hard constraints get code-path enforcement.
Prompt design building blocks
- Role and task framing with measurable criteria
- Required formats and examples of structure (not vibes)
- Boundaries and priority when rules conflict
- Templates for multi-step consistency
- Clear split: probabilistic guidance vs deterministic controls
Decision rules
- Criteria, formats, and boundaries beat vague style advice.
- Template multi-step flows so stages stay consistent.
- Treat prompts as soft; put must-always safety on the tool path.
- Resolve conflicts with explicit priority in the prompt design.
- Eval both format adherence and hard-block enforcement.
Probabilistic vs deterministic
Prompt guidance can steer tone, ranking, and format compliance most of the time. Deterministic controls stop prohibited actions even when the model is jailbroken or confused. Exam stems that show PII or export rules “in the prompt” while tools still fire reward adding path-level enforcement — not another paragraph of encouragement.
Review checklist
- Are criteria and formats explicit?
- Are multi-step stages templated?
- Are hard rules mapped to deterministic controls?
- Is priority clear when instructions conflict?
- Do fixtures cover soft and hard layers separately?
Prefer answers that add path-level blocks for irreversible actions while keeping prompts crisp — not longer soft text alone.
Exam application
Choose designs with explicit system prompts/templates plus deterministic enforcement for must-always rules. Distractors: vibe-only prompts, prompt-only safety, contradictory hidden rules, or deleting structure.
Exam traps
Vague style advice as the whole system prompt
“Be helpful and careful” without criteria, formats, and boundaries fails exam-style tasks. Explicit beats vibes.
Prompt-only “must always / must never” for safety
Irreversible or regulated actions need deterministic blocks, allowlists, or policy engines — not longer wording alone. Aligns with Domain 5, framed here as prompt vs control placement.
One-off prompts with no templates for multi-step flows
Inconsistent formats and missing steps appear when each turn reinvents structure. Templates keep stages consistent.
Contradictory rules with no priority
Hidden or conflicting requirements make behavior unstable. Priority and boundary conditions belong in the prompt design.
Practice scenario
A support agent’s system prompt says “be careful with PII” and “never export customer lists,” but irreversible CSV exports still succeed through the export tool. What should the architect prioritize?
Build exercise
Design system prompt, template, and guardrail split for a support agent
40 minutes
What you'll learn
- Write explicit criteria, formats, and boundaries
- Template a multi-step support flow
- Separate soft prompt guidance from hard tool-path controls
- Add fixtures for both layers
Step 1
Write explicit criteria, formats, and boundaries
Replace vague style advice with acceptance criteria, required output schemas, and clear in/out-of-scope boundaries for the support agent.
Why: Exam stems reward explicit system prompts over vibe-based encouragement.
You should see: A system prompt skeleton: role, criteria, format, boundaries, priority on conflicts.
Step 2
Template the multi-step flow
Build a reusable template for intake → retrieve → draft → escalate so each stage has fixed slots (inputs, checks, outputs).
Why: Templates reduce format drift across turns and operators.
You should see: A stage template with filled examples for one ticket type.
Step 3
Separate soft guidance from hard controls
List which rules are probabilistic (tone, ranking preferences) versus must-always (no bulk export, no wire outside allowlist). Map hard rules to tool-path enforcement.
Why: Architects must know what prompts can and cannot guarantee.
You should see: A two-column table: prompt guidance vs deterministic control + owner.
Step 4
Add eval fixtures for both layers
Create fixtures that check format/criteria adherence and separate fixtures that prove hard blocks fire even under adversarial wording.
Why: Soft and hard layers fail differently — test both.
You should see: Two small fixture lists labeled soft vs hard.
Sources
- Prompt engineering overview — docs.anthropic.com — system prompts and techniques
- Use system prompts — docs.anthropic.com — role and instruction placement
- Strengthen guardrails — docs.anthropic.com — beyond soft instructions