Define the boundary as a policy, not a paragraph
The permitted scope should be written as an explicit policy that sits outside the system prompt. A versioned policy can be applied at every stage of a conversation and recorded each time it is applied, which a paragraph of instructions inside a prompt cannot do.
Why the system prompt cannot be the control
A system prompt is low cost and good for shaping refusals and redirects. It fails when conflicting instructions appear in user input or retrieved text, and it is not auditable. It can support the boundary, but it should not be the mechanism that enforces it.
Place enforcement in the request and response path
Evaluate the policy at runtime on user inputs, retrieved context, model outputs, and tool calls, using a policy decision point that sits outside the model.
Where topic policy is evaluated
| Stage | What happens |
|---|---|
| Inbound message | Classify the request and the conversation so far against the policy. |
| Context assembly | Limit retrieval to sources approved for the detected topic. |
| Tool call | Allow only the tools and parameters the topic permits. |
| Outbound response | Check the draft answer before it reaches the customer. |
| Decision log | Record each allow, block, or redirect with its reason. |
Combine enforcement layers, and know how each one fails
| Layer | What it does | How it fails or what it costs |
|---|---|---|
| 1. System prompt design | Low cost and good for shaping refusals and redirects. | Fails when conflicting instructions appear in user input or retrieved text, and it is not auditable. |
| 2. Input classification | Labels each request, and ideally a window of recent turns, by topic before the model responds. | Fails on ambiguous phrasing, indirect requests, and single messages that look harmless but continue an off-topic thread. |
| 3. Retrieval scoping | Restricts the knowledge sources the assistant can draw on for a given topic. | Limits what the assistant can say with authority, but does not stop the model from answering from its own training. |
| 4. Tool-call restrictions | Allows only approved tools and parameters per topic and per user context. It is the strongest protection against misuse of connected systems. | Does not govern what the assistant says in plain text. |
| 5. Output classification | Checks the draft response for out-of-scope content, advice, or commitments before delivery. It catches what earlier layers missed. | Comes at the cost of latency and some false positives. |
| 6. Runtime policy enforcement | A policy decision point outside the model that applies the versioned policy at every stage and records the result. | Quality depends on policy coverage and on the accuracy of the classifiers feeding it. |
Log decisions so enforcement is measurable and auditable
Log every decision. Each allow, block, or redirect is recorded with its reason, so the boundary can be measured and reviewed rather than assumed.
Test the boundary before and after release
Test against adversarial prompts and multi-turn drift. Cover at least the following cases:
- Direct out-of-scope requests for each prohibited topic, phrased several ways.
- Ambiguous requests that sit between an allowed and a restricted topic.
- Prompt injection through user messages and through retrieved or tool-returned content.
- Multi-turn scripts that start in scope and move gradually toward a restricted topic.
- Attempts to trigger unapproved tools or unapproved parameters through allowed topics.
- Enforcement outage simulation to confirm the defined failure behavior.