<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ajey kulkarni</title>
    <description>The latest articles on DEV Community by Ajey kulkarni (@ajey_k_b3b392e7c4138059db).</description>
    <link>https://dev.to/ajey_k_b3b392e7c4138059db</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4024165%2F4c6b2a41-b023-4b78-b5d8-ca754fa04937.png</url>
      <title>DEV Community: Ajey kulkarni</title>
      <link>https://dev.to/ajey_k_b3b392e7c4138059db</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ajey_k_b3b392e7c4138059db"/>
    <language>en</language>
    <item>
      <title>Kubernetes RBAC for AI Agents: Least-Privilege Patterns That Actually Matter</title>
      <dc:creator>Ajey kulkarni</dc:creator>
      <pubDate>Mon, 13 Jul 2026 07:03:35 +0000</pubDate>
      <link>https://dev.to/ajey_k_b3b392e7c4138059db/kubernetes-rbac-for-ai-agents-least-privilege-patterns-that-actually-matter-5aee</link>
      <guid>https://dev.to/ajey_k_b3b392e7c4138059db/kubernetes-rbac-for-ai-agents-least-privilege-patterns-that-actually-matter-5aee</guid>
      <description>&lt;p&gt;Canonical URL:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://infradecode.com/kubernetes-rbac-for-ai-agents-least-privilege-patterns/" rel="noopener noreferrer"&gt;https://infradecode.com/kubernetes-rbac-for-ai-agents-least-privilege-patterns/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;:&lt;br&gt;
Most teams bolt an AI agent onto their Kubernetes cluster and give it a ServiceAccount with cluster-admin because "it's just for diagnostics."&lt;/p&gt;

&lt;p&gt;That's the mistake.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn0mgaswhbw0djt615bws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn0mgaswhbw0djt615bws.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
AI agents — K8sGPT, LangChain tools, Claude MCP, custom agents — are untrusted automation clients. They process logs, prompts, tool outputs, and user instructions. Any of those inputs can be manipulated via prompt injection.&lt;/p&gt;

&lt;p&gt;If the agent can only read → prompt injection influences recommendations.&lt;br&gt;
If the agent can mutate → prompt injection influences your cluster.&lt;/p&gt;

&lt;p&gt;Here's the RBAC pattern I use in production to prevent that.&lt;br&gt;
Section 1 — Core Principle&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Principle
&lt;/h2&gt;

&lt;p&gt;Always use this pattern for AI agents:&lt;/p&gt;

&lt;p&gt;ServiceAccount → Role → RoleBinding → Namespace&lt;/p&gt;

&lt;p&gt;Never default to this:&lt;/p&gt;

&lt;p&gt;ServiceAccount → ClusterRole → ClusterRoleBinding → Entire Cluster&lt;/p&gt;

&lt;p&gt;Namespace isolation is your first security boundary.&lt;br&gt;
Section 2 — Production RBAC YAML&lt;/p&gt;

&lt;h2&gt;
  
  
  Production RBAC YAML
&lt;/h2&gt;

&lt;p&gt;apiVersion: v1&lt;br&gt;
kind: Namespace&lt;br&gt;
metadata:&lt;br&gt;
  name: ai-diagnostics&lt;br&gt;
  labels:&lt;/p&gt;

&lt;h2&gt;
  
  
      security.infradecode.com/purpose: ai-agent-diagnostics
&lt;/h2&gt;

&lt;p&gt;apiVersion: v1&lt;br&gt;
kind: ServiceAccount&lt;br&gt;
metadata:&lt;br&gt;
  name: k8s-ai-diagnostics-agent&lt;br&gt;
  namespace: ai-diagnostics&lt;/p&gt;

&lt;h2&gt;
  
  
  automountServiceAccountToken: true
&lt;/h2&gt;

&lt;p&gt;apiVersion: rbac.authorization.k8s.io/v1&lt;br&gt;
kind: Role&lt;br&gt;
metadata:&lt;br&gt;
  name: k8s-ai-diagnostics-readonly&lt;br&gt;
  namespace: ai-diagnostics&lt;br&gt;
rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;apiGroups: [""]
resources:

&lt;ul&gt;
&lt;li&gt;pods
verbs:&lt;/li&gt;
&lt;li&gt;get&lt;/li&gt;
&lt;li&gt;list&lt;/li&gt;
&lt;li&gt;watch&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;apiGroups: [""]
resources:

&lt;ul&gt;
&lt;li&gt;pods/log
verbs:&lt;/li&gt;
&lt;li&gt;get
# Secrets intentionally excluded
# pods/exec intentionally excluded
# No mutation verbs granted
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: k8s-ai-diagnostics-readonly-binding
namespace: ai-diagnostics
subjects:&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;kind: ServiceAccount
name: k8s-ai-diagnostics-agent
namespace: ai-diagnostics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: k8s-ai-diagnostics-readonly
Section 3 — Verification Commands
## Verify With kubectl auth can-i&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NS="ai-diagnostics"&lt;br&gt;
SA="k8s-ai-diagnostics-agent"&lt;br&gt;
IDENTITY="system:serviceaccount:${NS}:${SA}"&lt;/p&gt;

&lt;h1&gt;
  
  
  These should return: yes
