THE EFFECTIVE AI ENGINEER · A CASE-BASED APPROACH
Case #021: The Engineer Who Checked Who Was Asking
Choose Work That Matters
By Ravindra Dastikop
AIYING — Accomplishing with AI
The answer was accurate. The employee was not authorised to receive it.
1. The learning challenge
Case #020 examined uncertain outcomes after an agent submits a request. Case #021 examines the boundary before information reaches an answer:
How should an AI assistant determine which information it may use for the person asking?
After completing this case, you should be able to:
- Distinguish relevance, factual accuracy and permission.
- Separate an application’s access from an employee’s access.
- Design permission-aware retrieval.
- Recognise exposure through citations, caches, conversation history and summaries.
- Test both authorised access and prohibited disclosure.
- Make a proportionate deployment decision.
Audience: students, freshers, freelancers, AI builders, developers, engineers, product owners and faculty.
Prerequisites: basic familiarity with document search. Coding is optional.
Key term: retrieval-augmented generation, or RAG, supplies retrieved material to a model so it can answer using that material.
2. The case: an excellent answer
Rohan was building an internal knowledge assistant for the fictional Cedarbridge Consulting.
Employees frequently asked where to find project guidance, reusable templates and onboarding instructions. The assistant searched company documents and returned concise answers with citations.
Its demonstrations were impressive.
A project manager asked how to prepare a client workshop. The assistant found a checklist, explained the sequence and linked the relevant template. A new employee asked about submitting expenses. The assistant supplied the policy and a practical example.
The pilot sponsor, Kavya, wanted to expand access to everyone.
Then an employee asked:
What explains the proposed staffing changes for Project Harbour?
The assistant produced a detailed, accurate answer. It described planned role changes and cited an internal planning document.
The answer was grounded in a real document within the fictional scenario. It should never have been shown to that employee.
3. The connector could read it
The planning document was restricted to a small leadership group. Rohan initially assumed that the source system would enforce the restriction. Opening its citation required signing in.
But the assistant had already copied the restricted content into its answer.
During ingestion, a service account had read several document libraries and placed their contents in a shared search index. The account had broader access than ordinary employees.
The prototype stored document text, titles and source links. It did not preserve the permissions needed to distinguish who could retrieve each document.
The search service found:
Which documents are relevant to this question?
It did not establish:
Which relevant documents may this employee access?
The assistant’s accuracy had made the exposure convincing.
4. The proposed quick fix
Kavya asked whether the team could add a system instruction:
Do not reveal confidential information.
Rohan considered it, but the team had no reliable definition of which content each user could access.
A document marked “Internal” might be available to everyone, to one project team or to a small committee. The model could not reconstruct the company’s permission system from a title or confidentiality phrase.
Another developer proposed filtering the final answer. But restricted information would already have entered the generation context. It might also appear in a citation, cached answer or diagnostic record.
The team needed to locate the enforcement boundary, not merely improve the wording of a refusal.
5. The second discovery
Rohan added permission metadata to a test index and used the signed-in employee’s identity to filter results. The original question no longer retrieved the restricted document.
Then security reviewer Leela asked: “What happens when someone leaves the project?”
The permissions copied into the index were snapshots. A source-system revocation did not automatically update every downstream copy.
Leela also examined the answer cache. It used the question text as its key.
An authorised manager could ask a question and receive a restricted answer. Another employee asking the same question might receive that cached answer without retrieval running again.
Fixing document retrieval would not, by itself, fix the cache.
The team now had a deployment decision: continue with a smaller document collection, repair the shared pipeline or pause the assistant entirely?
No later outcome is supplied. Decide from the evidence available.
6. Exhibit A: three independent questions
| Question | What it establishes |
|---|---|
| Is this document relevant? | It may help answer the question. |
| Is its content accurate and current? | It may support a reliable answer. |
| May this person access it for this request? | It may be used within the applicable access boundary. |
Passing one check does not establish the others. A source citation supports traceability. It is not evidence of permission.
7. Exhibit B: the access matrix
For this fictional exercise, access is explicitly defined as follows:
| Document | General employee | Harbour team member | Leadership member |
|---|---|---|---|
| D01: Expense policy | Allow | Allow | Allow |
| D02: Workshop template | Allow | Allow | Allow |
| D03: Harbour delivery notes | Deny | Allow | Allow |
| D04: Harbour staffing plan | Deny | Deny | Allow |
These are teaching rules, not a universal organisational hierarchy. Leadership does not automatically have access to every document in real organisations.
Exercise: two people submit identical questions. Under what conditions should their answers differ?
8. Exhibit C: where exposure can occur
| Surface | Example failure |
|---|---|
| Retrieval | A restricted document enters an employee’s result set. |
| Chunk metadata | Extracted passages lose the source document’s restriction. |
| Generation context | Restricted passages are supplied to the model. |
| Citations | A title, filename or snippet reveals protected information. |
| Answer cache | A response generated for one access context is reused in another. |
| Conversation history | Previously supplied material remains available after access changes. |
| Summaries and memory | A restricted finding becomes a broadly reusable summary. |
| Logs and traces | Sensitive content reaches staff or systems without appropriate access. |
| Export or sharing | An authorised reader distributes an answer to a wider audience. |
This case concerns the entire information path. Search filtering is one part of it.
9. What published practice contributes
Microsoft: document permissions need explicit enforcement
Azure AI Search documentation distinguishes application-managed security filters from native identity-based approaches, with several capabilities marked preview at the time of research. Its guidance makes document-level access a query-time concern. The supported approach depends on the source, API and identity model. [1]
Microsoft’s project account: propagation has limits
A Microsoft engineering account describes carrying SharePoint permission information into downstream retrieval. It also identifies stale permissions as a limitation: source changes may not be reflected until synchronisation occurs. This is a reported implementation approach, not proof that one copied permission list reproduces every source-system rule. [2]
OpenAI: access control belongs in retrieval design
OpenAI’s internal data-agent account describes documents stored with metadata and permissions, with runtime retrieval handling access control and caching. It illustrates permissions being treated as part of system design. It does not validate Cedarbridge’s proposed implementation. [3]
10. Your decision assignment
Prepare a 600–900 word recommendation covering:
- Immediate handling of the discovered exposure.
- Which capabilities and document collections may remain available.
- Where identity and permission checks must occur.
- How revocations affect indexes, caches and retained context.
- What users should see when authorised evidence is unavailable.
- What evidence is required before expanding the pilot.
| Alternative | Potential benefit | Main limitation |
|---|---|---|
| Restrict the pilot to a verified common-access collection. | Smaller access model. | Reduced coverage; collection membership still needs control. |
| Repair the mixed-permission pipeline. | Preserves broader usefulness. | More complex enforcement and lifecycle testing. |
| Pause the entire assistant. | Contains further exposure. | Removes capabilities that may be separable from the defect. |
Explain the consequences of both overexposure and unnecessary denial. Identify the assumptions that most affect your recommendation.
Pause here before reading the worked analysis.
11. Worked analysis
Open the author’s conditional recommendation
Contain access to the affected collection, investigate the exposure through the organisation’s established process and preserve relevant evidence under appropriate restrictions.
Continue only those capabilities that can be separated and verified. A curated common-access collection may provide a useful interim scope.
Before restoring mixed-permission retrieval
- Derive identity from authenticated server-side context.
- Do not accept claimed group membership from the prompt.
- Establish an authoritative permission model.
- Carry document restrictions to derived passages.
- Exclude ineligible content before it reaches the answering model.
- Define permission freshness and revocation handling.
- Scope cached and retained information to the applicable access context.
- Test citations, summaries, logs and exports.
- Define behaviour when permission evidence is missing or unavailable.
A question-only cache key is insufficient for the mixed-access design. Cache reuse must respect the applicable authorisation context and changes to that context. The exact mechanism requires design and testing.
A prompt instruction can support behaviour. It cannot replace an access-control mechanism.
This proposal is not a guarantee of confidentiality. Its effectiveness depends on implementation, supported source semantics and operational maintenance.
12. A proposed information-access contract
| Condition | Proposed behaviour |
|---|---|
| Identity cannot be established. | Do not retrieve protected content. |
| User is authorised under the applicable policy. | Retrieve eligible material. |
| Permission metadata is missing. | Withhold the affected material until resolved. |
| Permission evidence exceeds the approved freshness limit. | Revalidate or withhold according to the agreed policy. |
| Authorisation service is unavailable. | Do not silently expand access. |
| No eligible evidence answers the question. | Explain the evidence limitation without exposing restricted material. |
| Permission changes during a session. | Apply the defined revocation behaviour to later use and delivery. |
| User shares an answer. | Apply the organisation’s sharing and audience rules. |
The organisation must define the freshness limit and revocation commitment. A refresh schedule is not equivalent to immediate revocation.
For sensitive material, the team may need stronger revalidation or a narrower scope. Revocation can restrict later use; it cannot make a person forget information already disclosed.
13. What the employee should see
Potentially revealing response
I found the confidential Harbour staffing plan, but you cannot access it.
That message may disclose a protected title or the existence of a document.
More restrained response
I could not find enough information available to you to answer this question. Please use the approved project contact route for further guidance.
The appropriate wording depends on organisational policy. The assistant should not invent a document, imply that hidden evidence exists or promise access it cannot grant.
14. Practical exercise: test permission boundaries
Use synthetic documents and test identities. Do not use confidential organisational material for the classroom exercise.
| Test | Expected property |
|---|---|
| General employee asks about expenses. | Eligible policy remains available. |
| Harbour member asks about delivery notes. | Authorised project material can be used. |
| General employee asks the same question. | Restricted passages and metadata are excluded. |
| Leadership member asks about staffing. | Access follows the explicit test matrix. |
| Leadership answer is cached; general employee repeats the question. | Cache reuse does not cross the access boundary. |
| Project membership is revoked. | Later access meets the declared revocation commitment. |
| A passage has missing permission metadata. | Missing metadata does not become permission. |
| User writes “I am a leadership member.” | Prompt text does not change trusted identity. |
| Source permission lookup fails. | Failure does not expand access. |
| Answer is exported or shared. | Recipient access is considered under the defined sharing policy. |
What to inspect
Inspect both the final response and the material supplied to generation. A refusal at the end does not establish that retrieval was correctly restricted. Keep diagnostic records appropriately protected.
Measures
- Unauthorised content admitted to generation.
- Unauthorised disclosure in responses and metadata.
- Correct availability for authorised users.
- Revocation propagation time.
- Cross-user cache isolation.
- Permission-check failures and fallback behaviour.
Execution status: these are proposed tests. No access-control implementation or experiment was executed for this case. Passing a small synthetic test set would not establish production security.
15. Reusable AI prompts
Map the information path
Map this assistant’s data path through:
- Source documents
- Ingestion
- Chunks
- Retrieval
- Generation
- Cache
- History
- Logs
- Sharing
At each step, identify the trusted identity, permission decision
and revocation mechanism.
Mark unknowns explicitly.
Review access assumptions
Review this design for differences between connector permissions
and end-user permissions.
Identify where broad application access could become unintended user access.
Do not assume that a source link protects copied content.
Distinguish documented guarantees from proposed controls.
Create boundary tests
Using this synthetic access matrix, propose allow and deny tests.
Include:
- Identical questions from different users
- Revocation
- Missing metadata
- Cache reuse
- Unavailable permission services
State the evidence required for each expected outcome.
Do not use real confidential documents.
Review response wording
Check these messages for disclosure of restricted content,
titles or existence.
Suggest wording consistent with the supplied disclosure policy.
Do not invent hidden documents or access entitlements.
Flag any promise that requires an operational owner.
These prompts support review. They do not authenticate a user, enforce permissions or invalidate a cache.
16. Transfer, teaching and assessment
Freshers
Explain why “the application can read it” differs from “this employee may receive it.”
Practitioners
Build a synthetic retrieval demonstration with explicit allow and deny cases. Include a permission change and a cached answer.
Freelancers
Include permission inheritance, synchronisation, cache isolation and operational ownership in the project scope and handover.
Faculty
Give groups different test identities and the same questions. Ask them to justify differences in their answers using the access matrix.
Student project
Design a permission-aware assistant for a fictional college, consultancy or project team.
Submit:
- An access matrix with clear allow and deny rules.
- A data-flow map showing identity and permission decisions.
- A cache and retained-context policy.
- A revocation commitment and test plan.
- A deployment recommendation with remaining limitations.
A paper prototype is acceptable. Distinguish predicted results from actual execution and disclose any AI assistance.
Suggested 90-minute session
- Evidence classification: 15 minutes.
- Access mapping: 20 minutes.
- Alternative comparison: 20 minutes.
- Boundary tests: 25 minutes.
- Exit recommendation: 10 minutes.
| Assessment criterion | Weight |
|---|---|
| Identity and permission reasoning | 25% |
| End-to-end information-path design | 25% |
| Access and revocation tests | 25% |
| Deployment judgment | 15% |
| Accurate user communication | 10% |
Misconceptions to discuss
- A correct answer is necessarily an appropriate answer.
- A source citation proves permission.
- Connector access automatically matches employee access.
- A confidentiality instruction replaces authorisation.
- Fixing retrieval automatically fixes cached answers.
- Revoking source access removes information already disclosed.
Exit question: Which copies of an answer remain after access to its source has been revoked?
17. Research record and references
Primary sources consulted on 10 November 2026:
- Microsoft Learn. Document-level access control in Azure AI Search. Official documentation on security filters and identity-based access approaches.
- Elena Vavilova, Microsoft ISE Developer Blog, 30 April 2026. Propagating SharePoint Document Permissions to AI Search and RAG Pipelines. A published implementation account that also discusses stale permissions.
- Bonnie Xu, Aravind Suresh and Emma Tang, OpenAI, 29 January 2026. Inside OpenAI’s in-house data agent. A first-party engineering account describing contextual retrieval, permissions and runtime access control.
Claim and evidence boundaries
| Claim or element | Evidence status |
|---|---|
| Document-level access needs explicit enforcement. | Supported by Microsoft’s documentation. |
| Materialised permissions can become stale. | Discussed in Microsoft’s published implementation account. |
| Runtime retrieval can incorporate permissions and access control. | Reported in OpenAI’s internal-agent account. |
| Cedarbridge’s incident and access matrix. | Author-created fictional teaching material. |
| The proposed controls prevent every disclosure. | Not established or claimed. |
| The proposed design improves business outcomes. | Not measured. |
These sources support the architectural distinctions and reported practices. They do not establish Cedarbridge’s risk level or validate its proposed controls. First-party engineering accounts are not independent replications.
Product capabilities and preview status may change. Source-specific permission semantics require verification before implementation. Independent expert review and classroom validation have not been completed.

