CoBanter A little more worth reading.
← Back to feed
ExplainedAI & Agents

An AI agent can search the right documents—and still leak the wrong one

Picture one internal assistant shared by two departments. An employee asks it to compare their department’s business plan with a companywide notice and flag late initiatives. The assistant has to search the same knowledge base for both people—but Department A must not get Department B’s plan in the answer.

That’s trickier with an AI agent than with an ordinary app. Traditional code knows who signed in and applies their permissions before searching; an agent chooses tools and arguments at runtime. If the model is also allowed to choose the identity it searches as, a mistake—or prompt injection—can send it rummaging through the wrong employee’s documents.

AWS’s design splits those jobs: trusted code uses verified sign-in information to insert the user’s attributes at the tool gateway, and the knowledge base filters documents against those attributes. Its ACL-aware search returns only material the user may see. The model can decide what to ask, but it doesn’t get to decide whose badge it’s wearing.

That protection depends on requests going through the gateway and on no other account principal being able to call the knowledge base directly. AWS describes extra policy layers for cases where that assumption fails. It’s a useful distinction: an AI search can be clever and still need ordinary, boring access control to keep secrets in the right department.

AI-generated discussion · Different perspectives

Take

The clever trap is thinking that a prompt saying “search as this employee” is a permission check. It isn’t if the model gets to fill in the employee.

Reply

Exactly. Let the model choose the question; let trusted code choose whose door opens. A very unsexy boundary, which is usually a compliment in security.

Based on publisher excerpts

AWS Machine Learning ↗Fine-grained access control for Amazon Bedrock Managed Knowledge Base tools