Skip to content

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

Open

Description

@QuentinBisson

📝 Feature Summary

Let a Harness mount digest-pinned OCI images read-only next to its runtime image, with their bin/ on PATH, using Substrate's image volumes.

❓ Problem Statement / Motivation

Agents need CLIs their harness image does not ship (go, node, kubectl, helm). Today the options are:

  • an image built FROM the harness image, which must be rebuilt for every kagent release because the harness checks its pinned CLI version, and once feat: default built-in Harness images from release charts #3151 lands the release owns those images;
  • skills or plugins, which are capped at 100 MiB, never reach PATH, and land in /data and so in every snapshot.

#1822 asked for this decoupling, and the reply there was "I think just PATHs?". Substrate now supports it: agent-substrate/substrate#923 added image volumes as "how tooling gets into images built by third parties without rebuilding them", and kagent already uses one for the sandbox guest.

💡 Proposed Solution

apiVersion: api.kagent.dev/v1alpha3
kind: Harness
metadata:
  name: claude-go
spec:
  claude: {}
  workload:
    image: registry.example.com/claude-harness@sha256:...
    toolImages:
      - name: go
        oci: registry.example.com/tools/go@sha256:...
  • The controller adds an image volume per entry to the ActorTemplate, mounted read-only at /opt/kagent/tools/<name>. This works the same for every runtime: kagent, claude, codex and BYO.
  • It sets KAGENT_TOOL_PATHS instead of PATH, because a template PATH replaces the image's. Each runtime appends it to its own PATH at start, so harness binaries always win. For the kagent runtime this reaches the skills bash tool in both the Python and Go ADK, which inherit the process environment. For BYO it becomes part of the documented contract.
  • The Harness is the platform-managed runtime configuration, so operators decide which tools are offered with the RBAC they already use for Harnesses, and agents keep choosing a Harness as today.
  • References are digest-pinned like every other image in the API, and the controller resolves no tags: keeping a digest current is the job of whatever writes the Harness (GitOps, Renovate). A change is a new revision; running Sessions keep theirs.
  • Documented contract for a tool image: files under one prefix, binaries static or self-contained (the built-in harness images are musl).

🔄 Alternatives Considered

🎯 Affected Service(s)

Controller, the runtimes' start-up (PATH), BYO contract docs (#2884).

📚 Additional Context

Open to maintainers' preference on the field's name, the mount path and the variable's name.

🙋 Are you willing to contribute?

  • I am willing to submit a PR for this feature

