Instruction and Context Assembly

Instruction and Context Assembly

Key jargon

Term Plain-language meaning
Instruction hierarchy The precedence rules among system, developer, user, and data content.
Context assembly Selecting and formatting all information sent in a model request.
Prompt injection Untrusted content attempting to alter instructions or induce unsafe actions.
Token budget The allocation of finite context capacity among instructions, evidence, history, and output.

Key concepts

Concept map

flowchart LR
    A["Collect instructions and evidence"] --> B["Label trust and priority"]
    B --> C["Fit token budget"]
    C --> D["Render reproducible request"]

Assembly order

  1. Non-negotiable product and safety policy.
  2. Application role and tool-use rules.
  3. Current task contract and output schema.
  4. User/project state permitted for this task.
  5. Retrieved evidence with source and trust labels.
  6. Recent workflow observations and tool results.

The harness should know why each item was included, its source, sensitivity, timestamp, and token cost.

Failure modes

Exercise

Create a context manifest containing source, trust, purpose, sensitivity, timestamp, hash, and token_estimate for five context blocks.

Check

Re-run the task after removing each block. Context that never changes the outcome may be noise; context whose removal breaks policy needs protected placement and testing.