Loading...

Identity-Aware SRE Agents with kagent on Akamai LKE

Identity-Aware SRE Agents with kagent on Akamai LKE

I wanted a reason to put an AI agent in front of a real Kubernetes cluster and watch what happens when two different people ask it to fix the same thing. Diagnosis is easy to demo. Remediation is where it gets uncomfortable. Once the agent can patch a Service, “who clicked send?” matters a lot more than whether the chat UI has a nice login page.

So I built a small demo on Akamai LKE with kagent 0.9.12 and Keycloak. One broken Service. Two users. Alice can remediate. Bob cannot. The repo is github.com/sprider/kagent-lke-identity-agent.

Why this bothered me

A lot of Kubernetes + AI demos stop at “here’s a summary of your events.” That is useful. It is also mostly harmless if the wrong person runs it.

Giving the model k8s_patch_resource is a different decision. I kept running into setups where SSO proved someone was logged in, then every agent behind that session could call the same privileged tools. Alice and Bob both looked fine in the browser. Only one of them should be able to change the cluster.

I wanted to see that gap on purpose, not discover it later in a worse environment.

What I used from kagent

kagent lets you declare agents in YAML: system message, model config, and a list of tools. I put Keycloak in front of the UI through oauth2-proxy so Alice and Bob are real OIDC users. The Kubernetes tools come from the MCP tool server: get, describe, events, and for one agent, patch.

One thing I got wrong in my head at first: I assumed the agent pod’s ServiceAccount would gate those MCP calls. In 0.9.12 they run as a shared kagent-tools account, which is cluster-admin by default. So this demo does not claim OBO tokens or per-user RBAC are doing the enforcement. What you can actually show today is simpler. Alice’s remediator gets k8s_patch_resource. Bob’s intern remediator does not.

How the demo is shaped

Architecture

Keycloak login up front, observer for both users, then a fork: Alice’s remediator can patch, Bob’s cannot.

The incident is deliberately dull. In namespace demo, frontend-svc selects app=frontend-BROKEN. The pods are labeled app=frontend. Endpoints drop to zero.

Broken Service has zero endpoints

Selector mismatch. Zero endpoints. That is the whole outage.

There are three agents. observer-agent is read-only. remediator-agent is the Alice path and includes patch. remediator-agent-intern is the Bob path and does not.

Walking through as Alice

make ui, open the SSO page, sign in as Alice.

kagent SSO landing

Everything goes through oauth2-proxy first.

Keycloak login as Alice

Alice gets a normal Keycloak session.

Three demo agents

I disabled the chart’s built-in agents so the UI only shows these three.

I ask observer-agent to look at frontend-svc in demo. It finds the bad selector and suggests a patch without applying it.

Alice observer diagnosis

Observer stays read-only.

Then I switch to remediator-agent and ask it to set the selector to app=frontend. That agent has the patch tool, so it works.

Alice remediator success

Alice’s remediator actually applies the fix.

Endpoints restored

Endpoints come back once the selector matches again.

Then as Bob

I reset the failure, log out, and sign in as Bob.

make break

make break

Back to zero endpoints.

Keycloak login as Bob

Bob also authenticates. That part is not the difference.

I open remediator-agent-intern and send the same fix prompt. No patch tool on this agent. It refuses.

Bob intern remediator refuses

Same ask, different tool list.

Bob did not fail login. He was handed a remediator that cannot call the dangerous tool. That is the part I wanted to be able to show people.

What I’d do differently next time

I would write Bob’s refusal case before polishing Alice’s happy path. The successful patch is easy to get excited about. The refusal is the proof.

I would also stop assuming “OIDC in front of the UI” means the cluster tools are identity-aware. Login tells you who is in the browser. The tool list on the agent tells you what that session can do in this version of kagent. Those are different questions.

And I would read how the MCP tools authenticate before designing RBAC around agent pods. That assumption cost me a round of debugging.

If you want to try it

You will need a Linode token, an OpenAI key, Terraform, kubectl, helm, jq, and openssl. It spins up three g6-standard-4 nodes, so destroy it when you are done.

git clone https://github.com/sprider/kagent-lke-identity-agent.git
cd kagent-lke-identity-agent

export LINODE_TOKEN="your-linode-api-token"
export KEYCLOAK_ADMIN_PASSWORD="choose-a-strong-password"
export OPENAI_API_KEY="your-openai-api-key"

make up

Then:

make ui
make credentials

Defaults are alice / alice123 and bob / bob123. Run Alice through observer and remediator, make break, then try Bob on the intern remediator.

make down

More detail is in the README.

If any of this resonates and you’re wiring agents into clusters too, find me on LinkedIn.

Published on:

Learn more
Need help with this product?

We can help you with Identity-Aware SRE Agents with kagent on Akamai LKE

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Home | Joseph Velliah
Home | Joseph Velliah

Fulfilling God’s purpose for my life

Share post:

Related posts

Vasanam Studio: How I Built a Bible Verse Video Generator for My Church as a Hobby Project

Every morning at 5 AM, the women of my church gather for prayer. At the end of the session, our pastor’s wife shares a Bible verse and sends a...

2 months ago

The demo worked. That was the problem.

Over a weekend I built a small Kubernetes demo to play with zero trust. Three little services calling each other in a chain, a login page in f...

3 months ago

Notes from building an agent on AgentCore end to end

I wanted a reason to use AgentCore end to end. Runtime, memory, guardrails, identity, the whole thing. A Bible Q&A agent felt like a good ...

4 months ago

Building a Rust gRPC AI Security Gateway for LLM Traffic

I wanted a small, honest implementation of the GenAI governance shape in code: a component on every LLM call that applies policy first, option...

5 months ago

Claude Code Security: The Smart Way to Integrate AI

Anthropic just dropped Claude Code Security, and if you’re anywhere near AppSec or DevSecOps, you’ve probably already seen the debate lighting...

6 months ago

How I Built a Semantic Cache Using Only AWS Services

LLM calls are expensive and slow, but here’s the thing - users ask the same questions in different ways all the time. “What’s your refund poli...

7 months ago

How to Build Better AI Agent Tools: Cut Costs by 70% (MCP Server Case Study)

Building tools for AI agents isn’t the same as building regular APIs. This guide shows you how to design tools that reduce token costs by 60-7...

7 months ago

Building a DevSecOps Pipeline on AWS (And You Can Too)

I have been working with CI/CD pipelines for a while now, and honestly, most of them just focus on getting code deployed fast. But what about ...

7 months ago

AWS DevOps Agent: AI-Powered Incident Investigation in Seconds

Stop spending 30 minutes investigating incidents. Let AI do it in seconds. Here is a hands-on demo you can practice in 15 minutes. The Proble...

8 months ago

DynamoDB Just Made Your Life Easier: Multi-Attribute Composite Keys Explained

AWS just dropped a feature on November 19, 2025 that is going to save you from one of DynamoDB’s most annoying workarounds: multi-attribute co...

9 months ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.