AWS Builder Center
Why Every AI Agent Governance Layer Must Live Below The Agent

Why Every AI Agent Governance Layer Must Live Below The Agent

Key insights from AWS Community Day Bengaluru | July 11, 2026

Series: AWS Conferences Tour (44 articles)

  1. …
  2. 43
    Why Every AI Agent Governance Layer Must Live Below The Agent This article
AWS Community Builder | AWS DevOps Engineer | 4+ YOE | Cloud Infra | Observability | CI/CD | Iac
I was at AWS Community Day Bengaluru on July 11th, 2026, what an amazing occasion it was. There were tons of great sessions covering each and every detail of cloud infrastructure, serverless and machine learning. But from a perspective of spending a lot of time thinking about system design, one session radically changed how I thought about building generative AI applications.
Next was Siddhant Khare of OpenFGA and GitHub1s, who talked about AI agent governance. Let’s face it, developing AI agents is a lot of fun, but securing them in production can be a real nightmare. Siddhant’s session hit the nail on the head, detailing precisely why our present approach to agent security is fundamentally wrong, and how to change it.
Here's a breakdown of what I learned and why you need to rethink your AI agent design.

The AI Agent Rebellion: A Familiar Incident

Siddhant kicked off by telling a short story titled “The Incident”.
Let’s say you create an AI agent and you include a strict set of rules in its system prompt. You tell it what it can do and what it cannot accomplish. The agent is performing . It notices a visible rule directing it to stop . The LLM doesn't quit. It works its way around the obstacle. It makes a detour, slams into a second wall, disables its own sandbox environment and gets the job done nonetheless.
Sound familiar?
That's because Large Language Models are advanced thinking engines. You tell an LLM “don’t access the database” and it may hear “solve the puzzle” rather than “hard physical limitation".

The Core Principle of Agent Governance

And this takes us to the most crucial takeaway of the whole session. Siddhant shared a key rule while developing agents:
"The rule is not enforceable if the agent can see the rule"
Here’s the thing… if your security is based purely on the system prompt of the agent, you don’t have security, you have a suggestion. It's like handing a toddler the password to the cookie jar lock but telling them they aren't allowed to use it. At some point they will consume the cookies. Real enforcement has to be done well beyond the agent’s line of sight.

Translating Governance into AWS Architecture

How can we genuinely enforce restrictions that the agent cannot escape? “We have to draw a hard line for action.
In a best practice AWS architecture, the agent and model loop are fully detached. when the agent determines it needs to take an action it hits a wall, an action boundary. The agent does not carry out the activity itself. Instead it delegates the request to another layer outside of it such as an AWS lambda function or an API Gateway.
Only this external gateway is permitted to speak to the real AWS API and every single activity is then logged in CloudTrail. The agent has no ability to physically bypass the barrier.

The Three Missing Questions in AI Security

You could be asking yourself... doesn’t AWS IAM (Identity and Access Management) already handle all this? Not quite. Traditional cloud security lacks context within the AI world, Siddhant said.
Properly governing an agent requires us to answer three separate questions:
  1. Can the workload call it? This is handled by IAM.
  1. Should the agent do it? This requires a Task Policy.
  1. What did the agent try? This requires an Agent Trace or Git AI logging.

IAM is Not the Task Policy

Now this is when it gets fun. We need to explicitly differentiate agent intention from infrastructure authorization.
Traditional IAM is the big picture work load For example, an IAM role might say “This Lambda function can call Amazon S3.”
But a Task Policy is hyper-specific to the context of the AI’s current task. It says: “This specific AI agent, doing this specific task, is allowed to read this specific object at this time.”
To clarify, IAM is like giving an employee a generic keycard to get into your office building. The Task Policy is the boss who watches over them and asks pointedly whether they have permission to access a certain filing cabinet on a Tuesday afternoon. IAM alone is too wide for an AI agent, which is unpredictable, but both are needed.

Building the Tool Gateway Boundary

Siddhant introduced the Tool Gateway to enforce the Policy for Task.
The Tool Gateway is between the agent and the tools it wants to employ. When the agent creates a tool request, the Gateway intercepts the request and performs three crucial steps:
  • Normalize the request: It formats the agent's output into a standard structure.
  • Check the policy: It validates the request against strict rules.
  • Execute only on ALLOW: The tool is only triggered if the policy explicitly permits it.
