Skip to content

feat(agenttemplate): mount toolchain images read-only into the runtime - #3192

Open
QuentinBisson wants to merge 3 commits into
kagent-dev:mainfrom
giantswarm:feat/harness-tool-images
Open

QuentinBisson wants to merge 3 commits into
kagent-dev:mainfrom
giantswarm:feat/harness-tool-images

Conversation

@QuentinBisson

@QuentinBisson QuentinBisson commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Agents need CLIs their harness image does not ship (go, kubectl, gh). Today that means an image built FROM the harness image, rebuilt for every release, or skills and plugins, which are capped at 100 MiB, never reach PATH, and land in every snapshot. #3190 has the full motivation and the placement discussion.

Change

AgentTemplateSpec.toolchains[] lists digest-pinned OCI images. The controller mounts each one read-only at /opt/kagent/tools/<name> as a Substrate image volume, for every runtime, and sets KAGENT_TOOL_PATHS to their bin/ directories; each runtime appends that to its own PATH, so the image's binaries always win. An Agent gets the toolchains of its template (inline or referenced) and of its Shared subagents: the same name and image is mounted once, the same name with two images is rejected. The list is part of revision identity, and sandbox guests do not see the mounts.

Closes #3190

@github-actions github-actions Bot added the enhancement New feature or request label Oct 13, 2026
@QuentinBisson
QuentinBisson force-pushed the feat/harness-tool-images branch from e86d376 to 7c8e5d9 Compare October 13, 2026 22:37
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 13, 2026
@QuentinBisson
QuentinBisson force-pushed the feat/harness-tool-images branch from 7c8e5d9 to 5c3df66 Compare October 13, 2026 22:48
@QuentinBisson
QuentinBisson marked this pull request as ready for review October 13, 2026 23:14
@QuentinBisson
QuentinBisson force-pushed the feat/harness-tool-images branch from 5c3df66 to 1f3346a Compare October 18, 2026 12:34
@QuentinBisson

Copy link
Copy Markdown
Contributor Author

@moezdil thanks for the review. This is being discussed in the issue #3190

return nil, fmt.Errorf("runtime environment %q conflicts with gateway trust", variable.Name)
}
if variable.Name == toolpath.EnvName {
return nil, fmt.Errorf("runtime environment %q is reserved for tool images", variable.Name)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some digging and the reserved env names are enforced in the controller and compilers today, not the CRD as they differ per runtime (gateway trust names, Claude- and Codex-owned variables), and the BYO LangGraph samples set KAGENT_CHECKPOINT_DB through env, so a CRD prefix rule would break that.
In this PR, KAGENT_TOOL_PATHS follows the trust-name check.

Should this be opened in a follow up?

@QuentinBisson
QuentinBisson force-pushed the feat/harness-tool-images branch from 1c1f5cd to 5d16938 Compare November 7, 2026 01:50
@QuentinBisson
QuentinBisson force-pushed the feat/harness-tool-images branch from f8207eb to c1fde43 Compare November 19, 2026 09:15
Harness.spec.workload.toolImages lists digest-pinned OCI images. The
controller adds one Substrate image volume per entry to the ActorTemplate,
mounted read-only at /opt/kagent/tools/<name> for every runtime, and sets
KAGENT_TOOL_PATHS to the colon-joined bin directories. Each managed runtime
appends them to its own PATH after the image's binaries; the variable is
reserved in Harness.spec.env. The Harness edit form keeps the field it does
not author.

Closes kagent-dev#3190

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
Signed-off-by: QuentinBisson <quentin@giantswarm.io>
Toolchains move from the Harness workload to AgentTemplateSpec, so they are
declared next to the skills and prompts that need them and reach Agents with
an inline template as well. An Agent mounts the toolchains of its template
and of every Shared subagent: the same name and image is mounted once, the
same name with two images is a validation error.

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
@QuentinBisson
QuentinBisson force-pushed the feat/harness-tool-images branch from c1fde43 to 1d07fcf Compare November 22, 2026 01:20
@QuentinBisson QuentinBisson changed the title feat(harness): mount tool images read-only into the runtime feat(agenttemplate): mount toolchain images read-only into the runtime Nov 22, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Mount tool images into a Harness's filesystem

1 participant