Skip to content

No way to give a Task a secret: EnvVar has no valueFrom and TaskSpec has no modelRef #348

Open

Description

@naeemarsalan

Summary

There is no way to give a Task a credential except as a literal string in its spec, and that literal is readable back through the API.

Model exists and holds a secret reference, but nothing connects it to a Task.

AX v0.3.0 (d8ed0fe).

The gap

EnvVar has two fields:

// pkg/apis/v1alpha1/ax.pb.go
Name  string `protobuf:"bytes,1,opt,name=name,proto3"  json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`

No valueFrom, no secret reference. And TaskSpec has no model reference:

Suspend, Image, Command, Env, Resources, Workspaces, Gateway, Debug

Model does take one — spec.secretKey.{name,key} — but it is consumed by AX's own components (internal/model/client.go, e.g. planning a Workspace from its goal). A Task cannot reference a Model, so an agent that calls a model itself has nowhere to get the key from.

What that means in practice

Our task talks to an LLM gateway, so its spec carries the key:

env:
  - name: LITELLM_KEY
    value: "sk-lab-..."

and it comes straight back out:

$ ax get task susp2
        - name: LITELLM_KEY
          value: sk-lab-b6a69e5a84d6add8bbb8ae7d83e8991b03a69d0b72be42b2

Anyone who can reach the AX API can read every task's credentials. It also means the rendered manifest is a secret-bearing file that has to be created, chmod'd, applied and deleted for every run, rather than a checked-in declaration.

docs/manifests.md shows kubectl create secret for the Model flow, which reads as though secret handling is covered — it is, but only for AX's own model calls, not for anything the task does.

Suggestions, roughly in order of cost

  • valueFrom.secretKeyRef on EnvVar, mirroring Kubernetes — the least surprising option
  • spec.modelRef on TaskSpec, injecting the referenced Model's key into the sandbox
  • failing both, a note in docs/manifests.md that task credentials are plaintext and API-readable, so people do not assume the Model secret flow covers them

Happy to test a patch on this cluster.

Activity

  1. aakash-env commented on Sep 21, 2026

    @aakash-env

    @naeemarsalan Kindly assign this issue to me

  2. arbazkhan971 commented on Sep 22, 2026

    @arbazkhan971

    Fix ready: implemented on my fork (branch fix/348-task-secrets, regression test included, make test green) and ready to PR — but this repo's collaborators_only PR creation policy rejects PRs from non-collaborators (see #358), so I cannot open it. If PR creation opens for external contributors, I will open the PR immediately. Happy to adjust scope per maintainer feedback.

  3. self-assigned this
    on Sep 25, 2026
  4. gambtho commented on Oct 1, 2026

    @gambtho

    Still the case on main (ac23328). The controller only projects the fixed gemini-api-secret/GEMINI_API_KEY value into the ActorTemplate env (internal/controller/reconciler.go), and anything passed through Task env or inline workspace files lands in the template in plaintext too.

    This is the main thing stopping us from running agents with real model credentials on AX. Is a Task→Model binding planned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions