> For the complete documentation index, see [llms.txt](https://docs.apolo.us/index/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apolo.us/index/apolo-cli/topics/topic-secrets.md).

# Using secrets

A *secret* is a piece of encrypted named data stored in the Apolo Platform Cluster.

Users can create secrets, list available secret names, and delete unused secrets. However, reading the secret's data back is impossible. Instead of plain reading, secrets can be accessed from a running job as an environment variable or a mounted file.

Secrets are isolated and user-specific - a secret that belongs to user A cannot be accessed by user B.

## Managing secrets

Use the `apolo secret` command group to manage secrets.

`apolo secret ls` prints all available secret names.

`apolo secret add key value` creates a secret named *key* with encrypted data *value*.

To store a file's content as a secret, use the `apolo secret add KEY_NAME @path/to/file.txt` notation.

`apolo secret rm key` removes the secret named *key*.

Internally, the Apolo Platform uses the Kubernetes Cluster secrets subsystem to store secrets.

## Using secrets

As said above, you can't read a secret directly, but instead should pass it to a running job as an environment variable or a mounted file.

To pass a secret named *key* as an environment variable, use `secret:key` as a value for `--env`. For example, `apolo run --env VAR=secret:key ...`.

To mount a secret as a file, use the `secret:` scheme of `--volume`. For example, `apolo run --volume secret:key:/mount/path/file.txt`.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apolo.us/index/apolo-cli/topics/topic-secrets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
