Keep old permissions out of AI conversation history
Conversation history must not automatically preserve access to previously retrieved information. Store source dependencies for excerpts and summaries, reauthorize them for each new turn, and rebuild model context when membership changes so old evidence cannot silently return through memory or cached answers.
Inside this article 5 sections +
A knowledge assistant can enforce current permissions on every new search and still leak old evidence through conversation history. A user asks about a restricted project, receives an authorized answer, then loses project access. On the next turn, the application sends the previous answer back to the model and asks it to elaborate.
The search filter never fails because no new search is necessary. The restricted facts are already in the conversation. Preventing this requires a policy for historical context, not just a more careful retrieval query.
Treat history as several different data types
Separate user-authored messages, model-generated answers, retrieved excerpts, tool results, and generated summaries. They have different origins and retention rules. A summary can contain restricted facts even when it no longer resembles the original document, so provenance must follow derived content.
Store source identifiers and versions with every retrieved block and with generated content that depends on them. A message may depend on several sources with different access rules. If you cannot separate the restricted portion reliably, exclude the whole derived block from future model context and regenerate from currently authorized evidence.
Do not claim that revocation can erase information a person already saw. The application can control future retrieval, display, and reuse under its policy. Historical record retention and model-context reuse are separate decisions; retaining an audit record does not require resending it to the model.
Rebuild context for the current requester
At the start of each turn, establish the authenticated identity, tenant, current membership version, and requested conversation. Verify that the user may access the conversation itself. Then evaluate the source dependencies of candidate historical blocks before assembling the model input.
A context builder can return excluded-block reasons for internal diagnostics without exposing restricted source titles to the user. The visible response might say that some earlier evidence is no longer available. It should not reveal the name of a confidential project merely to explain why the answer changed.
Use a membership or authorization version to invalidate cached context plans. This version is an optimization signal, not a substitute for the actual policy check. Permission changes in an external source may occur without a local membership change, so the dependency model must include the relevant source access state.
Handle summaries and long-term memory explicitly
Conversation compaction often combines many turns into one summary. If that summary mixes public and restricted information without dependencies, later reauthorization becomes impossible. Keep provenance at a useful segment level or mark the whole summary with the union of its source restrictions.
The union approach is conservative: losing access to one source may exclude more context than strictly necessary. That can be an acceptable first implementation. Regenerating a smaller summary from permitted blocks restores usefulness without trying to make a model identify and redact every sensitive fact after the fact.
Long-term memory needs the same discipline. A preference such as “use concise answers” may be user-owned; a remembered forecast extracted from a restricted planning document is source-derived business content. Do not store both as untyped facts in one persistent memory collection.
User messages can also quote restricted evidence from earlier turns. Decide how the application handles that case within its product policy. At minimum, do not treat quoted text as authority to retrieve the original source or execute privileged tools. Current access checks must remain independent of what appears in the prompt.
Run a membership-change drill through every reuse path
Create a synthetic user with access to a shared handbook and a restricted pricing project. Ask a question that uses both, then summarize the conversation and populate any answer cache. Remove pricing access and ask a follow-up that refers indirectly to the previous answer: “What would that exception mean for the next renewal?”
Inspect the exact model input, not only the final answer. Restricted excerpts, derived summaries, cached answers, and tool-result messages should be absent or appropriately reconstructed under the chosen policy. A model that happens not to repeat the secret does not prove the boundary worked.
Repeat the drill in a second browser session, after a worker restart, and with the permission service unavailable. Test the fail-closed behavior for sensitive evidence. Also restore access and verify that the system can retrieve permitted information again without reviving an obsolete source version.
Include shared conversations and exports. If a colleague opens a chat created under broader permissions, the original creator's authorization must not be inherited. The viewer and the next-turn requester may differ, so the application needs separate checks for displaying stored content and reusing it as evidence.
Observe removals without logging the removed content
Record counts and reason codes for excluded context blocks, authorization failures, and summary regeneration. Use protected identifiers rather than copying sensitive passages into ordinary logs. A sudden rise in exclusions may reflect a legitimate membership change or a broken connector; operators need enough context to distinguish them.
The permission-aware assistant guide covers retrieval boundaries, and document deletion covers source removal. Our AI integration services can extend those controls into the conversation lifecycle.