Sub topic 3
Choosing Where the Instructions Live
Assume you know basic prompting and have a draft voice guide. This chapter focuses on placement, testing, and maintenance.
Choosing an instruction layer
An instruction layer is a place where guidance is stored and applied. Choose the narrowest layer that matches its purpose.
| Layer | Best use | Main risk |
|---|---|---|
| Account | Your personal preferences | Affects unrelated projects |
| Project | Shared brand rules for one workspace | Can be missed outside the project |
| System prompt | Rules enforced by an application | Requires code and deployment |
| User prompt | Request-specific changes | Can weaken consistent voice |
Keep stable brand rules at the project level or in a shared file. Use account instructions for personal preferences. Use a system prompt when software must apply the guide to every request.
Testing the voice and revising
Test with a fixed prompt set rather than judging one impressive response. Include normal requests, difficult customer messages, and questions requiring missing facts.
Check each response for:
- Voice traits, such as sentence length and degree of formality
- Required formats
- Banned words and phrases
- Unsupported claims
- Appropriate questions when information is missing
Change one instruction at a time. Record the prompt, output, failed check, and revision. This makes improvements reproducible.
Limits and common failure modes
Instructions guide generation; they do not guarantee compliance. Voice drift can appear in long conversations, especially when later requests conflict with the guide. Vague traits such as “professional” also produce inconsistent results.
Other common failures include examples that contradict the rules, excessive rules that compete for attention, and guardrails that do not cover a new business case. Review failures instead of adding rules blindly. A shorter, clearer guide often performs better.
> callout warning > Treat the voice guide as a control, not a guarantee. Review high-risk or public content before publication.
Using the voice guide as a system prompt
A system prompt is instruction text supplied separately from the user’s request. Store the guide in version control and load it at runtime.
from pathlib import Path
import anthropic
client = anthropic.Anthropic()
voice_guide = Path("voice_guide.md").read_text(encoding="utf-8")
response = client.messages.create(
model="YOUR_MODEL_ID",
max_tokens=500,
system=voice_guide,
messages=[{"role": "user", "content": "Draft a welcome email."}],
)
print(response.content[0].text)Maintaining and sharing the guide
Give the guide an owner and a version number. Review it when the brand, audience, product, or safety requirements change. Keep test prompts beside it, and run them after edits. Share one canonical file instead of copying different versions into multiple projects.
Exercise
Which layer should hold rules that every request in a production application must follow?
Show answer
The API system prompt, backed by a versioned shared voice guide.