Chapter 8The prompt
What the model actually reads
A prompt is your message, but the model actually receives a whole stack of text: rules from the provider, instructions from the app, memories, documents, tool descriptions and earlier results. Your message is one small layer.
The model sees only what the software around it sends. Each time it responds, that software assembles one long document, the context, and the model continues it.1 Much of that document is written by someone other than you.2
The same desk from Chapter 2 holds all of these layers, so the harness has to choose what fits.
Go deeper
Anthropic, for example, publishes the system prompt it uses in its own Claude apps, and notes that those prompts don't apply to its API.2 OpenAI's published rules rank the layers by authority (platform rules above developer instructions above your message) and treat text returned by tools as information, not orders.3 A good prompt still matters. It's just one layer of many.
Facts
- Anthropic defines context as the set of tokens the model receives when it generates a reply, and calls managing it "context engineering."1
- Even a tool's status message is part of the prompt: in one benchmark, "Code executed successfully with no output" confused agents into retrying or assuming the tool was broken.4
- Looking up relevant documents and adding them to the prompt (retrieval-augmented generation) makes answers more specific and factual.5
Read the rules yourself
Notes (6)
- 1Anthropic, “Effective context engineering for AI agents,” Anthropic Engineering, September 29, 2025, https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents (accessed October 26, 2026).
- 2Anthropic, “System prompts (release notes),” Claude Platform Docs, https://platform.claude.com/docs/en/release-notes/system-prompts/overview (accessed October 26, 2026).
- 3OpenAI, “OpenAI Model Spec (2025-10-27 version),” October 27, 2025, https://model-spec.openai.com/2025-10-27 (accessed October 26, 2026).
- 4JV Roig, “Towards a Standard, Enterprise-Relevant Agentic AI Benchmark: Lessons from 5.5 billion tokens' worth of agentic AI evaluations” (preprint, arXiv, November 11, 2025), https://doi.org/10.48550/arXiv.2511.08042.
- 5Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, et al., “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” (preprint, arXiv, May 22, 2020), https://doi.org/10.48550/arXiv.2005.11401.
- 6Anthropic, “Claude's Constitution,” n.d., https://www.anthropic.com/constitution (accessed October 26, 2026).
Chapter 8 · page 1 of 1
Turn pages with the ← and → keys.