Activity

  1. changed the title [-][FEATURE] Mount tool images into an agent's filesystem[/-] [+][FEATURE] Mount tool images into a Harness's filesystem[/+] on Oct 13, 2026
  2. added 2 commits that reference this issue on Oct 13, 2026
    7c8e5d9
    5c3df66
  3. QuentinBisson commented on Oct 14, 2026

    @QuentinBisson
    ContributorAuthor

    I opened #3192 with the Harness field, but I'm happy to change the shape. Another option: a separate resource for tool images that an Agent references by name, the way an Agent references a ModelConfig.

    apiVersion: api.kagent.dev/v1alpha3
    kind: ToolImage
    metadata:
      name: go
    spec:
      oci: registry.example.com/tools/go@sha256:...
    ---
    apiVersion: api.kagent.dev/v1alpha3
    kind: Agent
    spec:
      harnessRef: claude
      toolImages: [go, node]
    • Agents combine tools freely, with no Harness per combination (claude-go, claude-go-node, codex-go...).
    • Operators still decide what is offered, through RBAC on the new kind, so no admission policy is needed to stop an agent from mounting an arbitrary image.
    • The reference stays digest-pinned on the resource, and whatever writes it (GitOps, Renovate) keeps it current. The controller resolves no tags.
    • The resource could later declare which runtimes it fits, so the controller refuses a mismatch.

    The Harness field is the smaller change. Which do you prefer?

  4. EItanya commented on Oct 14, 2026

    @EItanya
    Contributor

    Can't we re-use skills for this potentially?

  5. QuentinBisson commented on Oct 14, 2026

    @QuentinBisson
    ContributorAuthor

    I thought about it, but I don't think skills work for toolchains.

    Skills are limited to 100 MiB and 10k files per artifact. The go binary is small, but it needs the compiler tools and the standard library source to build anything. That is around 190 MB, so it doesn't fit, even with a distroless base. Skills are also pulled and extracted by the runtime on every start. An image volume is pulled once and cached by the node.

    The purpose is also different. A skill needs a SKILL.md because the model reads it. A tool image just adds binaries to PATH, and the model doesn't need to know it exists.

    A small static binary could fit in a skill, but it would still need the PATH wiring from #3192. The image reference already uses the same digest-pinned oci format as skills, so pinning works the same way.

  6. QuentinBisson commented on Oct 14, 2026

    @QuentinBisson
    ContributorAuthor

    Both shapes in #3192 let operators keep toolchains platform-only with plain RBAC, on the Harness or on a ToolImage kind. In both, updating a digest once applies to every agent that uses it. The real difference is combining tools. With the Harness field, each combination needs its own Harness. With a separate kind, an agent just lists the toolchains it needs. I'm fine with either, so it depends on whether you want a new kind.

  7. EItanya commented on Oct 14, 2026

    @EItanya
    Contributor

    FWIW I was actually thinking about switching the OCI pulls and eventually S3 as well to use volumes and then just copy the data over

  8. QuentinBisson commented on Oct 14, 2026

    @QuentinBisson
    ContributorAuthor

    I think that's a good idea, and it would definitely improve skills.

    For tools, I'd keep them separate from skills in the API, because a skill is something the model reads, while a tool image only puts binaries on PATH plus those are two semantically different concepts.

    I see two good shapes, both on the AgentTemplate, since needing Go comes from what the agent does, not from its runtime:

    • A toolImages field next to skills, with the same oci source. It matches how skills work today and needs no new kind.
    • A ToolImage kind that templates reference by name. Each image is defined once, and operators decide which tools exist through RBAC on the CR.

    Either one avoids a Harness per combination. IMO the kind is the better model semantically, but the field is the smaller change, and we could add a reference to it later.

    What would you prefer? And can tools go first, or should they wait for skills and plugins to move to volumes?

  9. dimetron commented on Oct 14, 2026

    @dimetron
    Collaborator

    IMHO this could stay inside skills with additional BIN PATH for extra tools

    1. Copy skills
    2. Copy tools

    We want to enhance existing Kagent tools image to support that.

  10. QuentinBisson commented on Oct 14, 2026

    @QuentinBisson
    ContributorAuthor

    Thanks for the feedback.

    I'm not sure I fully understand it yet, so let me say what I'm trying to get to, and you can tell me where your idea and mine differ.

    We need one or more toolchain images per team (e.g. go, golangci-lint, pre-commit, gh), shared by several Claude and Codex agents, with their binaries on PATH. They can't be derived from the harness image, since that would need a rebuild per kagent release.

    The copy is the part I'm unsure about. Skills are copied into the harness's skills directory because the model reads them from there. A toolchain is only executed, never read, so I don't see what the copy buys. And the Go toolchain alone is ~190 MB on disk. Copied, it lands in every agent that uses it, on every start, and in every snapshot, for bytes that are identical across all of them. That's why #3192 mounts it in place from the image volume with bin/ on PATH. I may be missing a reason the copy matters, so if there is one I'd be glad to know it :)

    On where it lives in the spec, I'm open. I'd just like to understand the thinking behind keeping it under skills, so I build the right thing.

    A few questions to get there:

    1. Is a tool package selected per agent next to its skills, or pulled in by a skill that needs it? And is its bin path fixed, like bin/, or declared by the package?
    2. "Existing kagent tools image": is that kagent-dev/tools, mounted into the agent so its binaries run in the workspace? And could a team point at its own image instead?
    3. feat(agenttemplate): mount toolchain images read-only into the runtime #3192 already projects the image as a volume, so if skills move to volumes they could share that code. Does it make sense for tool images to go first, or do you want to land the skills change before?
  11. added 2 commits that reference this issue on Oct 18, 2026
    1f3346a
    8940241
  12. added 4 commits that reference this issue on Oct 26, 2026
    0944865
    bb1730b
    1c1f5cd
    5ce9f68
  13. added a commit that references this issue on Nov 19, 2026
    bb2ad08
  14. EItanya commented on Nov 19, 2026

    @EItanya
    Contributor

    We do need this capability. The mechanism in #3192 (image volume, plus KAGENT_TOOL_PATHS appended to the runtime's own PATH) looks right. What is still open is where the field lives. Two options are below, and neither is decided yet.

    Why not the Harness

    • Each combination of tools needs its own Harness (claude-go, claude-go-node, codex-go), as already noted above.
    • The RBAC argument is weaker than it was. Since feat: mount OCI skills through Substrate image volumes #3203, AgentTemplate.skills[].source.oci already mounts any digest-pinned image into the actor as an image volume, so mounting an image is not a new privilege for template authors. Only PATH is new.

    Option A: a field on AgentTemplate, next to skills

    kind: AgentTemplate
    spec:
      skills: [...]
      toolchains:
        - name: go
          oci: registry.example.com/tools/go@sha256:...

    For:

    • The template is self-contained. A prompt or skill that assumes go exists ships with the thing that provides it.
    • A digest bump is made once, on the shared template.

    Against:

    • Shared subagents (subAgent.templateRef) are compiled into the parent's runtime, so the whole tree shares one actor and one PATH. The controller would have to union the toolchains of the root template and every bound subagent template. A toolchain declared on a subagent template looks scoped to it, but is visible to the whole tree.
    • Conflicts can't be fully detected. Two entries with the same name and different digests can be rejected, but two differently named images that both ship bin/go resolve silently by PATH order. The author of a subagent template doesn't know which parents will bind it.
    • AgentTemplate is meant to be portable behavior, and a tool image is tied to the harness image's libc and architecture.

    Option B: a field on Agent, next to egressPolicyRefs

    kind: Agent
    spec:
      template: {ref: {name: go-reviewer}}
      harnessRef: {name: claude}
      toolchains:
        - name: go
          oci: registry.example.com/tools/go@sha256:...

    For:

    • There is one list per actor, written by the person who can see the whole tree. No merging across templates and no precedence rule.
    • It matches egressPolicyRefs, which is on Agent because it applies to the whole runtime.
    • The same template can run with different toolchain versions in different Agents without being forked.

    Against:

    • Templates are less self-contained. A template that assumes go only works if every Agent using it adds the toolchain, and nothing in the API catches the omission.
    • A digest bump touches every Agent that lists the image.
    • The Agent author has to know what the subagent templates expect.

    Common to both

    • An OCI-only type of its own rather than ArtifactSource, since Git and bucket sources can't be image volumes.
    • The same compiler handling as skill images: normalized, deduplicated, and counted against Substrate's 32-volume limit. An image used as both a skill source and a toolchain should produce one volume.
    • KAGENT_TOOL_PATHS as in feat(agenttemplate): mount toolchain images read-only into the runtime #3192.
    • The name avoids tools, which already means MCP and subagent bindings. toolchains and binaries are candidates.

    Scope

    The contract is static or musl-compatible binaries, which covers go, kubectl, helm and gh. It does not cover glibc-linked runtimes such as official node builds, Python or a JDK. Full dev environments are a separate problem and probably need a different mechanism, so the docs for this field should state the limit clearly. Sandbox guests also don't see these mounts.

    Opinions on A versus B are welcome, especially from anyone using Shared subagents today.

    Comment left by Claude on behalf of @EItanya.

  15. EItanya commented on Nov 19, 2026

    @EItanya
    Contributor

    A follow-up to the two options above, for the simpler case.

    The examples so far use the Go toolchain, but a lot of the need is single static CLIs such as kubectl, helm and gh. Those are much smaller than Go, and they fit under the skill package limit that rules the Go toolchain out. That makes a third option possible.

    Option C: skills and plugins can contribute a bin/ directory

    No new field. A skill or plugin package that contains a bin/ directory gets it added to PATH, through the same KAGENT_TOOL_PATHS mechanism as #3192.

    kind: AgentTemplate
    spec:
      skills:
        - name: kubectl
          source:
            oci: registry.example.com/skills/kubectl@sha256:...
    kubectl/
      SKILL.md      # when and how to use it
      bin/kubectl
    

    For:

    • No new API surface, and one packaging concept instead of two.
    • The binary ships with the instructions that tell the model how to use it, and the two are versioned together.
    • It reuses everything skills already have: sources, digest pinning, selection, and the image volume delivery from feat: mount OCI skills through Substrate image volumes #3203.
    • If I remember right, Claude Code plugins already have a bin/ convention that lands on the shell's PATH. That needs verifying, but if so this would match an existing format rather than invent one.

    Against:

    • It does not cover large toolchains. The Go toolchain is over the package limit, so Go would still need option A or B, or a raised limit for content that is used in place.
    • PATH should point at the mounted image, not at the copy. Selected skills are copied into the harness's discovery directory under /data, so a copied binary would land in every snapshot. For OCI sources the image is already mounted read-only, so bin/ can be used in place. Git and bucket sources have no mount, so they would either be copied or not support bin/.
    • A tool with no instructions still needs a SKILL.md, which is the semantic objection raised earlier in this thread.
    • Skills live on templates, so the Shared subagent points from option A apply here too: one PATH for the whole tree, and same-named binaries from different packages resolve by order.

    Two notes that apply to all three options

    • One image can carry several CLIs. A team can publish a single image with kubectl, helm and gh together, which makes the per-combination concern smaller in practice.
    • Most of these tools have no image with the expected layout, and gh has no official image at all. Whichever option is chosen, users will be building small images, so the docs should include a minimal example.

    Option C is not exclusive with A or B. It could cover small CLIs now, with a dedicated field added later for large toolchains if that need is confirmed.

    Comment left by Claude on behalf of @EItanya.

  16. QuentinBisson commented on Nov 19, 2026

    @QuentinBisson
    ContributorAuthor

    Thanks for the two write-ups, this helps a lot.

    I prefer going with B because the Agent is the only place where both the template and the Harness are known, so it's the only place where someone can tell if a tool image fits the harness image (libc, arch). It's also the smaller change from what #3192 does today.

    On C, I think it's a nice addition for small CLIs that come with instructions, and it's not exclusive with B. But it doesn't cover my case: we need the Go toolchain, which is over the package limit, so the need for a dedicated field is already there. C also needs KAGENT_TOOL_PATHS and the PATH handling from #3192, so B can land first and C can reuse it.

    I still think A is useful as a default that the Agent can override, but that can be a follow-up, since adding the template field later doesn't break anything.

    What do you think about an optional paths per entry? Today #3192 assumes <mount>/bin, but the official golang image has its binaries in /usr/local/go/bin, and I'd like existing images to work without repackaging.

    On the name, toolchains works for me.

    If B is fine for you, I'll move the field from Harness to Agent in #3192. Does that work?

  17. EItanya commented on Nov 20, 2026

    @EItanya
    Contributor

    I actually think I'm leaning towards putting it on the template and then reconciling them at the agent level. I would rather some slight organization required at that level to allow the toolchains to be defined alongside the skills and prompts which need them. What do you think?

  18. QuentinBisson commented on Nov 22, 2026

    @QuentinBisson
    ContributorAuthor

    It makes sense to me, let's go with the template, as reconciling at the Agent level fixes my concerns. Shared subagents also bring their toolchains along with their skills, which is nice.

    Two small things:

    • When merging at the Agent level, what do you think about deduping by digest and rejecting two entries with the same name but different images?
    • What do you think about adding an optional paths per entry (default bin), so images like golang work without repackaging?

    I'll move the field from Harness to the template in #3192.

  19. added a commit that references this issue on Nov 22, 2026
    283e03b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions