Skip to content

bug(platform): the project Environment tab says agents receive its credentials at run time, but no run reads them; its name check also disagrees with the server #4466

Closed

Description

@yannickmonney

Summary

A project's Environment tab tells administrators that agents use its credentials:

  • "Encrypted credentials this project's agents can use."
  • under Available to agents: "Agent runtimes (e.g. Hermes, OpenClaw) can use these secrets when they run tasks for this project … Values are injected at runtime".

No run reads them. Nothing in the platform reads app.project_secrets outside the tab's own list, save and delete routes. An admin who stores a token there expects the agent to sign in with it, and the run starts without it.

The docs now say this. #4463 (6682e4818, docs/en/platform/projects/overview.md, "Project credentials") states that "project credentials are currently stored without being injected into agent runs" and points to the agent's Secrets grants. Its PR notes that "the Environment catalog's runtime-injection wording therefore needs a separate product follow-up". This is that follow-up.

The tab's name check also disagrees with the server:

  • The editor accepts ^[A-Za-z_][A-Za-z0-9_]*$ and treats token and TOKEN as different names.
  • The server upper-cases the name, then requires ^[A-Z][A-Z0-9_]{0,63}$.
  • So _TOKEN, or a name longer than 64 characters, passes the editor and fails on save.
  • And token plus TOKEN pass as two rows but are stored as one credential.

Evidence (main a89498df49b8ea957c14e14ca878943e98fa6849)

What Where
The promise services/platform/messages/en/projectSecrets.yml description, agentAccessTitle, agentAccessBody; rendered by project-secrets-layout.tsx:14, :18–19
What runs receive backend/core/tasks/agent_run_host.ts:1415–1425 and backend/core/automations/agent_host.ts:1543–1550 build the per-exec credential env from the agent's or node's referenced secrets and brokered credentials. Neither reads project secrets
Who reads project secrets backend/domains/projects/secrets.ts (listProjectSecrets returns names only; set and delete) and backend/domains/projects/routes.ts:578, :599. No other caller at main
Name rule, client packages/ui/src/components/forms/env-var-list-editor.tsx:28 (ENV_KEY_RE); duplicate check :302 compares trimmed names case-sensitively
Name rule, server backend/domains/projects/secrets.ts:39–41 (trim().toUpperCase(), then SECRET_NAME_RE); lib/shared/schemas/secrets.ts:9 /^[A-Z][A-Z0-9_]{0,63}$/
History #2791 (project-level env var precedence) was closed as not planned on 2026-09-27; the tab's copy still describes runtime use

Expected and observed

  • Expected: the tab's words match what the product does. Either:

    • project credentials reach task and automation runs on the runtimes the copy names, and the UI says which; or
    • the tab says they're stored but not yet used by agents, and points to the agent's Secrets grants, as the docs now do.

    The editor applies the server's name rule, or normalizes before checking, so a name it accepts can be saved and stays distinct.

  • Observed: the copy promises runtime injection that doesn't exist. The editor accepts names the server rejects, and treats names the server merges as distinct.

Severity

Medium (UX-CLARITY, REL-MANUAL; critical cell projects.secrets). Credentials stored here silently do nothing, and the page tells admins the opposite. That costs failed agent runs and support time. The name mismatch is a smaller edge case: a rejected save, or one credential silently replacing another.

Acceptance checks

  1. Choose one direction:

    • implement runtime delivery of project credentials, with a test that a task run on a named runtime receives a project credential; or
    • change projectSecrets.description, agentAccessTitle and agentAccessBody (en, de, fr, de-CH where needed) so they don't promise runtime use, and link to the Secrets grant path.

    The docs and the tab then say the same thing.

  2. Name rule: the Environment editor rejects _TOKEN and names over 64 characters before saving, and treats token/TOKEN as a duplicate. Or it upper-cases names as you type, matching the server. Covered by a jsdom test of the tab.

  3. Error message: a server SECRET_NAME_INVALID shows a localized message that states the rule, not a raw server text.

Limits

  • Static: source, catalogs and docs at main; the tab and a run weren't driven in a browser.
  • "No other caller": based on reading the two agent hosts and the project_secrets call sites; a dynamic lookup elsewhere would have to be ruled out by the owner.

Found by TALE-358 Review A (product and experience: UX-CLARITY, REL-MANUAL; critical cell projects.secrets), occurrence 2026-10-07 04:15 Europe/Zurich, run df3cb260-da54-4a59-a496-59f6b0db3d33. Builds on the #4463 author's note.

Activity

  1. yannickmonney commented on Oct 7, 2026

    @yannickmonney
    ContributorAuthor

    Post-merge recheck of #4469 at main 6eaa56999bb6528abe26666aa23bfcad607ef862 (TALE-358 Review A, run c5f148b5). Static source, catalogs and docs, plus executed CI.

    Acceptance check Result
    1. The tab doesn't promise runtime use (en, de, fr, de-CH where needed) Met in the tab. projectSecrets.description, agentAccessTitle and agentAccessBody now say the credentials are stored for the project and "not currently passed to agent runs", and point to the agent's Secrets grants (de/fr match; no ß, so no de-CH override is needed). The tab names the grants in text but doesn't link to them.
    1. "The docs and the tab then say the same thing" Not met. docs/{en,de,fr}/platform/projects/overview.md:58 still says "The tab describes credentials for task runtimes such as Hermes and OpenClaw". :54 still says the editor accepts ^[A-Za-z_][A-Za-z0-9_]*$ and only the server adds the stricter rule. Since #4469 the tab no longer mentions runtimes, and the editor itself applies the server rule. Routed to the open docs issue #4454.
    2. Name rule in the editor, jsdom test Met. projectSecretNameRule upper-cases names and applies ^[A-Z][A-Z0-9_]{0,63}$ with a field error, and duplicates are counted after normalizing, so token and TOKEN collide. Tests:
    • env-var-list-editor.test.tsx (17) covers _TOKEN, 65 characters, token/TOKEN and the 64-character boundary. It passed uncached in Checks 37590721696 at e011cc8f8 and was replayed from cache at 6eaa56999.
    • project-secrets-tab.test.tsx (15) adds the field error in en/de/fr/de-CH. It passed uncached in Checks 37592724382 (UI 4/4).
    3. Localized SECRET_NAME_INVALID Met. projectSecrets.errors.SECRET_NAME_INVALID in en/de/fr, plus a de-CH override; covered by the tab test in en/de/fr.

    Not checked: the tab in a browser.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions