Knowledge center
Prompt engineering, from first prompt to production.
26 practical guides on writing, optimizing, testing, and securing prompts for large language models. Each one is written for people who ship prompts in real software, with examples you can copy and the trade-offs stated plainly.
A reading path
The topics build on each other. Start with what a prompt is, learn the shapes and techniques, then move on to measuring, securing, and automating prompts with agents and tools.
Fundamentals
What prompt engineering is, how to do it step by step, and the habits that separate a prompt that works once from one that works every time.
- What is prompt engineering?A plain definition, how a model actually reads a prompt, and why the wording changes the result.
- Prompt engineering guide: a step-by-step methodSeven steps from a rough request to a tested, production-ready prompt, with a worked example.
- Prompt engineering best practicesTen habits for writing better AI prompts, each with a before and after example.
- Common prompt engineering mistakes and how to fix themTwelve mistakes behind vague, inconsistent, or unsafe output, each with a fix you can check.
- Prompt engineering for developersCoding prompts that produce correct changes, and how to treat production prompts as code.
Prompt types
The basic shapes a prompt can take: with or without examples, with a role, as a system prompt, and around a required output format.
- Types of prompts: an overview with examplesEleven prompt types compared, with an example of each and when to choose it.
- Zero-shot, one-shot, and few-shot promptingWhen examples help, how many to use, how to choose them, and how they backfire.
- System prompts and role promptingWhat belongs in a system prompt, how roles work, and a structure you can reuse.
- Structured output prompting: JSON, schemas, and constraintsGetting reliable JSON from a model with output constraints, schemas, and validation.
Techniques
Methods for harder tasks: reasoning step by step, splitting work across several prompts, giving a model tools, and improving a prompt by measurement.
- Prompt engineering techniques: what to use and whenFifteen techniques compared, with a rule for when each one is worth its cost.
- Chain-of-thought prompting and self-consistencyStep-by-step reasoning, when it helps, when it is redundant, and how self-consistency adds accuracy.
- Prompt chaining and prompt decompositionSplitting a complex task into simple prompts, passing data between steps, and handling errors.
- ReAct prompting: reasoning and acting with toolsHow the reason, act, observe loop works, with a prompt example and the usual failure modes.
- Prompt optimization: an iterative methodA repeatable loop for improving a prompt by measurement instead of by feel.
Optimization, testing, and security
Running prompts in production: token and context budgets, evaluation, versioning, injection defenses, and keeping secrets out of prompts.
- Token optimization: cost, context windows, and compressionHow tokens and context windows work, how to count them, and how to cut them safely.
- Prompt testing and evaluation: how to measure a promptTest sets, metrics, static checks, model graders, and running prompt tests in CI.
- Prompt management and versioningStoring, versioning, reviewing, testing, and rolling out prompts as a team.
- Prompt security: threats and defenses for LLM applicationsThe main threats to LLM applications and a layered defense for each one.
- Prompt injection and jailbreak preventionDirect and indirect injection with examples, and the defenses that limit the damage.
- PII and secret detection in promptsHow secrets and personal data get into prompts, how detection works, and how to redact.
AI agents and MCP
Prompts that drive tools instead of a single reply: agent instructions, retrieval, and the Model Context Protocol.
- Prompts for AI agents: instructions, tools, and workflowsAgent instructions, tool descriptions, context management, and when a workflow beats an agent.
- RAG prompting: writing prompts for retrieval-augmented generationStructuring retrieved context, grounding answers with citations, and handling missing information.
- What is MCP? The Model Context Protocol explainedHow MCP connects AI applications to tools and data, its building blocks, and its security model.
Model guides
What changes between providers: how OpenAI, Anthropic, and Google models differ in the way they read instructions, context, and formats.
- ChatGPT and OpenAI prompting: a practical guideMessage roles, reasoning models, structured outputs, and exact token counting for OpenAI models.
- Claude prompting: a practical guideXML tags, long-document placement, examples, extended thinking, and explicit instructions for Claude.
- Google Gemini prompting: a practical guideSystem instructions, few-shot examples, multimodal input, long context, and structured output for Gemini.
From reading to doing
Check your own prompts against these guides
The advice in these guides is encoded as rules in the PromptFlowEngine engine. Paste a prompt and it reports which ones the prompt breaks, with no model call and nothing uploaded.
- Prompt AnalyzerFind ambiguity, missing context, conflicts, and wasted tokens in any prompt.
- Prompt OptimizerCut tokens and add structure, with proof that every requirement survived.
- Prompt SecurityDetect injection phrases, leaked secrets, and personal data, then redact them.
- Prompt TestingA CI gate for prompt files: quality bar, token budget, and severity threshold.
- Prompt EvaluationA published scoring formula across eight dimensions, with version comparison.
- Prompt templatesProduction prompts that pass every check, ready to adapt.
- Rule referenceEach rule with a triggering example and a fixed version.
Paste a prompt. See what it is really asking for.
No sign-up. The analysis runs in your browser.