How to Test What Your AI Can Read and Do for Each User

Mika Roivainen
Mika Roivainen
Mika Roivainen
August 16th, 2026
How to Test What Your AI Can Read and Do for Each User

Testing Who AI Can See, Decide and Act For

An AI assistant connected to company systems should act for the person asking, and only that person. When it doesn’t, a junior analyst ends up reading board minutes because the assistant’s service account could. Two points decide whether that happens: retrieval, when the assistant pulls in data, and action, when it sends, changes or deletes something. Prompt wording and model choice matter far less if those two leak.

What the testing is meant to prove

The core focus of enterprise AI access control testing fits in one line: at every read and every action, the assistant runs on the asking user’s authority, never more.

Normal app testing doesn’t cover this. An app has fixed screens and fixed queries, so you can walk each path. An assistant builds its own queries and tool calls, and nobody can list every path in advance.

So the plan starts on paper. For each role, write down what the assistant may read, what it may change, and which identity each downstream call carries. Those answers become the expected results. Enterprise AI access control testing without them is just poking at a chatbot.

Testing what the assistant can see

Retrieval covers every source the assistant can query: search indexes, vector stores, file shares, wikis, ticket systems, databases. What matters is where filtering happens. If it happens after the text lands in the prompt, it’s too late. The model can repeat anything it has seen.

Permission-aware search and indexed content

Say a crawler running as an admin builds the index. It copies the documents but not the access lists, so every search returns files the user could never open directly.

The test is simple. Ask the same question from two accounts, one with access to a restricted folder and one without. The second account should get no content and no hint of a summary. This pairing is the smallest useful unit of enterprise AI access control testing.

Stale permissions and tenant boundaries

Permissions move faster than indexes. Someone leaves a group on Monday afternoon and the nightly sync doesn’t run until midnight. Remove access, ask again straight away, and see what comes back.

Multi-tenant products need the same pairing across tenants. Leaks hide in caches, shared embeddings and conversation memory, so test those too. Teams that run enterprise AI access control testing once before launch tend to miss these slow drifts.

Testing what the assistant can do

Actions are anything with a side effect: sending an email, updating a CRM record, approving a payment, running a command. Authorization has to be checked at the moment of the call, for that action on that resource. A check from earlier in the chat doesn’t count.

Take a support assistant that can issue refunds. A front-line agent asks for one far above their approval limit. The assistant’s service account is allowed to approve it, so it does. Nobody hacked anything, and the permission model still failed.

Delegated credentials and tool scopes

Check which identity each tool call carries. With a shared service token, the downstream system can’t tell who asked, so its own permission checks mean nothing.

Calls should carry the user’s delegated token, with narrow scopes and short lifetimes. Logging belongs here too. Enterprise AI access control testing should confirm that every read and action traces back to a named person.

Injected instructions and confused deputies

Retrieved documents, web pages and tool outputs are data, never instructions. Plant a document that tells the assistant to email a file outside the company or ignore its rules, then check that nothing happens. OWASP’s list of LLM application risks names prompt injection and excessive agency, and this test touches both.

Also try requests the user couldn’t make directly, phrased politely or passed through a chain of agents. The assistant should refuse them all. Deletions, payments and other irreversible steps need human confirmation, and a test should prove nobody can skip it.

Building a test suite that stays useful

Start with a permission matrix. Roles go down the side, data sources and actions across the top, and each cell holds an expected allow or deny. Every cell becomes at least one automated test, which is how enterprise AI access control testing ends up running on every release.

A starter suite covers these cases:

  • Paired-account queries against restricted and open content
  • Permission removal followed by an immediate retry
  • Cross-tenant queries and cache checks
  • Injected instructions in retrieved documents and tool outputs
  • Requests for actions the user has no right to perform

Run them against the whole pipeline, not the bare model. Output varies between runs, so repeat adversarial cases with different wording and fail the build on a single leak. Every leak you find becomes a permanent regression test. That loop is what separates working enterprise AI access control testing from a checkbox exercise.

Where testing falls short

A green suite means the known failures are gone. It says nothing about the path nobody tried. Enterprise AI access control testing works best next to design choices that limit the damage: scoped tokens, read-only defaults and approval gates.

Scale matters too. A small pilot over one public knowledge base with no write actions needs far less than an assistant that touches payroll or customer records.

The core focus in short

The core focus of enterprise AI access control testing is authority at two boundaries. At retrieval, return only what the asking user may see. At action, do only what that user may do, checked again when the call happens.

Retrieved content never grants new permissions. Every call traces to a person. Every failure becomes a regression test.

Frequently asked questions

Who should own this testing, security or QA?

Both, with clear roles. Security defines the permission model and the attack cases. QA turns them into repeatable automated tests that run on every release. IT owns the identity and data connections underneath, like group membership and token scopes. If only one team owns it, the tests tend to go stale or miss how a real attacker would behave.

How often should the tests run?

On every release that touches prompts, tools, data connections or the model, plus a regular schedule in between. Permissions and indexed content shift daily, so a scheduled run catches drift that code changes never trigger. Run the paired-account and permission-removal checks most often. They’re cheap, and they catch the most common leaks.

Can a system prompt enforce permissions on its own?

No. A system prompt is guidance the model usually follows, not a control it must obey, and ordinary phrasing can talk a model out of it. Enforce permissions in the retrieval layer and the tool layer, where code checks identity and scope whatever the model says. Treat the prompt as a backup safeguard at best.

What should be logged for audit?

Log who asked, which sources were retrieved, which tools were called and with what parameters, under which identity, and whether the action was allowed or denied. Add a timestamp and a named user to every record. With that, a reviewer can reconstruct any answer or action later, and failed tests become much easier to diagnose.

Start with the two boundaries

Retrieval and action are where AI systems turn permissions into real consequences, so that’s where tests earn their keep. Use the asking user’s authority, check it again at every call, and treat retrieved text as data. For a first step, pick one assistant already in use and run the paired-account test against its most sensitive data source this week. The result will show how far your enterprise AI access control testing has to go.

‍