Skip to main content
Use this guide when your application retrieves documents, tickets, web pages, or connector data before a model call. The main risk is not only bad relevance. It is that retrieved text can become trusted prompt content even though it came from an untrusted source.

Assumptions

  • You already know which repositories, indexes, or connectors a workflow is allowed to query.
  • Business authorization decides which documents a user is allowed to retrieve.
  • Anthale can evaluate the input and output boundaries around the retrieval flow.

Secure the retrieval flow

1

Inventory sources and trust levels

Separate internal curated material, user-generated content, external web content, and third-party connector data. Do not label a source as trusted just because it lives in your system.
2

Enforce retrieval eligibility before search

Check user and workflow authorization before the retrieval system runs. Anthale does not replace document or record entitlement checks.
3

Evaluate retrieved text before prompt assembly

Run Anthale before retrieved snippets are appended to the prompt. This is where prompt injection, unsafe links, and sensitive data often first enter the model context.
4

Preserve provenance with every chunk

Keep source identifiers, repository names, URLs, or document references attached to retrieved material so you can explain where a risky snippet came from.
5

Keep instructions separate from retrieved text

Do not merge retrieved text into system instructions or reuse raw chunks as implicit policy. Retrieved content is context, not authority.
6

Re-check the final response path

Run Anthale again on the model output before it reaches a user or another system. A safe retrieval layer does not remove the need for output checks.
Treat a vector hit as candidate context, not trusted truth. Retrieval quality and retrieval safety are different problems.

What this looks like in code

This keeps the retrieval boundary explicit: each chunk is evaluated before prompt assembly, and blocked chunks never reach the model.

Common failure patterns

  • Retrieval happens before authorization, so the model sees data the user should never have accessed.
  • Prompt assembly does not preserve the source of each chunk, which makes incidents hard to investigate.
  • The model is told to follow instructions that appear inside retrieved text.
  • The output path is left unchecked because the team assumes the input path already handled the risk.

Apply this in Anthale

  • Create a first policy when you want to test one RAG boundary before rolling Anthale into a larger retrieval stack.
  • See the enforcement API when you need the runtime contract for evaluating retrieved chunks or output.
  • Request access when you want to review a retrieval workflow that is moving toward production.

Next steps

Continue with Secure Browser Agents, Validate Model Output, Data Leakage Prevention, or Link Control.
Last modified on April 12, 2026