> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/cli/reference/secret-references.md).

# Secret reference syntax

The devo:// reference syntax: named and canonical forms, sections, attributes, encoding, SecretSpec provider URIs, and how references are found in text.

A secret reference is the address of one field of an entry. It starts with `devo://` and says where the secret is, never what it is. Every `devo secret` command, launch manifests, `.env` files and templates use the same syntax.

To get the reference of a field without typing it, run `devo entry references <entry>`. See [Find the reference to a secret](/cli/guides/secrets/find-a-reference.md).

## Named references

A named reference uses the names of the workspace, the vault, and the entry, so it's easy to read:

```
devo://<workspace>/<vault>/<entry>/<field>
devo://<workspace>/<vault>/<entry>/<section>/<field>
```

<table><thead><tr><th width="190">SEGMENT</th><th>WHAT IT IS</th></tr></thead><tbody><tr><td><code>&#x3C;workspace></code></td><td>The workspace that holds the vault.</td></tr><tr><td><code>&#x3C;vault></code></td><td>The vault that holds the entry.</td></tr><tr><td><code>&#x3C;entry></code></td><td>The entry that holds the field.</td></tr><tr><td><code>&#x3C;section></code></td><td>Optional, local profile only. The section of the entry that holds the field, when the field is in a section. Devolutions Cloud and Devolutions Server refuse a section with <code>unsupportedSecretField</code>.</td></tr><tr><td><code>&#x3C;field></code></td><td>The field to read, such as <code>password</code>, <code>username</code>, <code>domain</code>, <code>host</code>, <code>otp</code>, or <code>privatekey</code>.</td></tr></tbody></table>

A named reference is resolved in the workspace selected for the command: the current context, or the one you choose with `--context` or `--source`. See [Global options](/cli/reference/global-options.md).

## Canonical references

A canonical reference uses IDs instead of names:

```
devo://ws/<workspace-id>/vault/<vault-id>/entry/<entry-id>/field/<field>
```

* It keeps working when the entry, the vault, or the workspace is renamed.
* It names the workspace that owns it, so it's resolved in that workspace whatever the current context is. One `devo secret run` can mix references from a local profile, Devolutions Cloud, and Devolutions Server.
* It has no section segment.
* On Devolutions Server, `devo entry references` lists canonical references only. A named reference that you write yourself still works.

## Attributes

By default, a reference returns the value of the field. Add `?attribute=` (or the short form `?attr=`) to read information about the field instead of its value. Values aren't case-sensitive.

<table><thead><tr><th width="190">ATTRIBUTE</th><th>WHAT IT RETURNS</th><th width="150">SECRET</th></tr></thead><tbody><tr><td><code>value</code></td><td>The value of the field. This is the default, and the only attribute that returns a secret.</td><td>Yes</td></tr><tr><td><code>type</code></td><td>The kind of field.</td><td>No</td></tr><tr><td><code>id</code></td><td>The ID of the entry.</td><td>No</td></tr><tr><td><code>title</code></td><td>The name of the entry. Empty for a canonical reference on Devolutions Cloud and Devolutions Server.</td><td>No</td></tr><tr><td><code>purpose</code></td><td>Why the value was requested: <code>read</code>, <code>inject</code>, <code>run</code>, or <code>mcp</code>. Empty on a local profile.</td><td>No</td></tr></tbody></table>

`type`, `id`, `title`, and `purpose` return information only, never the secret, on every workspace type.

For example, `devo://<workspace>/<vault>/<entry>/password?attribute=type` returns the kind of the `password` field, not the password. `devo secret read` and `devo secret get` also accept `--attribute` instead of the query.

## Special characters

Each segment between two `/` is URL-decoded. If a name contains `/`, `?`, `#`, `%`, or a space, encode it: for example, write `Web%2FProd` for an entry named `Web/Prod`, and `My%20vault` for `My vault`. A `:` can stay as is.

References that Devolutions CLI prints, for example with `devo entry references`, are already encoded.

## Rules and errors

When a reference can't be read, the command fails with the error code `invalidSecretReference` and one of these messages.

