Skip to content

How should users pass custom secrets to BYOA agents invoked via reusable dispatch? #6359

Description

@ralphbean

Question

How is a user supposed to get a custom secret to a BYOA agent invoked through reusable dispatch with CEL expression triggering? The workflow doesn't know to explicitly "mount" their secret to an env var.

Current State

Looking at the workflow chain:

  1. reusable-dispatch.yml defines a fixed set of secrets:

    • FULLSEND_GCP_WIF_PROVIDER
    • FULLSEND_GCP_PROJECT_ID
    • OTEL_EXPORTER_OTLP_TRACES_HEADERS
    • OTEL_EXPORTER_OTLP_HEADERS
  2. reusable-harness-run.yml declares the same secrets and passes them to the agent run step

  3. The agent execution environment has a hardcoded env: block

Per workflow-contracts.md, GHA reusable workflows don't inherit secrets - they must be explicitly forwarded at every hop. There's no escape hatch here.

Current Workarounds

Option 1: Custom poller workflow
Skip reusable-dispatch entirely and write a custom workflow that directly calls reusable-harness-run.yml. But reusable-harness-run.yml only accepts the predefined secrets, so this doesn't work either.

Option 2: Fork the workflow
Fork reusable-harness-run.yml into your repo and add your secret. Not scalable, breaks upgrades.

Option 3: Use secrets: inherit (untested)
The repo uses secrets: inherit in e2e-ok-to-test.yml, though workflow-contracts.md discourages it as a blanket pattern. If reusable-harness-run.yml used secrets: inherit, users could pass any secret. But this would break the explicit contract model the codebase currently enforces.

Potential Solutions

A. Add secrets: inherit to reusable-harness-run.yml
Would need to flow through reusable-dispatch.yml too. Goes against the explicit-forwarding principle in the docs.

B. Support a passthrough secret map
Add an input like:

inputs:
  custom_env:
    type: string  # JSON map

Callers pass '{"MY_KEY": "value"}', the workflow deserializes and injects into the agent env. Secrets would need to be stringified client-side (awkward).

C. Document the api_servers pattern
The harness api_servers: feature already lets users run a host-side proxy with custom env. The proxy script can access repository secrets, and the sandbox talks to it over localhost. This is the current "blessed" path for custom credentials, but it's not obvious from the BYOA guide.

D. Reserve a custom secret namespace
Define CUSTOM_AGENT_ENV_* secrets that the workflow auto-injects. Users set CUSTOM_AGENT_ENV_MY_KEY=... as a repo secret, workflow strips the prefix and passes MY_KEY to the agent.

Notes

Option C (api_servers) is the only one that currently works without workflow changes, but it's not well-documented for this use case.

Metadata

Metadata

Assignees

Labels

component/dispatchWorkflow dispatch and triggerscomponent/harnessAgent harness, config, and skills loadingquestionFurther information is requested

Type

No type

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions