Note: prompts

Overview

The prompts module (src/attune_rag/prompts.py) assembles augmented prompts for LLM calls. It wraps retrieved passages in <passage>…</passage> sentinels, injects them as grounding context, and renders the final prompt string through build_augmented_prompt().

How the module works

The module exposes three top-level functions — no class instantiation required:

Prompt injection defence

Every passage block is governed by _INJECTION_DEFENSE_CLAUSE, a hardcoded instruction that tells the model to treat content inside <passage>…</passage> tags as retrieved documentation only — never as directives or system messages. This means the sentinel tags serve a dual purpose: they delimit context for the prompt renderer and carry the injection-defence instruction to the model.

Tags: prompts, templates, augmentation, citation