feat: add agent-builder helm chart#2210
Conversation
Adds a new Declarative kagent agent that can interview users and scaffold, draft, and deploy other Declarative kagent agents directly to the cluster. Uses read-only discovery tools plus k8s_apply_manifest (gated by requireApproval) for the minimal-privilege footprint needed to author agents safely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Avri Chen-Roth <avri210984@gmail.com>
Adds agent-builder as an optional dependency in Chart-template.yaml and sets default values (enabled: true) in values.yaml, matching the pattern used by all other bundled agents. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Avri Chen-Roth <avri210984@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Avri Chen-Roth <avri210984@gmail.com>
Adds the envsubst + helm package steps so agent-builder is stamped with the release version and packaged alongside every other agent chart when running make helm-agents / make helm-version. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Avri Chen-Roth <avri210984@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a new optional (enabled-by-default) bundled Helm subchart that deploys an agent-builder kagent.dev/v1alpha2 Declarative Agent, wires it into the main helm/kagent chart, and extends Helm unittest coverage for nodeSelector behavior.
Changes:
- Introduces the new
helm/agents/agent-builderchart (Agent manifest, values, helpers, chart template). - Wires
agent-builderintohelm/kagentas a dependency and adds default values. - Extends the existing
agent-nodeselector_test.yamlsuite and includes the chart inmake helm-agentspackaging.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Packages the new agent chart during make helm-agents. |
| helm/kagent/values.yaml | Adds default configuration block for the new agent subchart. |
| helm/kagent/tests/agent-nodeselector_test.yaml | Adds nodeSelector unit tests for the new agent template. |
| helm/kagent/Chart-template.yaml | Adds agent-builder as an optional dependency of the main chart. |
| helm/agents/agent-builder/values.yaml | Defines chart values (modelConfigRef, runtime, resources, nodeSelector, etc.). |
| helm/agents/agent-builder/templates/agent.yaml | Adds the Declarative Agent resource manifest with tool gating via requireApproval. |
| helm/agents/agent-builder/templates/_helpers.tpl | Adds the standard agent.deploymentSpec helper used by other agent charts. |
| helm/agents/agent-builder/Chart-template.yaml | Defines the new agent chart metadata (name, version, description). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,5 @@ | |||
| apiVersion: v2 | |||
| name: agent-builder | |||
| - name: agent-builder | ||
| version: ${VERSION} | ||
| repository: file://../agents/agent-builder | ||
| condition: agent-builder.enabled |
|
The reason i called this agent If someone has a better naming for this agent please let me know. |
|
Re: This prose duplicates the The fix is cheap because discovery is already half-built. Retitle to "(rough sketch — verify against the live CRD)" and add to the Grounding Protocol:
Nit: Self-validate (step 5) should also check "every |
|
@sagy101 I applied the fixes you suggested. Thank you 🙏 |
…lder prompt - Retitle schema section to signal it is a rough sketch, not authoritative - Add grounding step to read agents.kagent.dev CRD openAPIV3Schema for the authoritative field set instead of relying on the frozen prose - Add self-validate check that every requireApproval entry appears in toolNames (CEL-enforced on the CRD; violation guarantees apply rejection) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Avri Chen-Roth <avri210984@gmail.com>
ed23342 to
3d676c7
Compare
Summary
agent-builderHelm chart underhelm/agents/agent-builder/kagent.dev/v1alpha2Agent manifest, and applies it only after explicit human approval viarequireApprovalhelm/kagentchart as an optional dependency (enabled by default), following the same pattern as all other bundled agentsagent-buildertohelm unittestnodeSelector test suite (agent-nodeselector_test.yaml)agent-buildertomake helm-agentsMakefile target so it is version-stamped and packaged at release timeEvery cluster write goes through a mandatory human approval gate — the agent cannot bypass it.
k8s_apply_manifestis the only tool that modifies the cluster, and it is declared underrequireApprovalin the Agent spec:This means:
k8s_apply_manifest— which pauses and presents an approval prompt to the userThe system prompt reinforces this: the agent is told not to ask for permission conversationally ("should I apply?") — the tool's approval prompt is the single, unavoidable checkpoint. There is no way for the agent to write to the cluster without a human saying yes.
All other tools (
k8s_get_resources,k8s_get_resource_yaml,k8s_get_available_api_resources,k8s_describe_resource,k8s_get_events,k8s_get_pod_logs) are read-only and require no approval.Design decisions
k8s_apply_manifestgated behindrequireApprovalagent-builder)deploymentblock of existing working agents (via the standardagent.deploymentSpechelper andvalues.yamlnodeSelector) so it schedules correctly on any cluster topologyTest plan
helm templaterenders a valid Agent manifest with default valueshelm templatewithagent-builder.enabled=falseomits the Agenthelm unittestnodeSelector test suite passes (22/22)make helm-install-provideron a fresh Kind cluster — agent-builder reachesREADY: True, ACCEPTED: Truemessage/sendreaches the agent and routes correctly — confirmed via JSON-RPC responseVerification results
helm templatewith defaults (agent-builder.enabled=true)Rendered a valid
kagent.dev/v1alpha2Agent resource. Key fields confirmed present:spec.type: Declarativespec.declarative.runtime: gospec.declarative.tools[0].mcpServer.requireApproval: [k8s_apply_manifest]spec.declarative.deployment.nodeSelectorabsent (correct — no default nodeSelector set)kagent-tool-serverhelm templatewithagent-builder.enabled=falseZero
agent-builderresources rendered — the condition gate works correctly.helm templatewithagent-builder.nodeSelector.disktype=ssdspec.declarative.deployment.nodeSelector.disktype: ssdrendered correctly, confirming theagent.deploymentSpechelper propagates values as expected.helm unittest(tests/agent-nodeselector_test.yaml)Kind cluster deployment (
make helm-install-provider)Agent deployed, pod running, controller accepted and marked Ready on a fresh Kind cluster.
A2A
message/sendtoagent-builderSent a
message/sendJSON-RPC request with prompt"I want to build an agent that watches for pods in CrashLoopBackOff and summarizes the logs". The request was routed correctly to the agent (adk_app_name: kagent__NS__agent_builder), a task and session were created, and the agent reached the LLM call stage. A2A routing, session creation, and tool wiring are all confirmed working end-to-end.🤖 Generated with Claude Code