# Secrets

Store an API key once, and let the key vault add it to HTTPS requests for one host, so your VM never holds the key.

Source: https://slashinfra.com/docs/platform/secrets
Last modified: 2026-11-30T16:36:19.000Z

A secret is a write-only value, such as an API key. Your VM sends requests without the key, and the key vault adds it only to requests for the exact host in your rule.

Figure: Your key never enters the VM: the key vault adds it only to requests for the host in your rule.

## Create a secret

The vault encrypts the value and keeps it write-only. Every answer and the dashboard show the name, version and description, never the value. A name is unique in its project.

### Dashboard

- Open [Secrets](https://app.slashinfra.com/svms/secrets). 
- Select Create secret. 
- Enter `openai` in Name. 
- Enter your key in Value. 
- Enter `Team OpenAI key` in Description. 
- Select Create secret.

### CLI

Your key is in the shell variable `$OPENAI_API_KEY`. The value comes from standard input, so it stays out of your shell history.

```bash
printf '%s' "$OPENAI_API_KEY" | si org secret create openai --description 'Team OpenAI key'
```

Output

```text
openai
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/secrets" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\":\"openai\",\"value\":\"$OPENAI_API_KEY\",\"description\":\"Team OpenAI key\"}"
```

Output

```text
{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"Team OpenAI key","version":1,"created_ms":1795956268702,"updated_ms":1795956268702}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/secrets",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={
"name": "openai",
"value": os.environ["OPENAI_API_KEY"],
"description": "Team OpenAI key",
},
)
res.raise_for_status()
print(res.json()["id"])
```

Output

```text
sec_6f1c0f0e8a
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/secrets', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'openai',
value: process.env.OPENAI_API_KEY!,
description: 'Team OpenAI key',
}),
})
if (!res.ok) throw new Error(await res.text())
const secret = (await res.json()) as { id: string }
console.log(secret.id)
```

Output

```text
sec_6f1c0f0e8a
```

A secret belongs to the project in its create body, `default` when omitted. A VM or profile can reference only a secret of its own project.

## Use a secret in a VM

A rule is saved with the VM. It names one exact HTTPS host and one of a header or a placeholder, plus the secret. The value reaches only the nodes that serve a VM with a rule for it. The `openai` preset fills the domain, header, prefix and format, so you choose only the secret.

A rule names the secret by `secret_id`, the `id` in the create answer. The samples use `sec_6f1c0f0e8a`; use the id of your own secret.

### Dashboard

- Open [SVMs](https://app.slashinfra.com/svms). 
- Select Create SVM. 
- Enter `worker` in Name. 
- Select Create SVM. 
- Select `worker` in the table to open it. 
- Select the Security tab. 
- Select Use a secret under Secrets. 
- Choose `openai` in Secret. 
- Choose OpenAI in Service. 
- Select Add secret. 
- Open [SVMs](https://app.slashinfra.com/svms), select Open terminal on `worker`, and run:

```bash
curl -sS -o /dev/null -w '%{http_code}\n' https://api.openai.com/v1/models
```

Output

```text
401
```

OpenAI answers 401 because the test value is not a working key. The request carried it, and the VM never held it.

### CLI

```bash
si create --name worker --inject openai:openai
si exec worker -- curl -sS -o /dev/null -w '%{http_code}\n' https://api.openai.com/v1/models
```

Output

```text
6f1c0f0e8a
401
```

The second command sends no key. The key vault adds it as `Bearer ` in the `authorization` header on requests to `api.openai.com`. Requests to any other host leave without it.

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/svms" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"worker","secret_injections":[{"domain":"api.openai.com","header":"authorization","secret_id":"sec_6f1c0f0e8a","value_prefix":"Bearer ","value_format":"raw"}]}'
```

Output

```text
{"id":"6f1c0f0e8a","project":"proj_6f1c0f0e8a","url":"https://6f1c0f0e8a.slashinfra.dev/bin/bash","region":"eu-gra","expires_at":null,"generation":1,"labels":{}}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/svms",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={
"name": "worker",
"secret_injections": [
{
"domain": "api.openai.com",
"header": "authorization",
"secret_id": "sec_6f1c0f0e8a",
"value_prefix": "Bearer ",
"value_format": "raw",
}
],
},
)
res.raise_for_status()
print(res.json()["id"])
```

Output

```text
6f1c0f0e8a
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/svms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'worker',
secret_injections: [
{
domain: 'api.openai.com',
header: 'authorization',
secret_id: 'sec_6f1c0f0e8a',
value_prefix: 'Bearer ',
value_format: 'raw',
},
],
}),
})
if (!res.ok) throw new Error(await res.text())
const svm = (await res.json()) as { id: string }
console.log(svm.id)
```

Output

```text
6f1c0f0e8a
```

Keep a credential in a secret, not in `env`. A command in the VM can print its environment variables.

## List the secret injection presets

The catalog gives the exact domain, header, prefix and format for common providers, and each `id` is the value that `--inject` takes. It is not a destination allowlist, and a later edit to a preset never changes an existing VM. The dashboard shows the same catalog under Service in the Use a secret sheet.

### curl

```bash
curl -sS "https://api.slashinfra.com/secret-injection-presets" \
-H "Authorization: Bearer $SI_API_KEY" | python3 -m json.tool
```

Output

```text
[
{
"id": "openai",
"service": "OpenAI",
"rules": [
{
"domain": "api.openai.com",
"header": "authorization",
"value_prefix": "Bearer ",
"value_format": "raw"
}
]
},
...
]
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/secret-injection-presets",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
for preset in res.json():
print(preset["id"], preset["service"])
```

Output

```text
openai OpenAI
anthropic Anthropic
gemini Google Gemini
openrouter OpenRouter
stripe Stripe
github GitHub
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/secret-injection-presets', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const presets = (await res.json()) as { id: string; service: string }[]
for (const preset of presets) console.log(preset.id, preset.service)
```

Output

```text
openai OpenAI
anthropic Anthropic
gemini Google Gemini
openrouter OpenRouter
stripe Stripe
github GitHub
```

## Write a custom rule

For a service without a preset, name the domain, header, prefix and format yourself. Slack uses `slack.com`, the `authorization` header and the `Bearer ` prefix. Create the secret with your Slack token first, on [Secrets](https://app.slashinfra.com/svms/secrets) with Create secret or with the command below.

```bash
printf '%s' "$SLACK_TOKEN" | si org secret create slack --description 'Team Slack token'
```

Output

```text
slack
```

The API samples use `sec_7a2b3c4d5e`; use the id of your `slack` secret.

### Dashboard

- Open [SVMs](https://app.slashinfra.com/svms). 
- Select Create SVM. 
- Enter `slack-worker` in Name. 
- Select Create SVM. 
- Select `slack-worker` in the table to open it. 
- Select the Security tab. 
- Select Use a secret under Secrets. 
- Choose `slack` in Secret. 
- Choose Custom in Service. 
- Enter `slack.com` in Host. 
- Choose Bearer token header in Send as. 
- Select Add secret. 
- Open [SVMs](https://app.slashinfra.com/svms), select Open terminal on `slack-worker`, and run:

```bash
curl -sS https://slack.com/api/auth.test
```

Output

```text
{"ok":false,"error":"invalid_auth"}
```

Slack answers `invalid_auth` because the test value is not a working token. The request carried it.

### CLI

```bash
si create --name slack-worker --inject-rule 'slack.com:authorization:slack:Bearer '
si exec slack-worker -- curl -sS https://slack.com/api/auth.test
```

Output

```text
6f1c0f0e8a
{"ok":false,"error":"invalid_auth"}
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/svms" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"slack-worker","secret_injections":[{"domain":"slack.com","header":"authorization","secret_id":"sec_7a2b3c4d5e","value_prefix":"Bearer ","value_format":"raw"}]}'
```

Output

```text
{"id":"6f1c0f0e8a","project":"proj_6f1c0f0e8a","url":"https://6f1c0f0e8a.slashinfra.dev/bin/bash","region":"eu-gra","expires_at":null,"generation":1,"labels":{}}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/svms",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={
"name": "slack-worker",
"secret_injections": [
{
"domain": "slack.com",
"header": "authorization",
"secret_id": "sec_7a2b3c4d5e",
"value_prefix": "Bearer ",
"value_format": "raw",
}
],
},
)
res.raise_for_status()
print(res.json()["id"])
```

Output

```text
6f1c0f0e8a
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/svms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'slack-worker',
secret_injections: [
{
domain: 'slack.com',
header: 'authorization',
secret_id: 'sec_7a2b3c4d5e',
value_prefix: 'Bearer ',
value_format: 'raw',
},
],
}),
})
if (!res.ok) throw new Error(await res.text())
const svm = (await res.json()) as { id: string }
console.log(svm.id)
```

Output

```text
6f1c0f0e8a
```

The CLI has no flag for a placeholder or for a custom `basic_x_access_token` rule. Use the API for those; a preset can still add a `basic_x_access_token` rule.

## Save rules in a profile

A profile holds the same `secret_injections` list. A VM created with the profile copies the list at creation, and a later edit affects only new VMs. The CLI has no flag to add a rule to a profile, so use the dashboard or the API.

### Dashboard

- Open [Workload profiles](https://app.slashinfra.com/svms/profiles). 
- Select Create profile. 
- Enter `ai-workers` in Name. 
- Select Use a secret under Secrets. 
- Choose `openai` in Secret. 
- Choose OpenAI in Service. 
- Select Add secret. 
- Select Create profile.

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/profiles" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"ai-workers","secret_injections":[{"domain":"api.openai.com","header":"authorization","secret_id":"sec_6f1c0f0e8a","value_prefix":"Bearer ","value_format":"raw"}]}' \
| python3 -m json.tool
```

