> For the complete documentation index, see [llms.txt](https://docs.1kosmos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1kosmos.com/authentication/admin-portal/settings/managing-secrets.md).

# Managing Secrets

***

### Why use Secret Store

Previously, secrets were hardcoded in workflow JavaScript, which could expose them in the front end and database. With Secret Store:

* Secrets are stored securely in encrypted form
* Secrets are never exposed in the UI, database, or logs

### Create a secret

1. Log in to your tenant as a community administrator.
2. Navigate to **Settings > Secret Store**.
3. Click **Add new secret**.
4. Enter a **Name** (a unique identifier used in workflows) and a **Value** (the API key, password, token, etc.).
5. Click **Create**.

### Use secrets in workflows

Reference a secret inside workflow JavaScript using value substitution:

```
{{secrets.<secret_name>}}
```

For example:

```
const apiPassword = {{secrets.abc_api_key}};
```

At runtime, the system automatically replaces this with the actual secret value when executing the workflow.

### How secrets are protected

* **Write-only** — once created, the value can never be viewed again
* **Masked** in the UI
* **Never stored in plain text**
* **Not exposed in logs** — even if explicitly printed, values are obfuscated
* **Not directly accessible** by other users
* Only the **application runtime** can resolve and use secrets

{% hint style="info" %}
**Note:** Secrets can only be added or deleted — they cannot be edited or viewed after being added to the Secret Store.
{% endhint %}


---

# 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.1kosmos.com/authentication/admin-portal/settings/managing-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.
