AWS Builder Center
Your Agent Isn't You. That's Exactly Where Access Control Breaks

Your Agent Isn't You. That's Exactly Where Access Control Breaks

Amazon Bedrock AgentCore gives every AI agent its own workload identity, distinct from the user it's acting for - and that one design detail is where most first production agents quietly become an access-control liability. Here's how the memory, retrieval, and identity layers actually need to be governed.

Solutions Architect | AWS Data & AI Architect | Databricks | Snowflake | Tech Speaker

The question changed. Most architectures didn't.

For two years, the defining question in enterprise AI was "which model should we use." That question is basically solved now - you pick from a handful of frontier models on Bedrock and move on. The question that's replaced it is harder, and almost nobody's data architecture is built to answer it:
How do you give every agent the right context, securely, at the right time, without leaking data it was never entitled to see?
That's not a model problem. It's a data platform problem wearing an agent costume. And it's the part most "build an agent" tutorials skip entirely, because they show you a chatbot with a single knowledge base and call it done. Production agents don't work that way. A real agent - a support agent, an internal ops assistant, a sales copilot - needs at minimum three different kinds of context, each with different freshness, different governance requirements, and different failure modes if you get them wrong:
  • Long-term memory - what this agent has learned about this user or account across every past interaction
  • Short-term memory - what's happened in this session, right now
  • Retrieved knowledge - the live, current facts it pulls from your actual systems of record
Get any one of these wrong and the agent doesn't just perform worse. It confidently tells someone something it shouldn't, forgets something it should have retained, or - worst case - surfaces one customer's data inside another customer's conversation because nobody designed who the agent is actually allowed to see on behalf of.

Amazon Bedrock AgentCore is AWS admitting this is a data engineering problem

AgentCore reached general availability as a modular platform specifically because "give the agent a vector store and a system prompt" doesn't survive contact with production. It splits the problem into pieces that map almost one-to-one onto data platform concerns you already know how to reason about:
Component
What it actually is
The data platform analog
Runtime
Isolated, session-persistent compute for each agent invocation (Firecracker microVMs)
Your compute/execution layer - isolated per-tenant, not shared
Memory
Managed short-term (session) and long-term (cross-session) stores, with automatic extraction strategies
Your OLTP + a curated, derived "customer 360" layer
Knowledge Bases
Managed RAG over your actual documents and data
Your governed, queryable lakehouse
Gateway
Exposes internal tools and APIs to the agent in a controlled way
Your API gateway / service mesh, policy-enforced
Identity
Issues the agent its own workload identity, distinct from the calling user
Your IAM layer — except the principal is a machine, not a person
Observability
Full tracing of every memory read, retrieval, and tool call
Your lineage and audit layer
None of this is exotic if you've built governed data platforms before. What's genuinely new - and where I see almost every team get it wrong on their first production agent - is the identity model.


The one detail that determines whether your agent is safe: it is not you

Here's the assumption that quietly breaks most first attempts at agent governance: an agent invoked on behalf of a user does not automatically inherit that user's permissions. AgentCore Identity gives every agent a distinct workload identity - its own ARN, its own OAuth configuration, its own credentials, managed through an identity directory and a token vault built specifically for machine principals. The agent is authenticated and authorized as itself, not as an impersonation of whoever's chatting with it.
That's the right design. It's also the exact place teams introduce the vulnerability they least expect.
Think through what actually happens without careful design: your support agent has a knowledge base connected so it can answer questions from your case-management system. The agent's workload identity has read access to that knowledge base - because agents need broad enough access to be useful across many users. Customer A starts a session. If nothing in your architecture explicitly scopes retrieval to what Customer A specifically is entitled to see, the agent's identity - not Customer A's - is what determines what comes back from the knowledge base. The agent can retrieve anything in scope of its own permissions, then decide, based on prompt and context, what to say. You are now relying on prompt engineering to enforce an authorization boundary. That is not a control. That is a hope.
This is precisely the same tag-based, attribute-driven governance problem I've written about for Lake Formation - except the principal requesting access is no longer a person sitting behind IAM Identity Center. It's a workload identity, invoked possibly thousands of times a minute, on behalf of a constantly changing set of actual humans. The enforcement point has to move from "who is logged in" to "who is this specific retrieval being performed for, right now, inside this session" - and that has to be encoded into the retrieval call itself, not left to the model to reason about correctly every single time.

