Back to AI/ML Overview
📜 Knowledge Site · Instructions for Agentic Software · Authority, Composition, Defense

Prompt EngineeringEverything the model reads is text. Only some of it is an instruction.

A language model receives one long sequence of text: the rules its builder wrote, the request a person typed, a document somebody attached, the result a tool returned. Nothing in that sequence says which parts may give orders. This site starts from one sentence sent to a model and climbs, one idea at a time, to roles, templates, tools, , injection, versioning, testing and rollout, asking one question at each step: who wrote this text, and how much authority does it have?

🎯The problem

An applicant's roof description says: ignore the underwriting policy. To the model it is just more text, sitting next to the insurer's own rules. A prompt that treats every piece of input as equally trustworthy hands control to whoever writes the most persuasive sentence. is the discipline of deciding which text instructs, which text is data, and how that holds up in production.

🔑The question every page asks
Who wrote this text, and how much authority does it have? Policy stays authoritative, application data stays untrusted, and the assistant asks for evidence instead of obeying it, on one synthetic insurance quote.

🗺️What is inside

From a sentence to a prompt

Instruction, data, output and success criteria; roles and authority across providers; templates, variables and escaping.

Patterns, tools and

Few-shot, decomposition and clarification; tool descriptions and choice; prompts and resources and where their trust boundary lies.

Injection and defense in depth

Direct and indirect injection, tool-result laundering, and why boundaries, least privilege, validation and approval beat a stern sentence.

Versions, tests and rollout

A prompt registry, golden cases and injection probes, portability across models, safe rollout, audit and rollback.

🖱️How to read it

  • New to prompting: read in order. Each chapter starts in plain English with one tiny example.
  • Experienced: jump to injection, versioning, testing or the insurance lab. The rigorous part sits in folded blocks.
  • Eight interactive labs, among them a prompt composer and an injection simulator, each with a plain table next to it.
  • The example is synthetic and its agent is a scripted stand-in. Results show how the mechanism works, not how good any model is.