↓ Ir para o conteúdo principal
  1. Cloud Computing Solutions/
  2. Blog/

kagent: Deploying, Sandboxing, and Governing AI Agents on Kubernetes

·962 palavras·5 minutos
EF-TECH
Autor
EF-TECH
Transforme a performance e a segurança do seu ambiente com nossas soluções!

Platform engineering teams are facing an architectural turning point: how to host, isolate, scale, and govern autonomous AI agents in production. While developers can prototype an agent in dozens of lines of Python, platform teams immediately encounter the hard questions: Where do agents run securely? How are credentials and MCP tools scoped? What prevents an agent from consuming cluster resources indefinitely or escaping its container?

kagent approaches this challenge from the infrastructure layer. Rather than being another Python framework or visual drag-and-drop tool, kagent turns agent operations into native Kubernetes Custom Resource Definitions (CRDs).

Orchestrated by kagent, an execution substrate called Agent Substrate runs each agent in its own isolated sandbox, suspends it when idle, and wakes it back up in as little as 150ms.

kagent running AI agents natively on Kubernetes via CRDs and Agent Substrate sandboxes

Infrastructure Layer vs. Application Framework
#

The critical conceptual distinction to understand is:

kagent is an infrastructure control plane and runtime layer that deploys and manages agents via Kubernetes CRDs, whereas alternatives are application-level frameworks or low-code platforms.

In fact, kagent is not intended to replace agent logic frameworks like Google ADK, LangGraph, or CrewAI. It is designed to run them. Google ADK serves as the default built-in execution engine, while custom agents built with other frameworks can be hosted inside kagent’s runtime environments using standard container workflows.

+-------------------------------------------------------------------+
|                        Platform Ops / GitOps                      |
|                  (kubectl, ArgoCD, Flux, Helm)                    |
+---------------------------------+---------------------------------+
                                  |
                                  v
+-------------------------------------------------------------------+
|                        kagent Control Plane                       |
|   - Agent CRDs (Agent, ModelConfig, MCPServer)                    |
|   - Kubernetes RBAC, OpenTelemetry, Istio mTLS                    |
+---------------------------------+---------------------------------+
                                  |
                  +---------------+---------------+
                  |                               |
                  v                               v
+-------------------------------+   +-------------------------------+
|     Agent Substrate Sandbox   |   |     Agent Substrate Sandbox   |
|   - gVisor / microVM boundary |   |   - gVisor / microVM boundary |
|   - Wake from sleep (<150ms)  |   |   - Wake from sleep (<150ms)  |
|   - Runtime: Google ADK /     |   |   - Built-in MCP Tools:       |
|     LangGraph / CrewAI        |   |     K8s, Istio, Helm, Prom    |
+-------------------------------+   +-------------------------------+

Head-to-Head Comparison
#

To understand where kagent fits in the evolving agent ecosystem, consider this architectural matrix:

Feature / DimensionkagentAsyaGoogle ADKLangGraphCrewAIDify / n8n
Primary LayerKubernetes Control Plane & RuntimeKubernetes Actor MeshApplication SDKApplication SDKApplication SDKVisual App / Workflow Platform
How You BuildDeclarative YAML CRDs (Agent, ModelConfig)YAML CRDs (AsyncActor) + Python handlersCode (Python, Go, Java, TS, Kotlin)Code (Python, TS)Code (Python)Drag-and-drop web UI
Execution ModelController reconciles sandboxes; runs ADK engineAsync message queues + KEDA autoscalingHierarchical multi-agent trees & workflowsStateful directed cyclic graphs (DAGs)Role-based agent “crews” & flowsNode-based execution pipelines
Tooling & ProtocolsNative MCP (MCPServer CRDs) + A2A protocolActors act as tools/stepsNative MCP & A2A supportCustom Python/TS functions + MCPCustom tools + MCPHundreds of pre-built SaaS connectors
Built-in Infra OpsK8s RBAC, OpenTelemetry, Istio/mesh, sandbox isolationQueue routing, scale-to-zero via KEDASession state, CLI, local dev UICheckpointing, time-travel debuggingTask delegation & memoryUser auth, API endpoints, RAG UI

Key Architectural Differences
#

1. kagent vs. Asya (Kubernetes Infrastructure)
#

Both projects utilize Kubernetes CRDs, but they target fundamentally different workload profiles:

  • kagent is agent-centric: It provisions dedicated runtimes (deployments or gVisor-based sandboxes) for conversational and interactive agents. It includes built-in MCP tools for SRE operations—such as Kubernetes API access, Istio, Helm, and Prometheus.
  • Asya is pipeline-centric: It treats AI operations as asynchronous, stateless actor steps connected via message queues (RabbitMQ, AWS SQS, Google Cloud Pub/Sub) that scale independently to zero via KEDA.

2. kagent vs. Google ADK (Runtime vs. SDK)
#

Google ADK (Agent Development Kit) is the default execution engine bundled inside kagent. When used standalone, Google ADK requires developers to write agent classes in code and wire up deployment targets manually. kagent wraps that engine in a Kubernetes operator so platform engineers can manage models, API keys, MCP servers, and agent lifecycles declaratively using kubectl and GitOps pipelines.

3. kagent vs. LangGraph & CrewAI (Ops Layer vs. Logic Layer)
#

  • LangGraph excels at state machine control, cyclic graphs, and human-in-the-loop approval gates.
  • CrewAI focuses on role-based multi-agent collaboration with structured task handoffs.

Neither LangGraph nor CrewAI solves cluster-level container isolation, service mesh mTLS, or namespace RBAC out of the box. Teams frequently write complex agent decision logic in LangGraph or CrewAI, and then package and host that logic inside kagent’s runtime for unified operations and security.

4. kagent vs. Dify & n8n (DevOps GitOps vs. Low-Code UI)
#

While kagent includes a web dashboard to inspect agent sessions and review audit logs, it is designed for platform teams practicing Infrastructure as Code. In contrast, Dify and n8n target visual builders and product teams connecting LLMs to SaaS APIs (such as Slack, HubSpot, or Notion) without writing Kubernetes manifests.


When to Choose Which
#

  • Choose kagent if you need to run AI agents natively on Kubernetes using GitOps, require hardened sandbox isolation (sub-150ms sleep/wake), demand built-in SRE cluster tools (Prometheus, Helm, Istio), or want a centralized control plane with A2A (Agent-to-Agent) and MCP governance.
  • Choose Asya if your primary workload consists of high-throughput, asynchronous batch pipelines or event-driven multi-step processing that demands queue backpressure and KEDA scale-to-zero.
  • Choose Google ADK, LangGraph, or CrewAI if you are an application engineer building bespoke reasoning loops, complex state machines, or multi-role collaboration patterns in code.
  • Choose Dify or n8n if your organization needs business and product teams to assemble automated LLM workflows quickly using a visual UI and pre-integrated SaaS connectors.

Summary
#

As AI agents transition from local experiments to production workloads, Kubernetes is emerging as the natural orchestrator for compute, network isolation, and identity. By combining declarative CRDs with Agent Substrate sandboxing and MCP-native governance, kagent provides platform engineers with a unified, cloud-native way to run autonomous agents at scale.