Where the three context layers actually go wrong

Long-term memory becomes a silent liability store. AgentCore Memory's extraction strategies (semantic extraction is the most commonly used) pull durable facts out of conversations automatically - that's the entire value proposition, no custom pipeline required. But "automatic" cuts both ways: if you don't scope what gets extracted and retained, you can end up with long-term memory quietly accumulating sensitive information nobody explicitly decided should persist across sessions. Treat your extraction strategy configuration as a data classification decision, not a default you accept.
Short-term and long-term memory get conflated. Session memory should reset. Long-term memory should persist deliberately. Teams that don't design the boundary between them end up with agents that either "forget" things a user reasonably expected to persist (bad UX) or carry stale, session-specific context into unrelated future conversations (worse — this is how an agent starts referencing information a user never gave it in the current session, which reads as either broken or unsettling).
Knowledge Bases get treated as "just RAG," not as governed data. The moment you connect a Knowledge Base to a production agent, it is a query surface into real data, with all the same row-level and column-level sensitivity questions your lakehouse already has. If the underlying source has fine-grained access control (Lake Formation LF-Tags, for instance) and your Knowledge Base ingestion flattens that away during indexing, you've built a bypass for your own governance model. The access boundary has to be preserved through ingestion, not just enforced at the source.
Gateway gets skipped as "overhead." It's tempting to let an agent call internal APIs directly. Gateway exists specifically so tool access is mediated, authorized, and observable the same way data access is — skipping it for "just one internal tool, just for now" is exactly how governance gaps start.
Nobody looks at the trace until something's already gone wrong. Observability across memory reads, retrievals, and tool calls is the only way to actually answer "why did the agent say that" after the fact. If you're not reviewing traces before an incident forces you to, you don't actually know what your agent is doing - you know what you hope it's doing.

A concrete shape: an internal support agent done right


Picture an agent that helps support engineers investigate customer issues. Done carelessly, it's one knowledge base and a system prompt telling it to "only discuss the current customer." Done with the context layers actually designed:
  1. Identity: the agent has its own workload identity via AgentCore Identity, distinct from the support engineer's login. It authenticates to downstream systems (the case system, the knowledge base, the ticketing API) using its own credentials, brokered through the token vault -never impersonating the engineer, and never holding standing broad access it doesn't need for the current call.
  1. Short-term memory: this session's conversation - the current ticket, what's already been asked and answered - resets when the session ends.
  1. Long-term memory: durable, explicitly scoped facts about this account (not this session) - prior resolution patterns, known configuration quirks - extracted deliberately, reviewed for what's allowed to persist, and retrievable across future sessions about that same account.
  1. Knowledge Base retrieval: scoped at query time to the specific account or case context passed into the call, not to "everything the agent's identity can technically reach" - the retrieval call itself carries the access boundary, mirroring the account/tenant tags you'd already be using in a Lake Formation TBAC policy.
  1. Gateway: the only path to any downstream tool (creating a ticket, escalating, pulling account status) - authorized, logged, and observable, not a direct API call baked into the agent's code.
  1. Observability: every memory read and retrieval traced, so "the agent referenced information from a different account" is something you'd catch in a trace review, not discover from a customer complaint.
None of this requires exotic infrastructure. It requires treating the agent as what it actually is: a new kind of principal in your data platform, with its own identity, its own access patterns, and its own governance requirements - not a UI layer bolted onto an existing, ungoverned pile of documents.

This is the thread AWS itself is pulling on

The direction across recent AWS announcements - AgentCore, Bedrock Managed Knowledge Bases, built-in web search, deeper context tooling - points at the same conclusion from the platform side: the differentiator in enterprise AI isn't going to be model choice much longer. It's going to be which organizations can reliably get the right, properly governed context to an agent at the moment it needs it, and prove - via trace, via identity, via lineage - exactly what it saw and why. Bad context doesn't just produce a worse answer. It produces a confident, well-written, entirely wrong one, and those are the ones that actually cause damage.
If you're standing up your first production agent right now, the model you pick will matter less over the next twelve months than whether you designed its identity, its memory boundaries, and its retrieval scope before you shipped it - not after something in production made you go back and add them.


Worth asking about whatever agent you're closest to shipping right now: if it retrieved something it shouldn't have, would you find out from a trace, or from the person it happened to?


Further reading:
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article