loading…
How to express intent, separate instruction layers, and make model behavior versionable instead of treating prompts as magic text.
A prompt is not merely a question typed into a chat box. In an application, prompts are runtime configuration that shape behavior alongside code, data, tools, and policies.
A production request may contain system-level instructions, developer-defined task guidance, user content, retrieved evidence, tool results, examples, and output constraints. These pieces have different trust levels and should not be concatenated blindly.
The application should distinguish stable policy from task-specific information:
| Layer | Purpose | Typical owner |
|---|---|---|
| System / platform rules | Non-negotiable behavior, safety boundaries, identity | Platform team |
| Application instructions | Role, workflow, domain behavior, output contract | Product / engineering team |
| User request | The goal for this interaction | User |
| Retrieved or tool content | Evidence and observations, not trusted instructions | External systems |
Prompt wording matters, but system quality depends more on whether the model receives the right information, in the right format, at the right time. That broader discipline is context engineering.
A useful task instruction normally includes:
Few-shot examples are useful when quality is easier to demonstrate than describe. Examples should represent the real edge cases, not only perfect happy paths. Keep examples structurally consistent and avoid leaking irrelevant details into every request.
Task: Classify the ticket and explain the evidence.
Allowed labels: billing | access | bug | feature_request
Return: {"label": "...", "evidence": ["..."]}
Example input: "I was charged twice for July."
Example output: {"label":"billing","evidence":["charged twice"]}
Store prompts in source control or a prompt registry. Record the prompt version with each trace so you can explain behavior changes. A prompt change should run through the same evaluation suite as a model or retrieval change.
Prompt change checklist: Did task success improve? Did refusals or unsafe behavior change? Did token usage grow? Did the output schema become less stable? Can the change be rolled back?