> ## Documentation Index
> Fetch the complete documentation index at: https://docs.westyx.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a secret

> Store an encrypted secret in your service.

Secrets are encrypted at rest with AES-256-GCM and never appear in logs. They are versioned - every value change creates a new version, and old versions can be restored at any time.

Secrets are only available on **backend** services. Frontend services use public keys and run in untrusted environments - secret values are never sent to the browser.

## Steps

<Steps>
  <Step title="Open your service">
    Navigate to your project, click on your backend service, and select the **Secrets** tab.

    <img className="block dark:hidden" src="https://mintcdn.com/westyx/avHfSWIyYrdhYbru/images/how-to/create-secret/light-secrets.png?fit=max&auto=format&n=avHfSWIyYrdhYbru&q=85&s=30a3f6f7d0b234f33f87b1d88df33a5e" alt="Secrets list" style={{ borderRadius: '8px', margin: '1rem 0' }} width="1091" height="808" data-path="images/how-to/create-secret/light-secrets.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/westyx/avHfSWIyYrdhYbru/images/how-to/create-secret/dark-secrets.png?fit=max&auto=format&n=avHfSWIyYrdhYbru&q=85&s=b0c4eb69fd882127cc7c77c78b900032" alt="Secrets list" style={{ borderRadius: '8px', margin: '1rem 0' }} width="1091" height="808" data-path="images/how-to/create-secret/dark-secrets.png" />
  </Step>

  <Step title="Create a new secret">
    Click **+ New Secret**. An inline form appears at the top of the list.

    <img className="block dark:hidden" src="https://mintcdn.com/westyx/avHfSWIyYrdhYbru/images/how-to/create-secret/light-new-secret.png?fit=max&auto=format&n=avHfSWIyYrdhYbru&q=85&s=d3ea37ac97efcf9d16ef87f7c8158e2e" alt="New secret form" style={{ borderRadius: '8px', margin: '1rem 0' }} width="1091" height="808" data-path="images/how-to/create-secret/light-new-secret.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/westyx/avHfSWIyYrdhYbru/images/how-to/create-secret/dark-new-secret.png?fit=max&auto=format&n=avHfSWIyYrdhYbru&q=85&s=0adb0fa1a0d45b9aa4dd3f35abe6369a" alt="New secret form" style={{ borderRadius: '8px', margin: '1rem 0' }} width="1091" height="808" data-path="images/how-to/create-secret/dark-new-secret.png" />

    Fill in the fields:

    | Field           | Description                                                                  |
    | --------------- | ---------------------------------------------------------------------------- |
    | **Key**         | Identifier used to read the secret in your code (e.g. `database_password`)   |
    | **Value**       | The secret value - masked by default, reveal with the eye icon               |
    | **Type**        | `text` for strings and passwords, `file` for certificates and binary content |
    | **Description** | Optional note on this version (e.g. "Rotated after Q2 audit")                |

    Click **Create**.
  </Step>

  <Step title="Secret is created">
    The secret appears in the list with its type, current version (`v1`), and source.

    Click the **edit icon** (✏️) to expand the detail view, where you can reveal the value, rename the key, add new versions, or restore a previous one.

    <img className="block dark:hidden" src="https://mintcdn.com/westyx/avHfSWIyYrdhYbru/images/how-to/create-secret/light-edit-secret.png?fit=max&auto=format&n=avHfSWIyYrdhYbru&q=85&s=f1433b75f1640b05b1f3033bfe5670f9" alt="Secret detail view" style={{ borderRadius: '8px', margin: '1rem 0' }} width="1091" height="808" data-path="images/how-to/create-secret/light-edit-secret.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/westyx/avHfSWIyYrdhYbru/images/how-to/create-secret/dark-edit-secret.png?fit=max&auto=format&n=avHfSWIyYrdhYbru&q=85&s=ae143159136634c505c599d3aa10fdd1" alt="Secret detail view" style={{ borderRadius: '8px', margin: '1rem 0' }} width="1091" height="808" data-path="images/how-to/create-secret/dark-edit-secret.png" />
  </Step>
</Steps>

## Versioning

Every value change creates a new version. The latest version is marked **ACTIVE** and is what the SDK reads. Older versions remain available - click ↑ on any previous version to restore it (this creates a new version with the old value, keeping the full history intact).

## Inherited secrets

Secrets marked **INHERITED** come from a linked [umbrella service](/concepts/glossary#umbrella-service). To change the value for all linked services, click the edit icon and use the **Open umbrella** button to navigate there directly.

If you need a different value on this service only, create a new secret with the same key - it will take precedence over the inherited one.

## Next steps

<CardGroup cols={2}>
  <Card title="Create a config" icon="sliders" href="/how-to/create-config">
    Add a typed configuration value to your service.
  </Card>

  <Card title="Create a feature flag" icon="toggle-on" href="/how-to/create-flag">
    Roll out features gradually with targeting rules.
  </Card>

  <Card title="Secrets reference" icon="book" href="/features/secrets">
    Full reference: audit trail, file secrets, retention.
  </Card>
</CardGroup>
