By Vero SecurityBuilt and funded by Vero Security, the AI Security Engineering platform.Read the charter

System prompts, roles, and instruction following

Chat models receive one token stream in which system, user, assistant, and tool messages are marked with special formatting. Models are trained to give system instructions priority, but nothing in the architecture enforces a hard boundary between instructions and data, which is the root cause of prompt injection.

Read in this order

  1. OfficialChat templates (Hugging Face Transformers)Start here: see how roles are flattened into one token stream by a template.
  2. PaperThe Instruction Hierarchy: Training LLMs to Prioritize Privileged InstructionsThe research on training models to rank instructions by source, and its limits.

Save your progress

We email you a sign-in link. No password.

By signing in you agree to the terms. The privacy policy explains how we use your details.

Join the AI security engineering community

Free. Roadmap updates, chapters near you, and first word when credentials open.

We’ll email you community updates. Unsubscribe anytime. By sending this you agree to the terms. The privacy policy explains how we use your details.