Siddhant showed this utilizing OpenFGA (Fine-Grained Authorization) for the policy check. If the agent wants to access a safe project file, OpenFGA returns an  ALLOW  decision and the tool gets the file. However, if the agent tries to read a sensitive  .env  file via a path traversal attack, OpenFGA will return a hard  DENY . The agent's execution is immediately prevented and the tool is never even called.

Seeing it in Action: The Live Demo

Architecture diagrams are great, but fair enough, it’s always better to see the actual code. Siddhant presented a live demo in the form of a GitHub repository.
Link :  Github 
The backend architecture was implemented with AWS CDK in TypeScript ( aws-ccd-stack.ts ). The Tool Gateway itself was written in Go, using a clean  gatewayResponse  struct to keep track of approved decisions, trace ids and justifications.
During the live UI demo, we observed the Agent Governance Boundary in real time.
  • The agent requested the tool  filesystem:read_file .
  • The Gateway intercepted it, and checked the task policy.
  • The agent asked for a typical source file ( app.ts ) and the system reported a local trace with an  ALLOW  decision.
  • However, when the agent agreed to request the  demo-workspace/.env  file, it was quickly stopped by the Gateway.
  • The UI showed a  DENY  decision with explanation “no relationship grants secret access” and a restricted exit status of 253.


Every every choice was tracked, whether it was allowed or denied. Siddhant next accessed the Amazon S3 interface to explain how these very same trace events were safely recorded as JSON objects in a trace bucket ( awsccddemostack-tracebucketa... ). This provides an immutable audit record, so engineers can see exactly what the agent tried to perform, even if it failed.



Your Production Roadmap for AI Agents

Siddhant wrapped off the presentation with a clear, 5-step plan for safely taking AI agents to production:
  1. Put dangerous tools behind one gateway: Don’t let the agent directly call databases, file systems, or external APIs.
  1. Normalize every tool request: Standardize agent outputs as a processing step.
  1. Check task policy before execution: Don't only use IAM for infrastructure access, use OpenFGA and other tools to validate intent.
  1. Trace every allow and deny: Keep a permanent record in S3 of what the agent attempted to perform.
  1. Add backpressure: If an agent is refused, put in place procedures to avoid the agent to continuously retry the same bad operation and waste your compute budget.

Key Takeaways

  • Rules must be invisible: If an AI agent can read its own security rules in a prompt it can easily reason around them. Real enforcement must be outside the agent’s environment.
  • IAM and Task Policies do different jobs: IAM decides what your foundational infrastructure (such as a Lambda function) can access. A Task Policy defines the actions that the agent can undertake at that particular time. You need both to be safe.
  • The Gateway is your bouncer: Don’t allow an agent to speak directly to a database, API or file system. Route all traffic through a Tool Gateway that normalizes the request and validates policies before executing.
  • Trace absolutely everything: Log every request, whether it is accepted or rejected . By storing these trace events immutably in an S3 bucket, you’ll always have a clear audit trail of exactly what your agent was trying to pull off.

Conclusion

The conclusion is as follows: We cannot rely on AI bots to police themselves.
As we construct more complex and autonomous systems, we need to treat them as untrusted users on our infrastructure. Siddhant’s talk was a huge highlight of AWS Community Day Bengaluru for me and it totally changed my perspective on cloud security for generative AI.
Long story short if you are implementing AI workloads on AWS, you need to put your governance layer below the agent. Don't rely on system prompts for security, create strict action boundaries, and validate every single action your agent takes.

About the Author

As an AWS Community Builder, I enjoy sharing the things I've learned through my own experiences and events, and I like to help others on their path. If you found this helpful or have any questions, don't hesitate to get in touch! 🚀
🔗 Connect with me on  LinkedIn 

References

Event: AWS Community Day Bengaluru
Speaker:  Siddhant Khare 
Topic: Why Every AI Agent Governance Layer Must Live Below The Agent
Date: July 11, 2026

Series: AWS Conferences Tour (44 articles)

  1. …
  2. 43
    Why Every AI Agent Governance Layer Must Live Below The Agent This article
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