|
| 1 | +--- |
| 2 | +icon: key |
| 3 | +--- |
| 4 | + |
| 5 | +# Organization Secrets |
| 6 | + |
| 7 | +**Organization Secrets** are encrypted key-value pairs defined once for an organization and shared with the apps that need them. A shared credential — a warehouse password, a model provider API key — is stored in one place instead of being copied into every app that uses it. |
| 8 | + |
| 9 | +An organization secret reaches an app only after it is linked to that app. Storing a secret at the organization level does not expose it to every app in the organization. |
| 10 | + |
| 11 | +Once a secret is saved, its value cannot be read back through Spice Cloud. The portal lists only the secret name and when it was created or last updated. |
| 12 | + |
| 13 | +### Access by role |
| 14 | + |
| 15 | +The **Secrets** section is available to organization owners, admins, and members. Viewers cannot view or manage secrets, and the section is hidden from them. |
| 16 | + |
| 17 | +| Role | Organization secrets | |
| 18 | +| ------ | ------------------------------- | |
| 19 | +| Owner | Create, update, delete | |
| 20 | +| Admin | Create, update, delete | |
| 21 | +| Member | Create, update, delete | |
| 22 | +| Viewer | No access | |
| 23 | + |
| 24 | +Roles are assigned per organization member. [Learn more about organizations.](organizations.md) |
| 25 | + |
| 26 | +### Create an organization secret |
| 27 | + |
| 28 | +1. Select the organization from the application selector. |
| 29 | +2. Navigate to the **Settings** tab and select the **Secrets** section. |
| 30 | +3. Fill the **Name** and **Value** fields and click **Add**. |
| 31 | + |
| 32 | +Secret names must start with a letter or an underscore and may contain only letters, numbers, and underscores, for example `GITHUB_TOKEN`. |
| 33 | + |
| 34 | +### Update or delete a secret |
| 35 | + |
| 36 | +Editing a secret replaces its value. The name cannot be changed — to rename a secret, create a new one and delete the old one. |
| 37 | + |
| 38 | +Deleting a secret requires confirmation, and removes it from every app it is linked to. |
| 39 | + |
| 40 | +### Link a secret to an app |
| 41 | + |
| 42 | +1. Select the app. |
| 43 | +2. Navigate to the **Settings** tab and select the **Secrets** section. |
| 44 | +3. Under **Linked Organization Secrets**, select each secret the app should receive. |
| 45 | +4. Click **Save linked secrets**. |
| 46 | + |
| 47 | +Linked secrets are referenced in the Spicepod configuration exactly like app secrets, as `${secrets:<SECRET_NAME>}`: |
| 48 | + |
| 49 | +```yaml |
| 50 | +models: |
| 51 | + - from: openai:gpt-4o |
| 52 | + name: gpt-4o |
| 53 | + params: |
| 54 | + openai_api_key: ${secrets:OPENAI_API_KEY} |
| 55 | +``` |
| 56 | +
|
| 57 | +{% hint style="info" %} |
| 58 | +When an app secret and a linked organization secret have the same name, the app secret takes precedence at runtime. |
| 59 | +{% endhint %} |
| 60 | +
|
| 61 | +To apply a change to linked secrets, initiate a new Spicepod deployment. [Learn more about deployments.](app-spicepod/deployments.md) |
0 commit comments