Output

```text
{
"id": "prof_6f1c0f0e8a",
"project": "proj_6f1c0f0e8a",
"name": "ai-workers",
"env": {},
"inbox": {
"enabled": false,
"allowed_senders": null
},
"egress": {
"filtering": false,
"allowed_domains": []
},
"secret_injections": [
{
"domain": "api.openai.com",
"header": "authorization",
"secret_id": "sec_6f1c0f0e8a",
"value_prefix": "Bearer ",
"value_format": "raw"
}
],
"sleep": null,
"readiness": null,
"concurrency": 64,
"created_ms": 1795956340438,
"updated_ms": 1795956340438
}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/profiles",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={
"name": "ai-workers",
"secret_injections": [
{
"domain": "api.openai.com",
"header": "authorization",
"secret_id": "sec_6f1c0f0e8a",
"value_prefix": "Bearer ",
"value_format": "raw",
}
],
},
)
res.raise_for_status()
print(res.json()["id"])
```

Output

```text
prof_6f1c0f0e8a
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/profiles', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'ai-workers',
secret_injections: [
{
domain: 'api.openai.com',
header: 'authorization',
secret_id: 'sec_6f1c0f0e8a',
value_prefix: 'Bearer ',
value_format: 'raw',
},
],
}),
})
if (!res.ok) throw new Error(await res.text())
const profile = (await res.json()) as { id: string }
console.log(profile.id)
```