<table><thead><tr><th width="320">MESSAGE</th><th>WHAT TO CHECK</th></tr></thead><tbody><tr><td>"Secret reference cannot be empty."</td><td>The reference is empty or only spaces.</td></tr><tr><td>"Secret reference must start with 'devo://'."</td><td>The prefix is missing or misspelled. The prefix isn't case-sensitive.</td></tr><tr><td>"Secret references do not support URI fragments."</td><td>The reference contains <code>#</code>. Encode it as <code>%23</code> if it's part of a name.</td></tr><tr><td>"Secret reference path cannot be empty."</td><td>Nothing follows <code>devo://</code>.</td></tr><tr><td>"Use devo://&#x3C;workspace>/&#x3C;vault>/&#x3C;entry>/&#x3C;field> or devo://&#x3C;workspace>/&#x3C;vault>/&#x3C;entry>/&#x3C;section>/&#x3C;field>."</td><td>A named reference needs 4 or 5 segments. Check for a missing segment or an unencoded <code>/</code> in a name.</td></tr><tr><td>"Secret reference path segments cannot be empty."</td><td>Two <code>/</code> follow each other, or the reference ends with <code>/</code>.</td></tr><tr><td>"Canonical ID references must use devo://ws/&#x3C;id>/vault/&#x3C;id>/entry/&#x3C;id>/field/&#x3C;field>."</td><td>A reference that starts with <code>ws</code> and has 8 segments must use the words <code>vault</code>, <code>entry</code>, and <code>field</code> in that order.</td></tr><tr><td>"Canonical workspace, vault, and entry identifiers cannot be empty."</td><td>An ID is missing in a canonical reference.</td></tr><tr><td>"Canonical field segment cannot be empty."</td><td>The field is missing at the end of a canonical reference.</td></tr></tbody></table>

An unknown attribute fails with the code `unsupportedSecretAttribute` and the message "Unsupported secret reference attribute '\<value>'." Other query parameters are ignored.

When the reference is valid but doesn't lead to a field you can read, see [A secret reference doesn't resolve](/cli/help/troubleshooting/reference-does-not-resolve.md).

## References inside a text

`devo secret inject` finds the references in a template and replaces each one with its value. It recognizes two forms:

<table><thead><tr><th width="250">FORM</th><th>WHERE IT ENDS</th></tr></thead><tbody><tr><td><code>{{ devo://… }}</code></td><td>At the closing <code>}}</code>. The braces are replaced too, and spaces inside them are ignored. Use this form when the reference is next to other text.</td></tr><tr><td><code>devo://…</code></td><td>At the first space, line break, <code>"</code>, <code>'</code>, <code>&#x3C;</code>, <code>></code>, <code>)</code>, <code>]</code>, or <code>}</code>.</td></tr></tbody></table>

Text that starts with `devo://` but isn't a valid reference is left as is.

In a template, a reference can also contain environment variables, which `devo secret inject` replaces before it reads the secret:

<table><thead><tr><th width="250">EXPRESSION</th><th>WHAT IT BECOMES</th></tr></thead><tbody><tr><td><code>$NAME</code> or <code>${NAME}</code></td><td>The value of the environment variable <code>NAME</code>. If it's not set or empty, the command fails with <code>missingSecretReferenceVariable</code>.</td></tr><tr><td><code>${NAME:-default}</code></td><td>The value of <code>NAME</code>, or <code>default</code> when it's not set or empty.</td></tr></tbody></table>

For example, `{{ devo://<workspace>/${VAULT:-Staging}/<entry>/password }}` reads from the vault named in `VAULT`, or from `Staging`.

{% hint style="warning" %}
`devo secret inject` writes the values in plain text to its output. See [Fill a configuration file from a template](/cli/guides/secrets/fill-a-template.md).
{% endhint %}

## SecretSpec provider URIs

SecretSpec doesn't use secret references. In `secretspec.toml`, it uses a provider URI that tells it which workspace Devolutions CLI should read. Print the right one with `devo secretspec uri`. See [Use Devolutions CLI with SecretSpec](/cli/guides/secrets/secretspec.md).

<table><thead><tr><th width="330">PROVIDER URI</th><th>WORKSPACE</th></tr></thead><tbody><tr><td><code>devo://cloud[/&#x3C;vault-id>][?context=&#x3C;name>]</code></td><td>Devolutions Cloud, through the context <code>&#x3C;name></code>, or the current Devolutions Cloud context without <code>?context=</code>.</td></tr><tr><td><code>devo://server[/&#x3C;vault-id>][?context=&#x3C;name>]</code></td><td>Devolutions Server, through the context <code>&#x3C;name></code>, or the current Devolutions Server context without <code>?context=</code>.</td></tr><tr><td><code>devo://sqlite[/&#x3C;vault-id>]?workspace=&#x3C;workspace-id></code></td><td>A local Devolutions Remote Desktop Manager workspace. <code>?workspace=</code> is required, with a workspace ID such as <code>sqlite:Connections.db</code>. <code>devo workspace current</code> shows it.</td></tr></tbody></table>

`<vault-id>` is optional: it sets the default vault, and each secret can still name its own vault.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/cli/reference/secret-references.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
