Skip to content

Agent reports its own keys as missing: it asks the credential vault instead of reading its environment #4474

Open

Description

@romainability

Bug Description

An agent whose required keys are set on its own Credentials page (and are in its ~/.env) told the person the keys were not set up. It had looked for them with the credential vault tool fetch_credential, where nothing is granted to it, and not in its own environment. Seen once, on one agent, on a local test instance. The same agent had used the same keys successfully twelve minutes earlier, with nothing changed in between. Filed as a possible bug or feedback, to verify.

Observed Behavior

  1. The agent's Credentials page showed "All required credentials are set", each of the three keys with a SET label.
  2. A run asked the agent to test its connections. It read the keys from its environment (printenv), called the service, and the call worked.
  3. Twelve minutes later a person ran the agent's playbook from its chat. The agent called mcp__trinity__fetch_credential once per key name. Each call came back as not granted.
  4. The agent replied that the credentials "are not set up yet" and that none of them "were found in Trinity's vault", then gave steps to add keys that were already there.

Expected Behavior

An agent whose keys are set on its own Credentials page uses them, or at least never tells the person they are missing.

Steps to Reproduce

Not yet tried on a clean instance.

  1. Create an agent whose template.yaml declares a required key under credentials.env_file, with a playbook that says only "needs the key X" and uses it.
  2. Set X on the agent's Credentials page.
  3. Run the playbook from the agent's chat several times.
  4. Look at the tool calls of each run: some read the environment, some call fetch_credential and then report the key as missing.

Environment

  • Version/commit: dev at baadc4a2a (31 Oct 2026)
  • Deployment type: docker-compose, local test instance
  • Agent runtime: Claude Code, agent's default model

Error Output

The credentials are not set up yet: none of KEY_ONE, KEY_TWO or KEY_THREE were found in Trinity's vault.
To get this working, you'll need to add those three credentials to your Trinity agent's vault.

(Key names replaced with placeholders. No error was raised: the run ended as a success.)

Additional Context

Why it seems to happen:

  • Every agent is offered list_available_credentials and fetch_credential (src/mcp-server/src/tools/credential_vault.ts). To an agent whose playbook says "needs the key X", a tool named fetch_credential reads as the place to get X.
  • Neither tool's description says that keys set on the agent's own Credentials page are not in the vault and are already in its environment.
  • The platform prompt does not seem to tell an agent where its own keys are, and the guardrails stop it opening .env to look. So when the vault answers "not granted", nothing points it back to its environment.

Suggestions:

  1. One sentence in the descriptions of both vault tools: keys set on this agent's own Credentials page are environment variables in its container and are not listed or fetched here.
  2. Or one line in the platform prompt saying where an agent's own keys are.
  3. When fetch_credential returns not granted for a name that is set in the agent's own environment, say so in the result.

Not checked:

  • Whether this happens on a release build, or only on dev.
  • How often: this is one occurrence.
  • Whether the vault tools are meant to be offered to an agent with nothing granted.

Workaround in use: the playbook now says "Your keys are environment variables in your own container. Read one as $NAME, never with fetch_credential." With that line the next run read the keys and worked.

Activity

  1. added
    bug
    type-bug
    on Nov 11, 2026
  2. added
    priority-p3
    theme-devex
    complexity-medium
    status-ready
    on Nov 18, 2026
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

    bugcomplexity-mediumpriority-p3status-readytheme-devextype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions