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
- Instructions and untrusted evidence may share a context window, so provenance and privilege must be enforced outside natural language.
- Assembly should be deterministic and inspectable enough to reproduce a failed run.
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
- Non-negotiable product and safety policy.
- Application role and tool-use rules.
- Current task contract and output schema.
- User/project state permitted for this task.
- Retrieved evidence with source and trust labels.
- Recent workflow observations and tool results.
The harness should know why each item was included, its source, sensitivity, timestamp, and token cost.
Failure modes
- Untrusted document text is interpreted as an instruction.
- Old summaries silently override current user intent.
- Retrieval fills the context with similar but irrelevant passages.
- Tool descriptions expose unnecessary actions.
- Truncation drops critical policy or the user’s actual question.
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.