EngineeringGad and Gal4 min read

AI Agent Access Control: How Dave Filters What Each User Sees

How Dave enforces AI agent access control with granular semantic filtering, redacting denied data from tool results per user. Passed 99 of 100 test scenarios.

To be useful, Dave has to see a lot. Teams connect it to their cloud accounts, clusters, repositories, Slack and docs. The on-call engineer asks why the checkout pods keep restarting. The platform lead asks which services to right-size. Someone from finance asks why the AWS bill went up last month.

Not everyone should see everything Dave has access to. Cloud spend, pricing deals, open vulnerabilities and the product roadmap each have their own audience. The easy answer would be to block access to a resource outright. But subjects don't map neatly to resources. One resource holds many subjects, and one subject spreads across many resources. For example, cost sits in the AWS account the on-call engineer is debugging, in kubecost's numbers for each pod, in Terraform's price estimates, and in last week's Slack thread about the budget. Blocking by resource either lets the subject through or takes the whole resource away.

Our solution gives each user a visibility policy. When an engineer who can't see cost asks about checkout, Dave still reads the pod listing, but the cost column is removed before Dave reads it. We call this granular semantic filtering, or GSF.

tool result kubectl top pods + kubecost GSF role allows everything role denies Cost & FinOps passes as is Platform lead PODCPUMEMCOST/DAY checkout-api-x2k4p250m512Mi$14.20 checkout-api-m8q1z250m512Mi$14.20 Dave's answer Two checkout pods, 250m CPU and 512Mi each, $28.40 a day in total. Backend engineer PODCPUMEMCOST/DAY checkout-api-x2k4p250m512Mi[redacted] checkout-api-m8q1z250m512Mi[redacted] Dave's answer Two checkout pods, 250m CPU and 512Mi each. Cost is outside your visibility policy.
The same question and the same tool result. GSF removes only what each reader's policy denies, before Dave reads it.

The firewall analogy

A network firewall doesn't sit inside each application. It sits on the perimeter, where traffic crosses from outside to inside, and inspects everything that passes, whatever asked for it. Our hardest design question was where Dave's perimeter is.

We had four candidates for where the filter could sit. For all but one, a simple prompt gets past it:

Person Dave Answer no cost Team's systems AWS, Kubernetes, Terraform, Slack the question the answer tool access each tool result
Filter on each tool result: cost is removed before Dave reads it.
Four places to put the filter, and a prompt that gets past three of them. Select a card to replay it.

So we put the filter where Dave meets the outside world. Everything Dave knows about a team's systems arrives as a tool result. Filter each result once, against the reader's policy, and it no longer matters what the person asks or how they ask Dave to phrase it: the denied facts were never in Dave's context.

Final solution: two layers

There are two layers, and each covers the other's weak spot.

GSF · once per tool result tool call score < 0.2, as is redacted or withheld ≥ 0.2 Person's message + their allow/deny policy Dave reads the policy with every message Answer no raw tool output Tool result raw output Gate classifier score · cutoff 0.2 Redactor fast language model redacts or withholds
Dave only reads a tool result after GSF has checked it. Clean results go straight back to Dave; flagged ones go through the redactor first.

Give Dave the user's policy as context. With every message, Dave receives the visibility policy of the person who sent it: the subjects they can see and the ones they can't. With it, Dave can refuse a request outright when it asks for something the user can't see, and leave denied facts out of its answers. This is optimistic security. It does most of the work, but only as long as Dave follows it. When someone talks Dave out of its instructions, or a tool returns output that mixes allowed and denied facts, we need a layer that doesn't depend on Dave.

Add GSF, an independent guard that runs on each tool output. It sees only the result and the user's policy, and runs before Dave reads the output. GSF is built from two parts: a cheap gate and a smart redactor. The gate is a classifier that decides whether any part of the result might state something outside the policy. If not, the result goes to Dave untouched. If it might, the redactor, a fast language model, rewrites the result: it replaces denied rows, records or values with [redacted], or withholds the whole result if nothing allowed is left. The gate is tuned to over-flag, and the redactor makes the call.

A bit of numbers

The classifier answers in about a third of a second. A result that scores below 0.2 goes straight to Dave, so a clean result costs only that. A flagged result also goes through the redactor, which took a median of 1.8 seconds, about 2.2 seconds in all.

We ran 100 scenarios three ways: the policy in the prompt only, GSF only, and both. In each, Dave answers a reader's question using simulated tools whose output mixes allowed and denied data. A judge model then checks every answer for denied facts, even reworded, and for whether the allowed part of the task got done.

Prompt and GSF99%
1 failed
Prompt only93%
7 failed
GSF only79%
21 failed
Each square is one of 100 scenarios; squares marked with an X failed.

What the prompt misses, GSF catches. An engineer asked why the checkout pods keep restarting. Dave ran a tool to list them, and the output also had the cost of each pod. Dave can't always know what a tool will return before calling it, and now the cost was in its context.

What GSF misses, the prompt catches. An engineer asked for an estimate of last month's AWS spend. GSF redacted the cost, so Dave estimated it from what it already knew.

Together, each layer covers the other. With GSF on, the numbers are removed before Dave reads them. With the policy in its prompt, Dave doesn't estimate them either. The two layers passed 99 of 100 scenarios, and Dave never refused a question it should have answered.

Meet Dave

Hand your infrastructure backlog to Dave.

An AI platform engineer, backed by humans. Your team approves every change.

Book a demo

Your infra backlog won't clear itself.Dave will.

By submitting this form you agree to the processing of your personal data as described in our Terms and our Privacy policy.