Output

```text
prof_6f1c0f0e8a
```

## List secrets

List returns the metadata of every secret in one project, by name, with its version and description. The value is never part of an answer.

### Dashboard

- Open [Secrets](https://app.slashinfra.com/svms/secrets). 
- The table lists every secret of the project with Name, Version and Updated. A description appears under its name.

### CLI

```bash
si org secret ls
```

Output

```text
id              name    version  updated               description
sec_6f1c0f0e8a  openai  1        2026-11-29 12:44:28Z  Team OpenAI key
sec_7a2b3c4d5e  slack   1        2026-11-29 12:45:15Z  Team Slack token
```

### curl

```bash
curl -sS "https://api.slashinfra.com/secrets" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
[{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"Team OpenAI key","version":1,"created_ms":1795956268702,"updated_ms":1795956268702},{"id":"sec_7a2b3c4d5e","project":"proj_6f1c0f0e8a","name":"slack","description":"Team Slack token","version":1,"created_ms":1795956315033,"updated_ms":1795956315033}]
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/secrets",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
for secret in res.json():
print(secret["id"], secret["name"], secret["version"])
```

Output

```text
sec_6f1c0f0e8a openai 1
sec_7a2b3c4d5e slack 1
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/secrets', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const secrets = (await res.json()) as { id: string; name: string; version: number }[]
for (const secret of secrets) console.log(secret.id, secret.name, secret.version)
```

Output

```text
sec_6f1c0f0e8a openai 1
sec_7a2b3c4d5e slack 1
```

## Change the description

The description is a note for your team. A change to it keeps the value, the version and every rule. Empty text clears it. The audit row is `secret.update` and omits the text.

### Dashboard

- Open [Secrets](https://app.slashinfra.com/svms/secrets). 
- Select More actions on `openai`, then Edit description. 
- Enter `OpenAI key for agents` in Description. 
- Select Save.

### CLI

```bash
si org secret describe openai 'OpenAI key for agents'
```

Output

```text
openai
```

### curl

```bash
curl -sS -X PATCH "https://api.slashinfra.com/secrets/openai" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"description":"OpenAI key for agents"}'
```

Output

```text
{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"OpenAI key for agents","version":1,"created_ms":1795956268702,"updated_ms":1795956365810}
```

### Python

```python
import os, requests

res = requests.patch(
"https://api.slashinfra.com/secrets/openai",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"description": "OpenAI key for agents"},
)
res.raise_for_status()
print(res.json()["description"])
```

Output

```text
OpenAI key for agents
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/secrets/openai', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ description: 'OpenAI key for agents' }),
})
if (!res.ok) throw new Error(await res.text())
console.log(((await res.json()) as { description: string }).description)
```

Output

```text
OpenAI key for agents
```

## Replace the value

A replace stores the new value as the next version. Every node that serves a VM with a rule for the secret must cache it before the answer. If a node does not answer in time, the request returns 503 `secret_pending` and keeps the new version, so send the same request again. A node that misses the value stops injecting the old one.

### Dashboard

- Open [Secrets](https://app.slashinfra.com/svms/secrets). 
- Select the replace icon on the `openai` row, labelled Replace secret openai. 
- Enter the new key in Value. 
- Select Replace value.

### CLI

The new key is in `$OPENAI_API_KEY`.

```bash
printf '%s' "$OPENAI_API_KEY" | si org secret replace openai
```

Output

```text
openai
```

### curl

```bash
curl -sS -X PUT "https://api.slashinfra.com/secrets/openai" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d "{\"value\":\"$OPENAI_API_KEY\"}"
```

Output

```text
{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"OpenAI key for agents","version":2,"created_ms":1795956268702,"updated_ms":1795956380063}
```

### Python

```python
import os, requests

res = requests.put(
"https://api.slashinfra.com/secrets/openai",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"value": os.environ["OPENAI_API_KEY"]},
)
res.raise_for_status()
print(res.json()["version"])
```

Output

```text
2
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/secrets/openai', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ value: process.env.OPENAI_API_KEY! }),
})
if (!res.ok) throw new Error(await res.text())
console.log(((await res.json()) as { version: number }).version)
```

Output

```text
2
```

## Delete a secret

Delete removes the value and its metadata, and it cannot be undone. A secret that a VM or profile still references answers 409 `secret_in_use`, so remove the rules first. A rule that names a deleted secret can never be created.

### Dashboard

- Open [SVMs](https://app.slashinfra.com/svms). 
- Select More actions on `worker`, then Delete. 
- Select More actions on `slack-worker`, then Delete. 
- Open [Workload profiles](https://app.slashinfra.com/svms/profiles). 
- Select More actions on `ai-workers`, then Delete. 
- Open [Secrets](https://app.slashinfra.com/svms/secrets). 
- Select More actions on `openai`, then Delete. 
- Select More actions on `slack`, then Delete.

### CLI

```bash
si org secret rm openai
```

Output

```text
error: This secret is in use. (secret_in_use)
```

Delete the VMs and the profile that name it, then run it again.

```bash
si rm worker
si rm slack-worker
si org profile rm ai-workers
si org secret rm openai
si org secret rm slack
```

Output

```text
deleted 6f1c0f0e8a
deleted 6f1c0f0e8b
deleted profile ai-workers
deleted secret openai
deleted secret slack
```

### curl

After the VMs and the profile are gone:

```bash
curl -sS -i -X DELETE "https://api.slashinfra.com/secrets/openai" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
HTTP/2 204
...
```

### Python

```python
import os, requests

res = requests.delete(
"https://api.slashinfra.com/secrets/openai",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
print(res.status_code)
```

Output

```text
204
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/secrets/openai', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
console.log(res.status)
```

Output

```text
204
```

## Options

`--inject PRESET:SECRET` expands a preset into its rules. `--inject-rule DOMAIN:HEADER:SECRET[:PREFIX]` sends one raw rule. The `secret_injections` rows are the rule fields of [`POST /svms`](https://slashinfra.com/docs/api-reference/control/svms#postSvms) and of a profile.

| Field | Type | Default | Allowed values | What it changes |
| --- | --- | --- | --- | --- |   
| `name` (`<NAME>`) | string | Required | 1 to 32 lowercase letters, digits and hyphens, starting with a letter; unique in the project | The secret name. | 
| `value` (standard input) | string | Required | At least 1 character | The secret value. It is write-only and never returned. | 
| `project` (`--project`) | string | `default` | A project name, or its `proj_` id | The project that holds the secret. | 
| `description` (`--description`) | string or null | Empty | At most 200 code points, no control character; empty clears it | An optional note for your team, never the value. | 
| `ref` (`<SECRET>`) | string | Required | A name, or its `sec_` id; an id resolves in every project | The secret that describe, replace or delete acts on. | 
| `secret_injections` (`--inject`, `--inject-rule`) | array | Empty | An array of rules; a given list replaces the stored list whole | The HTTPS rules saved with the VM or profile. | 
| `secret_injections[].domain` | string | Required | One exact hostname; no wildcard | The HTTPS host that gets the value. | 
| `secret_injections[].secret_id` | string | Required | A `sec_` id, or `connection:<id>` | The secret or connection that the rule injects. The CLI flags take a secret name or id. | 
| `secret_injections[].header` | string | One of header or placeholder | A lowercase token, except `host`, `content-length`, `transfer-encoding`, `connection`, `upgrade`, `te`, `trailer`, `cookie` and `proxy-*` | The request header that carries the value. | 
| `secret_injections[].placeholder` | string | One of header or placeholder | `^__[A-Z0-9_]{8,60}__$` | A token in the path or query that the vault replaces. The CLI has no flag for it. | 
| `secret_injections[].value_prefix` | string | Empty | No CR, LF or NUL; ignored by `basic_x_access_token` | The text before a raw value, such as `Bearer `. | 
| `secret_injections[].value_format` | string | `raw` | `raw` or `basic_x_access_token` | `raw` sends the prefix and value; `basic_x_access_token` sends the Basic credential that git uses. |

## Errors

| Code | When | Fix |
| --- | --- | --- |   
| [`invalid_name`](https://slashinfra.com/docs/reference/errors#invalid_name) | Create sends a name that breaks the rule in Options. | Send 1 to 32 lowercase letters, digits or hyphens, with a letter first. | 
| [`invalid_value`](https://slashinfra.com/docs/reference/errors#invalid_value) | Create or replace sends an empty value. | Send a non-empty value on standard input. | 
| [`invalid_description`](https://slashinfra.com/docs/reference/errors#invalid_description) | Create or describe sends more than 200 code points or a control character. | Shorten it and remove control characters. | 
| [`name_taken`](https://slashinfra.com/docs/reference/errors#name_taken) | Create uses a name another secret of the project has. | Choose another name. | 
| [`secret_not_found`](https://slashinfra.com/docs/reference/errors#secret_not_found) | Describe, replace or delete names no secret in the project, or a VM or profile rule names a secret of another project. | Check the name or id, and the project. | 
| [`secret_in_use`](https://slashinfra.com/docs/reference/errors#secret_in_use) | Delete names a secret that a VM or profile references; describe or replace names a database-managed `db:` secret. | Remove the rules that name it; a `db:` secret belongs to its database. | 
| [`secret_pending`](https://slashinfra.com/docs/reference/errors#secret_pending) | Replace stored the new version but a node did not cache it in time. | Send the same request again; the new version stays. | 
| [`invalid_injection`](https://slashinfra.com/docs/reference/errors#invalid_injection) | A VM or profile rule has a bad domain, header, placeholder or format, or not exactly one of header and placeholder. | Send one exact host and one of a header or placeholder. | 
| [`unknown_secret`](https://slashinfra.com/docs/reference/errors#unknown_secret) | A VM or profile rule names a secret id that no secret of the organization has. | List the project’s secrets and use the id. | 
| [`secret_unavailable`](https://slashinfra.com/docs/reference/errors#secret_unavailable) | A request through the key vault names a host whose secret was deleted or is not ready. | Check the rule and replace or remove the secret. |

Errors that any request can return are in the [error catalog](https://slashinfra.com/docs/reference/errors).

## Permissions

| Operation | Who can | Key action |
| --- | --- | --- |   
| Create a secret | Any member | `secret:write` | 
| List secrets | Any member | `secret:read` | 
| Change the description | Any member | `secret:write` | 
| Replace the value | Any member | `secret:write` | 
| Delete a secret | Any member | `secret:delete` | 
| List the presets | Any member | None | 
| Use a secret in a VM | Any member | `svm:write` | 
| Save rules in a profile | Any member | `profile:write` |

## Limits

- A name has 1 to 32 lowercase letters, digits and hyphens and starts with a letter. 
- A description has at most 200 code points and no control character. 
- A value has at least one character; an empty value is refused. 
- A rule names one exact HTTPS host; a wildcard is refused. 
- A rule has a header or a placeholder, not both. 
- A placeholder is `__`, 8 to 60 uppercase letters, digits or underscores, and `__`. 
- A header cannot be `host`, `content-length`, `transfer-encoding`, `connection`, `upgrade`, `te`, `trailer`, `cookie` or `proxy-*`. 
- No two rules share a domain and header, or a domain and placeholder. 
- Only HTTPS on port 443 gets the key. Plain HTTP, other ports and Tailscale traffic do not. 
- A client that pins a provider’s certificate or public key cannot use a secret on port 443. 
- A secret that a VM or profile references cannot be deleted; remove the rules first. 
- Every replacement makes one new version; nodes must cache it before the answer. A 503 `secret_pending` keeps the new version.

The full list is in [Limits](https://slashinfra.com/docs/reference/limits).

## Next

- [Projects](https://slashinfra.com/docs/platform/projects): a secret belongs to one project, and a rule cannot cross projects. 
- [Who can reach your VM](https://slashinfra.com/docs/how/access): member roles, key actions and project scope. 
- [Control API secrets](https://slashinfra.com/docs/api-reference/control/secrets): every operation, field and status code.
