For the complete documentation index, see llms.txt. This page is also available as Markdown.

Give an agent a credential without exposing it

An agent that reads a password puts it in its context: the value can end up in the transcript, in logs, or in a later answer. With Devolutions CLI, the agent never needs the value. It works with devo:// references, which say where a secret is and open nothing on their own, and it starts its tools through devo secret run, which hands the values to that tool only.

Before you start

  • Devolutions CLI is installed on the computer where the agent runs commands, and you're signed in. The agent uses your current context. See Quick start.

  • The agent can run shell commands, for example a coding agent working in your terminal.

How it works

  1. The agent asks Devolutions CLI for the references of an entry. The answer contains no secret value.

  2. The agent writes a command that maps each reference to an environment variable, and runs it through devo secret run.

  3. Devolutions CLI reads the values from your vault, starts the tool with those variables, and replaces every resolved value with <concealed by Devolutions> in what the tool prints. The agent sees the tool's output, never the secret.

Let the agent find references

Two commands list the references of an entry without returning any value. They return the same data, so use whichever reads better in your instructions. Only the command value of the JSON envelope differs: secret.catalog.entry or entry.references.

devo secret catalog entry "<entry-name>" --vault-name "<vault-name>" --json
devo entry references "<entry-name>" --vault-name "<vault-name>" --json

With --json, each item in data.references has a field (such as password) and a reference to copy. See Find the reference to a secret.

You can also find the references yourself and put them in the agent's instructions or in a .env file. References are safe to share: they contain names or IDs, not values.

Let the agent launch tools

The agent passes each reference with --env-ref NAME=<reference>. Everything after -- is the tool to run:

A few things the agent needs to know, because Devolutions CLI enforces them:

  • References go in --env-ref, never in the command's arguments. Devolutions CLI refuses a reference written after -- with the error secretLaunchArgumentReference.

  • For several secrets, repeat --env-ref, or use --env-file with a .env file that holds references. See Take the passwords out of a .env file.

  • To test without reading any secret, add --check. Devolutions CLI checks that the command exists and that every reference is well formed, without resolving a value or starting the tool. It doesn't prove each field can be read.

  • To stop a tool that hangs, add --timeout-seconds <seconds>.

Write the agent's instructions

Put rules like these in the agent's instruction file (for example the project's agent instructions or CLAUDE.md), and adapt the names to your project:

Why not devo secret read?

devo secret read and devo secret get print the value. Whatever an agent prints ends up in its context, so the secret becomes part of the conversation. devo secret inject also hands over the value: it writes the filled text to standard output, or to a file with --out-file. On standard output, the value lands directly in the agent's context; in a file, the agent can open it. devo secret shell enter puts the value in the agent's shell. devo secret run is the only command that gives the value to a program without showing it to whoever started it.

Good to know

  • devo secret run returns the exit code of the tool it started, so the agent can tell whether its command succeeded.

  • A reference that doesn't resolve stops the launch before the tool starts. See A secret reference doesn't resolve.

  • If the agent works on another workspace than your current one, it can add --context <context-name> to any devo command. See Switch between workspaces.

Next

Last updated

Was this helpful?