Prompting For Agents
# 11. Prompting for Agents: Operating Manuals, Not Questions
An agent's system prompt is a mission briefing: role, objective, hard constraints, decision heuristics, tool policy, output contract. And in 2026 its *physical structure* is dictated by prompt caching as much as by pedagogy.
## Rules
1. **Write at the right altitude.** Not brittle if-else prose, not vague platitudes, "specific enough to guide behavior effectively, flexible enough to provide strong heuristics." Start minimal; add instructions and examples only in response to *observed* failure modes.
2. **Structure: stable -> dynamic.** Delimited sections (XML tags / markdown headers) in fixed order: role & constitution -> hard rules -> tool policy -> capability catalog -> response contract -> [cache breakpoint] -> live state snapshot -> history -> user turn. The stable prefix is your cache asset (rule 8).
3. **Constitution ≠ task instructions.** A short, ranked set of standing principles (safety > user instruction > style; cite-or-abstain; never fabricate) lives at the top, separate from per-task guidance, consistency across surfaces, auditability, and one place to amend. Remember prompts are advisory: policy that must *hold* goes in gates (Ch 13); the constitution is the model's *pedagogy*.
4. **Decision heuristics beat rules lists.** Tell the model *when to ask vs act*, *when to stop*, *how to choose between similar actions*, with brief rationale, models generalize heuristics better than they enumerate exceptions.
5. **Few-shot for format, instructions for policy.** Examples pin output shape and calibrate borderline decisions (a small set of diverse canonical ones, not an edge-case dump); instructions carry constraints and generalize cheaper. Emphatic markers (IMPORTANT/NEVER) and good/bad example pairs steer known failure modes.
6. **De-scaffold on model upgrades.** Over-prescriptive scaffolding tuned for an older model can *reduce* quality on a newer one: A/B removing scaffolding at every upgrade.
7. **Tool descriptions and the capability catalog are part of the prompt** (Ch 03). The system prompt's tool-policy section covers cross-cutting policy (when to execute vs propose, budgets, parallelism); per-tool detail lives in the definitions.
8. **Design for the cache:** exact-prefix matching; `tools -> system -> messages` render order; no timestamps/UUIDs/user-specifics in the prefix; deterministic serialization (sorted keys); append-only history with the breakpoint on the latest turn; ~1024-token minimum cacheable prefix; verify via `cache_read_input_tokens`. Real-trajectory savings: 49-80%.
9. **Force structure through schemas, not prayers.** Action decisions -> forced tool call with strict schema; extraction/classification -> schema-enforced response format; JSON-mode-without-schema is obsolete. Remember validity ≠ correctness (aggressive constraining costs accuracy on small models, post-validate semantics), and provider schema subsets differ (Ch 06).
10. **Mid-session steering goes after the cached history** (system-role message in the message list), through a privileged channel the user can't spoof, phrased as context, not override.
## The agent system-prompt templatewhen to use it
Community prompt sourced from the open-source GitHub repo IcHiGo-KuRoSaKiI/agents-survival-guide (MIT). A "Prompting For Agents" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
IcHiGo-KuRoSaKiI/agents-survival-guide · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar