How should system and user prompts be separated?medium

Type
conceptual
Topic
system-user-prompts
Frequency
common
Tags
system-prompt, user-input
Answer

System prompts should define stable behavior and boundaries, while user prompts should carry task-specific input.

Explanation

Separating instruction layers improves control and security. System instructions can set role, safety rules, tool rules, and output requirements, while user content should be treated as untrusted data.

Follow-upWhy is this separation important for prompt injection defense?