How to Configure Semantic Kernel Kubernetes Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up semantic kernel kubernetes approval by pairing cluster roles with agent filters. The agent pauses before it runs a cluster change and waits for human review. Many teams start by giving their AI agent a shared cluster role. This broad role lets the agent read and write across too many resources. If a prompt goes wrong, the agent can delete pods or leak secrets fast. How semantic kernel kubernetes approval works in native setups To build this workflow, you must connect two distinct s

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up semantic kernel kubernetes approval by pairing cluster roles with agent filters. The agent pauses before it runs a cluster change and waits for human review. Many teams start by giving their AI agent a shared cluster role. This broad role lets the agent read and write across too many resources. If a prompt goes wrong, the agent can delete pods or leak secrets fast.

How semantic kernel kubernetes approval works in native setups

To build this workflow, you must connect two distinct systems. First, you set up permissions inside the cluster using native role rules. In Kubernetes, a Role sets permissions inside one single namespace. A ClusterRole sets rules across the whole cluster and covers nodes or all namespaces. You then use a RoleBinding to attach those rules to the agent identity. If the agent needs cluster-wide reach, you use a ClusterRoleBinding instead.

Kubernetes rules are purely additive. This means there are no deny rules in the native role system. You must list every resource and subresource the agent can touch. For example, reading pod logs or running commands inside a pod uses subresources. You must grant permissions for the pod log subresource or the pod exec subresource.

Second, you add a check inside the Semantic Kernel app code. The framework lets developers wrap tool calls with execution filters. When the language model picks a cluster function, the filter catches the call. The app then sends a message to a human operator on the team. The code pauses the task until the human clicks approve or reject. Once approved, the agent uses its bound role to call the cluster API.

What native cluster roles solve and what they leave open

Native cluster roles are great for controlling which identity can log in. They block unknown users and limit an agent to specific namespaces. If an agent only has a read role, it cannot delete a deployment. This basic setup stops unauthorized apps from reaching the cluster API server.

Still, static roles and app-level filters leave big operational gaps in production. Once a role grants access to the pod exec subresource, the door keeps the session active. Native role rules check the API endpoint, not the exact command inside the request. An agent with exec permissions can run a safe check or wipe a folder. The cluster API server sees both actions as the same allowed subresource call.

Approval Chains & Escalation + Kubernetes RBAC: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Relying on app code for human review also creates risk across a growing team. Each developer must write and maintain the same filter logic in every agent app. If one app skips the filter, the agent runs with full role permissions right away. Also, the cluster still holds long-lived keys or tokens for the agent identity. Also, pod logs or database checks might return sensitive user data. Native roles do not rewrite emails, phone numbers, card numbers, or national IDs in results.

Why decoupling human review from agent code reduces risk

Moving approval rules out of the app code makes security much easier to manage. Developers can focus on building agent prompts and tools without writing custom review logic. The security team sets one rule set for all human and AI cluster calls.

When an agent tries to run a command inside a pod, the check happens outside the app. A reviewer sees the exact command before it reaches the cluster API server. Even after approval, data masking rewrites matched fields like emails or card numbers in results. This keeps sensitive strings out of the language model context and chat logs.

Govern kubectl and API calls in flight

Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.

First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.

Frequently asked questions

Can Kubernetes RBAC block specific commands inside a pod exec call?

No, native role rules only check if the user can call the pod exec subresource. They do not inspect or block specific shell commands sent inside that session.

Do Kubernetes roles support explicit deny rules for dangerous agent tasks?

No, permissions in Kubernetes RBAC are purely additive and never include deny rules. You must start with zero permissions and only add the exact verbs the agent needs.

Why is code-level approval in Semantic Kernel hard to scale?

Code-level filters only live inside the single app where a developer wrote them. If your team deploys ten agents, you must audit and update code in ten places.

The query runs. The emails stay hidden.