Glossary
Prompt engineering
The craft of designing the instructions, context, and constraints given to an LLM to produce reliable, high-quality outputs for a specific task.
Prompt engineering is the practice of designing and refining the instructions sent to an LLM to produce desired outputs reliably. It's a core discipline in production AI automation because LLM behavior is highly sensitive to how the prompt is structured.
A production-grade prompt typically includes:
- Role assignment. "You are a customer support agent at Acme..."
- Task definition. "Your job is to answer the user's question accurately and concisely."
- Constraints + guardrails. "Only answer from the docs below. If unsure, escalate to a human."
- Examples (few-shot). Demonstrations of good outputs.
- Output format. "Respond in JSON matching this schema."
- Context (RAG). Retrieved knowledge for grounding.
- Safety rules. Things the model should refuse.
Common patterns:
- System prompts. Long, durable instructions that frame every interaction.
- Chain-of-thought. Asking the model to reason step-by-step before answering.
- Constitutional AI. Encoding values + safety rules directly in the prompt.
- Output formatting. Forcing structured outputs (JSON, XML) for reliable parsing.
Example
A first-pass legal document drafting agent might have a 2,000-word system prompt covering: role (paralegal-grade drafter), task (produce first-draft document from template + matter facts), constraints (never assert legal conclusions, always note uncertainty, follow firm style guide), output format (DOCX-compatible markdown), and grounding (precedent library access via RAG). The prompt is the product.
Apply this
Get a real automation audit on your business.
Pay $4,500, fill an intake, get a Claude Opus-written strategic roadmap inside a week.
Start the audit →