ContactBlogSpeakingProjects
security· ai-agents· mcp· aws· bedrock

Govern AI Agents at the Gateway, Not the Prompt

A guardrail in a system prompt is advisory. Authorization at the MCP gateway is enforced before the tool call runs. Here's the difference, on AWS.

FigureA trust gap opens the moment a model's output meets a user's expectation. The interface is where it closes — or doesn't.

Part 1 argued that an agent's blast radius is its identity, not its model. The natural next question is where you enforce that. The wrong answer — the one most teams reach for first — is the system prompt.

Advisory vs. enforced

A rule in a prompt ("never delete production data") is a request to a model that can be reasoned out of it. A rule at the gateway — the single point every MCP tool call passes through — runs before the call executes and does not care what the model was persuaded to want. That is the whole game: move the control from a layer that can be talked around to one that can't.

What the gateway actually gives you

On AWS, Amazon Bedrock AgentCore Gateway is built to be that chokepoint for MCP. The properties that matter for security are concrete and verifiable:

A mental model

Think of the gateway as doing three jobs the prompt can't:

JobAt the prompt (advisory)At the gateway (enforced)
Who is this?inferred from contextauthenticated session, bounded TTL
What can it see?whatever you describeddiscovery filtered by caller identity
Can it run this?"please don't"authorization decision before execution

None of this makes prompt injection impossible — nothing does. What it does is shrink the consequence. An injected instruction can still try to call a dangerous tool; at the gateway, the call meets an identity check, a session boundary, and a discovery filter before anything happens.

The takeaway

If you are wiring agents to tools, put a gateway between them and treat it as the policy enforcement point: authenticate every session, bound its lifetime, and let the caller's identity decide what is even discoverable. Then the model layer is free to be creative, because the identity layer is the thing standing between "the agent wanted to" and "the agent did."

Part 3 takes the next step: even a perfectly governed gateway is undermined if the agent behind it holds a standing key. Time to retire long-lived credentials entirely.

Researched and drafted with AI assistance; the AgentCore Gateway capabilities above are cited to AWS's documentation, and a human reviewed before publishing.

Frank Winkler
Sr. Solution Architect & AI/ML Specialist, AWS · Bangkok, Thailand / Singapore

I help teams across Asia-Pacific turn ambitious AI ideas into shipped, well-crafted products — pairing deep cloud architecture with a product designer's eye for clarity and trust. I write and speak about applied AI, developer experience, and the craft of building things that last.

Keep reading