Skip to content

How to test permissions in Claude MCP analytics

Updated 6 min readFor security reviewers and data owners validating access controls in AI analytics

Test Claude and MCP permissions with two real people whose access differs, using one record visible to only one of them, and compare each result with what that person sees in the source. Identical answers for both usually mean one common login behind the server. Probe totals, follow-ups, error messages and suggested questions, because leaks rarely show up in the main table. Then read the source’s own query log to confirm who ran the query, and time what happens after access is revoked.

Two people, one hour

Most evaluations run under an administrator’s account, and an administrator sees everything. The demo passes, and the first anyone learns about row-level behavior comes from a real user, in production. This test takes about an hour and two people. A vendor who resists running it has given you your first finding.

The MCP authorization specification helps less than people assume. It governs how a client gets a token for a server, and it requires the server to check that the token was issued for it. How that server then reaches your warehouse is its own business, apart from the rule that it must not pass the client’s token upstream. A compliant OAuth sign-in in front of one common integration login is entirely possible, and only a test can tell you which one you have.

Set up a test you can interpret

Choose two roles with a meaningful difference, such as a regional manager and a national analyst, and agree the expected populations before anyone starts. Then seed a canary, one row or record only one role should see, with a distinctive value. Use a synthetic amount that’s easy to recognize, such as 1,234,567.89 on an account called Canary Test Ltd, so you can spot it inside a total or a sentence. You can also search the transcript for it afterward.

Don’t share logins to save time. If one account can’t be set up correctly, postpone that part and keep the gap visible in your notes. Shortcuts taken during an evaluation have a way of becoming the production access pattern. The test data can be small and not sensitive, because you’re testing a boundary, and synthetic rows in a real policy work just as well.

Save a reference from the source for each role before you start. In Snowflake, someone with ownership of the table and the relevant APPLY privilege can simulate what a role receives with POLICY_CONTEXT, which covers masking, row access, aggregation, join and projection policies. In Salesforce, build the reference by running a report while logged in as each user, or use a query in user mode, which respects field-level security and sharing rules.

-- What should the regional role see?
EXECUTE USING POLICY_CONTEXT(CURRENT_ROLE => 'REGIONAL_MANAGER_WEST')
  AS SELECT region, COUNT(*), SUM(net_amount)
     FROM sales.orders GROUP BY region;

-- And the national role?
EXECUTE USING POLICY_CONTEXT(CURRENT_ROLE => 'NATIONAL_ANALYST')
  AS SELECT region, COUNT(*), SUM(net_amount)
     FROM sales.orders GROUP BY region;

Score each result against what the source allows

Agreement between the two people is the wrong goal. A matching response for both can be the worst possible outcome, because it can mean their differences were ignored. Score every probe against the source, in one of four outcomes. Over-restriction counts as well. An assistant that hides rows a person may see produces a confidently wrong total, so I’d log the bottom-left cell as a defect even though it isn’t a security finding.

Source allows itSource forbids itAnswerrevealed itAnswer didnotCorrectMatches the referenceLeakStop the rollout; find the pathSilent undercountWrong total; not a security issueCorrect denialCheck the wording does not leakAnswer revealed it · Source allows itCorrectMatches the referenceAnswer revealed it · Source forbids itLeakStop the rollout; find the pathAnswer did not · Source allows itSilent undercountWrong total; not a security issueAnswer did not · Source forbids itCorrect denialCheck the wording does not leak
Score against the source, never against the other person. Both off-diagonal cells are defects, though only one is a security finding.

Where leaks tend to live

A row policy that works on the first query is the easy case, and row-level enforcement in the source tends to work. Leaks live in everything built around it. Run these probes with the restricted account and read the whole reply, including anything outside the main table.

ProbeExample prompt (synthetic)What you are looking for
DirectShow orders for Canary Test LtdDenial, or an empty set, with no confirmation the account exists
Total versus partsCompany total, then the total for my regionA company total this person should not see; subtraction reveals the rest
Follow-up driftNow add the East regionAuthorization still applied after several turns
Masked columnAverage salary by managerAn aggregate that exposes a masked value in a small group
Narrow filterDeals over 1.2 million in my region this weekA group of one that identifies a restricted record
Error textQuery a table you cannot accessTable or column names in the error message
ProseWhy is the East region behind?A summary or suggested follow-up quoting restricted facts
Prior contextAs the analyst showed earlierPasted results treated as if this person had access

Confirm identity in the source’s own log

An interface saying it answered as you is a claim. The source’s log is the evidence. In Snowflake, the Account Usage QUERY_HISTORY view records the user who issued each statement and the role active at the time, though it can lag by up to 45 minutes. One integration user on every statement ends your test, whatever the interface says.

Know what your policies mean for the numbers, too. Snowflake evaluates a row access policy at query time, and counts and maximums on a protected table reflect only permitted rows and not true table-level values. Two correct people get two different totals for that reason. A row access policy is evaluated before masking, and one column cannot appear in both a row policy signature and a masking policy signature, a detail to remember when you design the canary.

On Salesforce, test the running user. Apex historically defaulted to system mode, where sharing depends on class keywords and field-level security is not automatically enforced, and Salesforce now documents user mode as the default in newer API versions. A custom integration on an older version can behave differently from a report run by the same person, so check what yours does.

SELECT user_name, role_name, COUNT(*) AS statements
FROM snowflake.account_usage.query_history
WHERE start_time >= '2026-10-31 13:00:00'::timestamp_ltz
  AND query_text ILIKE '%sales.orders%'
GROUP BY user_name, role_name;

-- Expected: the two testers, under their own roles.
-- Red flag: one integration user for every statement.

Then change the access and time it

People change teams, so a permission test has to include change. Have an administrator move the regional tester out of the role, then repeat the question at intervals and record when the answer changes. Two separate clocks are often running: the source’s policy, which takes effect on the next query when the query runs as that person, and any application cache. A cache key that leaves out identity can serve one person’s answer to the next, so ask the same question as both people in quick succession and compare.

Then test full removal. Disconnect the connector, revoke at the vendor, and try again. Access tokens already issued may work until they expire, so get the lifetime in writing. Check what stays behind as well. Revoking future access doesn’t erase what a person was previously allowed to receive, including the conversation and anything exported from it. Make that retention decision on purpose, since OAuth won’t make it for you.

One row per role and probe

Give each row the expected scope, observed scope, identity seen in the source log, and outcome from the matrix. Keep real records in a controlled location and refer to them. I wouldn’t report an overall pass, because it hides cases like a regional role that passes its plain question and fails the restricted follow-up. Have the source owner and the integration owner both sign before access widens.

Putting us through it

Nexatron is built to be tested this way. Your sign-in runs each question. In Snowflake, your roles, row access policies and masking policies decide what comes back, and in Salesforce, sharing rules, field-level security and the role hierarchy do. We don’t widen them, so two people can get different numbers. Nobody, administrators included, can ask as someone else, so your test does need two people.

The answer shows Answered as and Why you can see this, and you can compare those with the source log. Over MCP, every tool call runs as the signed-in user, and scopes can only narrow what their role permits. Run every probe anyway. The error text and prose rows are the ones I’d check first.

Claude is a trademark of Anthropic, PBC.

Bring three business questions

Explore your sources, definitions, and review criteria with our team. Please keep credentials and sensitive records out of the inquiry.