Prompt Engineering
System prompts, few-shot patterns, chain-of-thought, structured output, red-teaming and meta-prompting — the craft of communicating with LLMs.
13 articlesin Prompt Engineering
Context Engineering: What Goes in the Window
Why agents get worse as they get more context, and what to do about it: budgets by source, cleared tool results, a cache-friendly layout and compaction that keeps your decisions.
Meta-Prompting: Letting a Model Tune Your Prompts
From a one-off rewrite to refinement loops on failures, candidate search and compiled DSPy programs. How to optimise prompts against a metric without overfitting, and how to review what the optimiser produces.
Red Teaming LLM Applications: Attack It Before Your Users Do
Threat model first, then manual sessions, then automated scans with garak, promptfoo and PyRIT. How to find jailbreaks, data leaks and unsafe tool calls, fix them in the architecture, and keep them fixed in CI.
Tree-of-Thought: Search Over Reasoning Paths
Propose several next steps, judge the partial states, keep the best and expand them. How to build a Tree-of-Thought search, why the evaluator decides everything, and when a reasoning model makes it unnecessary.
Constrained Generation: Beyond Hope-Based Parsing
Enforce output structure at the token level with grammars and token masks — how it differs from native JSON mode, and when the strictness costs you reasoning quality.
Chain-of-Thought Prompting: Making LLMs Show Their Work
Zero-shot CoT, few-shot CoT, self-consistency, and when reasoning traces hurt as much as they help — the technique that unlocked multi-step reasoning in LLMs.
ReAct Prompting: Reasoning and Acting in LLM Agents
The Thought → Action → Observation loop that lets LLMs use tools, verify intermediate steps, and self-correct — the pattern behind most modern AI agents.
Prompt Injection: Attack Vectors and Defence in Production
Direct injection, indirect injection via retrieved content, jailbreaks, and the defence-in-depth architecture that keeps LLM applications secure.
Function Calling and Tool Use: Structured Outputs from LLMs
JSON mode, tool schemas, parallel tool calls, and the architecture patterns that let LLMs interact reliably with external APIs and databases.
Zero-Shot Prompting: What LLMs Know Without Examples
Clear task framing, persona, output format, and constraints — how to get accurate results from a single well-crafted prompt with no examples.
Few-Shot Prompting: Teaching LLMs by Example
Selecting, ordering, and structuring input-output examples to reliably steer model behaviour — the most effective prompting technique for consistent formatted output.
Structured Outputs from LLMs: JSON Mode, Function Calling, and Schema Enforcement
Practical patterns for getting reliable structured data from LLMs — JSON mode, function calling, schema validation, and fallback strategies.
Prompt Engineering as Software Engineering
Version control, testing, parameterization, and CI pipelines for prompts — treating prompt engineering with the same rigor as application code.