&lt;/h1&gt;

&lt;p&gt;kubectl auth can-i get pods --as="${IDENTITY}" -n "${NS}"&lt;br&gt;
kubectl auth can-i list pods --as="${IDENTITY}" -n "${NS}"&lt;br&gt;
kubectl auth can-i get pods --subresource=log --as="${IDENTITY}" -n "${NS}"&lt;/p&gt;

&lt;h1&gt;
  
  
  These should return: no
&lt;/h1&gt;

&lt;p&gt;kubectl auth can-i delete pods --as="${IDENTITY}" -n "${NS}"&lt;br&gt;
kubectl auth can-i get secrets --as="${IDENTITY}" -n "${NS}"&lt;br&gt;
kubectl auth can-i patch pods --as="${IDENTITY}" -n "${NS}"&lt;br&gt;
kubectl auth can-i impersonate users --as="${IDENTITY}"&lt;br&gt;
Section 4 — Two Identity Model&lt;/p&gt;

&lt;h2&gt;
  
  
  Two Identity Model for Production
&lt;/h2&gt;

&lt;p&gt;Don't combine diagnostic and remediation in one identity. Use two:&lt;/p&gt;

&lt;p&gt;Diagnostic Agent&lt;br&gt;
→ get, list, watch only&lt;br&gt;
→ Explains issues. Never acts.&lt;/p&gt;

&lt;p&gt;Remediation Controller&lt;br&gt;
→ Narrow approved actions only&lt;br&gt;
→ Requires approval gate, audit logging, and rollback path&lt;/p&gt;

&lt;p&gt;This separation prevents prompt injection from becoming direct cluster compromise.&lt;br&gt;
Section 5 — Three Mistakes to Avoid&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three Mistakes to Avoid
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Giving cluster-wide view access&lt;br&gt;
Even read-only cluster access exposes namespace topology, workload relationships,&lt;br&gt;
and metadata across all environments. For AI agents, this data becomes attack surface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allowing Secrets access&lt;br&gt;
Secrets may contain DB credentials, API keys, cloud tokens, signing keys.&lt;br&gt;
Even read-only access is dangerous. Provide sanitized error logs instead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Adding mutation verbs for convenience&lt;br&gt;
create, update, patch, delete turn a diagnostic assistant into an active cluster operator.&lt;br&gt;
That is a completely different risk category.&lt;br&gt;
Section 6 — TL;DR + Closing&lt;/p&gt;
&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Use namespace-scoped Roles, never ClusterRoleBinding for AI agents&lt;/li&gt;
&lt;li&gt;Grant only get, list, watch on required resources&lt;/li&gt;
&lt;li&gt;Deny Secrets, exec, impersonate, and all mutation verbs by default&lt;/li&gt;
&lt;li&gt;Use separate identities for diagnostic vs remediation workflows&lt;/li&gt;
&lt;li&gt;Always verify with kubectl auth can-i after applying&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full post with complete YAML and verification checklist on InfraDecode:&lt;br&gt;
&lt;a href="https://infradecode.com/kubernetes-rbac-for-ai-agents-least-privilege-patterns/" rel="noopener noreferrer"&gt;https://infradecode.com/kubernetes-rbac-for-ai-agents-least-privilege-patterns/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;What RBAC patterns are you using for AI agents in your cluster?&lt;br&gt;
Drop it in the comments — curious what others are doing differently&lt;/p&gt;

</description>
      <category>ai</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>AI Agents for DevOps in 2026: Tools That Are Actually Worth Using</title>
      <dc:creator>Ajey kulkarni</dc:creator>
      <pubDate>Fri, 10 Jul 2026 13:56:55 +0000</pubDate>
      <link>https://dev.to/ajey_k_b3b392e7c4138059db/ai-agents-for-devops-in-2026-tools-that-are-actually-worth-using-136j</link>
      <guid>https://dev.to/ajey_k_b3b392e7c4138059db/ai-agents-for-devops-in-2026-tools-that-are-actually-worth-using-136j</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;I've been testing a bunch of AI tools in my Kubernetes workflow over the past few months and wanted to share what's genuinely changed my day-to-day vs what's just marketing noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's actually working:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;K8sGPT&lt;/strong&gt; — scans your cluster and explains issues in plain English. Saved me a lot of time on pod crash debugging. Open source, worth trying.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-assisted incident triage&lt;/strong&gt; — tools that correlate logs + metrics and surface root cause faster than manual grep-ing through Kibana&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Natural language infra provisioning&lt;/strong&gt; — still early but some teams are running Terraform via prompts in CI pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What's still overhyped:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fully autonomous&lt;a href="https://dev.tourl"&gt;&lt;/a&gt; remediation without human approval (too risky in prod)&lt;/li&gt;
&lt;li&gt;AI writing your Helm charts from scratch (output needs heavy review)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wrote a longer breakdown on my blog if anyone wants&lt;a href="https://dev.tourl"&gt;&lt;/a&gt; the full list with tool comparisons: &lt;a href="https://infradecode.com" rel="noopener noreferrer"&gt;https://infradecode.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Curious what tools others are actually running in production — anything I missed?****&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>kubernetes</category>
      <category>k8s</category>
    </item>
  </channel>
</rss>
