Repository navigation
Description
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
- The agent's Credentials page showed "All required credentials are set", each of the three keys with a SET label.
- A run asked the agent to test its connections. It read the keys from its environment (
printenv), called the service, and the call worked. - Twelve minutes later a person ran the agent's playbook from its chat. The agent called
mcp__trinity__fetch_credentialonce per key name. Each call came back as not granted. - 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.
- Create an agent whose
template.yamldeclares a required key undercredentials.env_file, with a playbook that says only "needs the key X" and uses it. - Set X on the agent's Credentials page.
- Run the playbook from the agent's chat several times.
- Look at the tool calls of each run: some read the environment, some call
fetch_credentialand then report the key as missing.
Environment
- Version/commit:
devatbaadc4a2a(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_credentialsandfetch_credential(src/mcp-server/src/tools/credential_vault.ts). To an agent whose playbook says "needs the key X", a tool namedfetch_credentialreads 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
.envto look. So when the vault answers "not granted", nothing points it back to its environment.
Suggestions:
- 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.
- Or one line in the platform prompt saying where an agent's own keys are.
- When
fetch_credentialreturns 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