Skip to content

[Epic] Adopt kagent Agent Substrate — DevAI-authored agents, sandboxed full lifecycle #69

Description

@Sam123ben

Epic — Adopt kagent Agent Substrate as DevAI's sandboxed agent runtime

One-line: let DevAI users author their own agents in the dashboard (adhering to the registry design), then have kagent's Agent Substrate run them as isolated, on-demand, sandboxed Actors — through a full dev → test → deploy → run lifecycle.

Why now

Earlier we decommissioned kagent on the prod cluster because the classic kagent model is one always-warm Deployment per agent (× model variant) — a standing-pod explosion that does not fit our 3-node cluster. The user's instinct was right: "I thought these would be like jobs — pop up when called, not always running." So today every agent runs as an on-demand K8s Job (default JobRunnerStage), kagent is dormant behind the operator kill-switch (DEVAI_KAGENT_ENABLED=false).

The Agent Substrate (solo.io + kubernetes-sigs/agent-sandbox + GKE Agent Sandbox) changes the calculus. Its WorkerPool + Actor model gives "fast cold starts, low resource overhead, and secure gVisor/Firecracker isolation per agent" — agents are lightweight Actors multiplexed inside a shared WorkerPool, not a pod each. That directly answers both reasons we backed off kagent (standing-pod cost → low overhead; "should pop up when called" → fast cold start), and it adds strong per-agent sandboxing — exactly what we need to let users run their own agent code safely.

The end-to-end we're building

USER authors agent in DevAI dashboard (ArtifactEditor, registry schema/layout)
   → validate (schema + lint + handover types)            [Authoring]
   → BUILD (resolve refs) → TEST (eval) → SECURITY gate    [Lifecycle harness]
   → PUBLISH to agentic-registry                            [Registry]
   → agent-sync renders SandboxAgent + ActorTemplate        [Registry→Substrate]
   → kagent Substrate runs it as a gVisor-sandboxed Actor   [Runtime]
      in a shared WorkerPool, on demand, on the user's key  [Dispatch + per-user keys]
   → DevAI dispatches a run to the Actor over A2A           [Dispatch]
   → live status + cost surfaced in the dashboard           [Observability]

Sub-issues (decide + sequence here)

Guardrails / constraints

  • No prod standing-pod explosion. Adoption is conditional on [Substrate] GO/NO-GO: WorkerPool+Actor resource model on 3-node GKE #70 proving the WorkerPool model fits 3 nodes. If it doesn't, we stay on on-demand Jobs.
  • GitOps only (tesserix-k8s + ArgoCD); no manual kubectl apply. connect-local first for any cluster op.
  • Additive + reversible. Substrate is opt-in behind the existing DEVAI_KAGENT_ENABLED operator switch; Jobs remain the default until Substrate is proven.

References

Sequencing (dependencies)

#70 GO/NO-GO ──gate──> everything below
   └─> #71 Install ──> #73 Registry→Substrate render ──> #74 Dispatch ──> #77 Observability
        #72 Authoring ──┘ (feeds #73)                       │
        #75 Lifecycle gate (build/test/security) ───────────┤ (blocks "deploy to Substrate")
        #76 Security/isolation ──underpins──> #71,#74,#75
        #78 Cost/autoscaling ──depends──> #70,#71

Decision order: start with #70 (does it fit 3 nodes?). If GO → #71 + #72 in parallel → #73#74#75/#76/#77/#78. If NO-GO → stay on on-demand Jobs and revisit when node budget grows.

Metadata

Metadata

Assignees

Labels

agent-substratekagent Agent Substrate adoptionenhancementNew feature or requestepicTracking epic spanning multiple issueskagentkagent / agent runtime

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions