Prompting
Simple prompting from zero: four parts, examples, tags, injection, evals, and the OS an agent actually reads.
- 0120 min
Prompt Anatomy
Every serious prompt has four parts: instructions, context, input, and an output contract.
- 0219 min
Instructions vs Data
Policy is what the model may do. Data is what it may read. Mixing them is how a webpage becomes a boss.
- 0321 min
The Output Contract
Decide the shape of a valid reply before you write adjectives. The parser is the API.
- 0418 min
Prompt Templates
Keep the user ask in one slot. Do not splice it into the middle of a quoted sentence.
- 0520 min
Order and Recency
Models overweight the last instruction. Put the contract after untrusted blocks. Do not hide the user between examples.
- 0621 min
Few-Shot Prompting
Examples are a tiny training set in the prompt. They program format, edge cases, and taste.
- 0719 min
Which Examples to Keep
Cover the modes of the task. Keep the weird cases. Drop near-duplicates. One bad shot teaches a bad Tuesday.
- 0820 min
Negative Examples
Show the wrong output and the right repair. Do not show a crime you do not want imitated without the fix.
- 0918 min
When Zero-Shot Is Enough
If the contract is short and the task is common, skip the gallery. Examples have a cost.
- 1021 min
Chain of Thought
Ask for steps when the task has serial work you can grade. Always end with a parseable final answer.
- 1119 min
Hidden Scratchpads
Thoughts are logs. Users see the contract. Hidden reasoning can still leak secrets — treat it like a trace.
- 1220 min
Split the Task
Plan, then act. Or extract, then decide. One prompt that does four jobs is how JSON grows poetry.
- 1320 min
Self-Check
After the draft, check numbers and ids against context. Asking “are you sure?” is not a check.
- 1422 min
Constraints, XML, and Delimiters
Tags, fences, and JSON strings keep instructions, data, and output from leaking into each other.
- 1522 min
Prompt Injection
Untrusted text — especially tool output — can rewrite the agent’s instructions. Treat it as hostile data.
- 1620 min
Jailbreaks
The user fights the spec on purpose. Your code must still refuse. The poem is one layer.
- 1719 min
Keep Two Channels
Policy in one place, observations in another. Dual-channel means the model can read data without obeying it as a spec.
- 1821 min
Eval-Driven Prompting
A prompt change is a code change. Score it on frozen cases before you ship the new adjectives.
- 1918 min
Version Your Prompts
Templates belong in git with a name on the trace. A dashboard tweak with no PR is how you lose the only copy that worked.
- 2021 min
Prompts for Agents
Goal, tools, action format, stop rules, untrusted-data policy — the system prompt is the agent’s operating system.
- 2120 min
Parseable Actions
ReAct is a format constraint. The action line is the product. Prefer JSON over ‘I will now Get-Job :)’.
- 2219 min
Tool Docs in the Prompt
Short, honest schemas. Disabled tools disappear. Leftover examples that call shell after you removed shell are a bug.
- 2320 min
Stop Rules
Call finish when the world matches the goal. Max steps, max tokens, and handoff live in the prompt and in code.
- 2422 min
When Prompting Is Not Enough
If the model needs a fact, a side effect, or a guarantee, stop decorating the poem. Use a tool, retrieval, or a workflow.