← Back to AI Engineering Mind Map
中文·English
🤖 AI EngineeringID: instruction-hierarchy-system

Instruction Hierarchy & System Prompt

指令分层与 System Prompt 架构
🎯Core Definition
Instruction Hierarchy is a formal security architecture and prompt design framework that establishes strict privilege tiers across conflicting inputs; it establishes 3 distinct privilege levels: 1) System Instructions (Developer Messages: absolute highest authority defining identity, guardrails, and non-negotiable formats); 2) User Prompts (medium authority expressing user intent, strictly subordinate to system constraints); 3) Untrusted Third-party Context (Retrieved RAG passages, web snippets, tool outputs: zero privilege, strictly evaluated as passive data payload).
💡Use Cases
Production System Prompt engineering, defending against Indirect Prompt Injection lurking within RAG documents or tool payloads.
⚡Key Problems Solved
Flat prompt contexts treat all text tokens with equal authority, allowing adversarial strings like 'Ignore all previous instructions' to hijack execution; Instruction Hierarchy hardens top-level system commands against override attempts.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Instruction Hierarchy & System Prompt.
Use Cases
In production engineering, what are the primary use cases for Instruction Hierarchy & System Prompt and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
How do OpenAI and Anthropic train models during RLHF/SFT to enforce role priority boundaries across `system`, `user`, and `tool` roles?
2
What is the standard modular architecture for writing production System Prompts (persona, workflow, format, guardrails)?
3
How does strict XML tagging (`<context>...</context>`) physically demarcate retrieved passages as non-executable read-only payload?
4
What is the arbitration and refusal protocol when user instructions directly contradict hard system prompt constraints?
5
How to prevent System Prompt attention decay and forgetting across massive 100K+ token conversational contexts?
Updated 2026-08-14
🎯
Test Your Knowledge: Practice Questions for "Instruction Hierarchy & System Prompt"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice ➔
← Previous CardChain-of-Thought PromptingNext Card →OpenAI Strict Structured Outputs

🔗 More AI Engineering Knowledge Cards

Vector Distance Metrics & L2 NormalizationScalar Quantization (SQ8/SQ4)Product Quantization (PQ)ADC Asymmetric Distance Computation