Secrets
Secrets don’t go in config.yaml. It refers to them, so you can share or commit the file.
Four ways to refer to a secret
Section titled “Four ways to refer to a secret”In config.yaml | Where the value comes from |
|---|---|
${NAME} | The environment variable NAME. |
${NAME}, with NAME_FILE set | The file NAME_FILE points at. This is the Docker convention. |
${secret:name} | The file /run/secrets/name, for Docker and Kubernetes secrets. |
${file:/path} | Any file. |
Names are capitals, digits and underscores. File values have their surrounding whitespace trimmed. The environment wins over NAME_FILE.
integrations: downloads: type: qbittorrent url: http://qbittorrent:8080 username: ${QBIT_USER} password: ${secret:qbit_password}A ${NAME} that isn’t set, or a file that can’t be read, stops the config from loading with an error that names it. Write \${NAME} for a literal ${NAME}.
This works anywhere in the file, not only for keys. An .env file holds the values when you use env_file in Compose. Keep it private with chmod 600 .env.
The redactor
Section titled “The redactor”Services sometimes echo a key back, in an error message or a URL. So every value a ${...} stood for goes on a list, and that list is cut out of what leaves the server. It becomes •••.
It runs over:
- Widget errors and live updates.
- Action results and errors.
- Assistant tool results, before the model sees them.
- MCP results.
- The activity log, before it’s written.
- The approval card’s words.
- Your own CSS, when it’s served, and
config print.
Plain ${NAME} values whose name contains USER, LOGIN, URL, HOST, PORT or ADDR aren’t on the list. They aren’t secrets, and blanking one mangles real text: sam inside samantha. The file forms always count.
Its limits
Section titled “Its limits”- It only knows values that came through
${...}. A key typed straight intoconfig.yamlisn’t redacted. That’s one more reason not to. - Values under 4 characters are skipped. Values under 8 match only as whole words, so a short password doesn’t punch holes in ordinary text.
- It matches the value exactly. If a service base64-encodes or truncates your key, the result won’t match.
- Other sensitive things in a document or log, such as a name or an address, aren’t secrets to Valet, and pass through.
Who can see what
Section titled “Who can see what”| The browser | The model | |
|---|---|---|
Keys in ${...} | Never | Never |
| Service URLs | In a card’s link, if you set href, or the url by default | If a tool returns them |
| Card data | Yes | What the tools return |
A card’s title links to href, or to url when there’s no href. So set href when the address Valet uses is internal and you’d like the link to go elsewhere.
Checking your file
Section titled “Checking your file”docker exec valet node dist/server.js config printconfig print shows what Valet made of your config, with secrets redacted. config check names every problem. See the plugin tools for the rest of the commands.