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.
Create a secret
Section titled “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.
- Open Secrets.
- Select Create secret.
- Enter
openaiin Name. - Enter your key in Value.
- Enter
Team OpenAI keyin Description. - Select Create secret.
Your key is in the shell variable $OPENAI_API_KEY. The value comes from standard input, so it stays out of your shell history.
printf '%s' "$OPENAI_API_KEY" | si org secret create openai --description 'Team OpenAI key'openaicurl -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\"}"API reference: Control API operation
{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"Team OpenAI key","version":1,"created_ms":1795956268702,"updated_ms":1795956268702}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"])sec_6f1c0f0e8aconst 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)sec_6f1c0f0e8aA 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
Section titled “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.
-
Open SVMs.
-
Select Create SVM.
-
Enter
workerin Name. -
Select Create SVM.
-
Select
workerin the table to open it. -
Select the Security tab.
-
Select Use a secret under Secrets.
-
Choose
openaiin Secret. -
Choose OpenAI in Service.
-
Select Add secret.
-
Open SVMs, select Open terminal on
worker, and run:Terminal window curl -sS -o /dev/null -w '%{http_code}\n' https://api.openai.com/v1/modelsOutput 401
OpenAI answers 401 because the test value is not a working key. The request carried it, and the VM never held it.
si create --name worker --inject openai:openaisi exec worker -- curl -sS -o /dev/null -w '%{http_code}\n' https://api.openai.com/v1/models6f1c0f0e8a401The 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 -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"}]}'API reference: Control API operation
{"id":"6f1c0f0e8a","project":"proj_6f1c0f0e8a","url":"https://6f1c0f0e8a.slashinfra.dev/bin/bash","region":"eu-gra","expires_at":null,"generation":1,"labels":{}}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"])6f1c0f0e8aconst 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)6f1c0f0e8aKeep a credential in a secret, not in env. A command in the VM can print its environment variables.
List the secret injection presets
Section titled “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 -sS "https://api.slashinfra.com/secret-injection-presets" \ -H "Authorization: Bearer $SI_API_KEY" | python3 -m json.toolAPI reference: Control API operation
[ { "id": "openai", "service": "OpenAI", "rules": [ { "domain": "api.openai.com", "header": "authorization", "value_prefix": "Bearer ", "value_format": "raw" } ] }, ...]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"])openai OpenAIanthropic Anthropicgemini Google Geminiopenrouter OpenRouterstripe Stripegithub GitHubconst 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)openai OpenAIanthropic Anthropicgemini Google Geminiopenrouter OpenRouterstripe Stripegithub GitHubWrite a custom rule
Section titled “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 with Create secret or with the command below.
printf '%s' "$SLACK_TOKEN" | si org secret create slack --description 'Team Slack token'slackThe API samples use sec_7a2b3c4d5e; use the id of your slack secret.
- Open SVMs.
- Select Create SVM.
- Enter
slack-workerin Name. - Select Create SVM.
- Select
slack-workerin the table to open it. - Select the Security tab.
- Select Use a secret under Secrets.
- Choose
slackin Secret. - Choose Custom in Service.
- Enter
slack.comin Host. - Choose Bearer token header in Send as.
- Select Add secret.
- Open SVMs, select Open terminal on
slack-worker, and run:
curl -sS https://slack.com/api/auth.test{"ok":false,"error":"invalid_auth"}Slack answers invalid_auth because the test value is not a working token. The request carried it.
si create --name slack-worker --inject-rule 'slack.com:authorization:slack:Bearer 'si exec slack-worker -- curl -sS https://slack.com/api/auth.test6f1c0f0e8a{"ok":false,"error":"invalid_auth"}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"}]}'API reference: Control API operation
{"id":"6f1c0f0e8a","project":"proj_6f1c0f0e8a","url":"https://6f1c0f0e8a.slashinfra.dev/bin/bash","region":"eu-gra","expires_at":null,"generation":1,"labels":{}}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"])6f1c0f0e8aconst 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)6f1c0f0e8aThe 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
Section titled “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.
- Open Workload profiles.
- Select Create profile.
- Enter
ai-workersin Name. - Select Use a secret under Secrets.
- Choose
openaiin Secret. - Choose OpenAI in Service.
- Select Add secret.
- Select Create profile.
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.toolAPI reference: Control API operation
{ "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}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"])prof_6f1c0f0e8aconst 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)prof_6f1c0f0e8aList secrets
Section titled “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.
- Open Secrets.
- The table lists every secret of the project with Name, Version and Updated. A description appears under its name.
si org secret lsid name version updated descriptionsec_6f1c0f0e8a openai 1 2026-11-29 12:44:28Z Team OpenAI keysec_7a2b3c4d5e slack 1 2026-11-29 12:45:15Z Team Slack tokencurl -sS "https://api.slashinfra.com/secrets" \ -H "Authorization: Bearer $SI_API_KEY"API reference: Control API operation
[{"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}]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"])sec_6f1c0f0e8a openai 1sec_7a2b3c4d5e slack 1const 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)sec_6f1c0f0e8a openai 1sec_7a2b3c4d5e slack 1Change the description
Section titled “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.
- Open Secrets.
- Select More actions on
openai, then Edit description. - Enter
OpenAI key for agentsin Description. - Select Save.
si org secret describe openai 'OpenAI key for agents'openaicurl -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"}'API reference: Control API operation
{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"OpenAI key for agents","version":1,"created_ms":1795956268702,"updated_ms":1795956365810}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"])OpenAI key for agentsconst 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)OpenAI key for agentsReplace the value
Section titled “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.
- Open Secrets.
- Select the replace icon on the
openairow, labelled Replace secret openai. - Enter the new key in Value.
- Select Replace value.
The new key is in $OPENAI_API_KEY.
printf '%s' "$OPENAI_API_KEY" | si org secret replace openaiopenaicurl -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\"}"API reference: Control API operation
{"id":"sec_6f1c0f0e8a","project":"proj_6f1c0f0e8a","name":"openai","description":"OpenAI key for agents","version":2,"created_ms":1795956268702,"updated_ms":1795956380063}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"])2const 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)2Delete a secret
Section titled “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.
- Open SVMs.
- Select More actions on
worker, then Delete. - Select More actions on
slack-worker, then Delete. - Open Workload profiles.
- Select More actions on
ai-workers, then Delete. - Open Secrets.
- Select More actions on
openai, then Delete. - Select More actions on
slack, then Delete.
si org secret rm openaierror: This secret is in use. (secret_in_use)Delete the VMs and the profile that name it, then run it again.
si rm workersi rm slack-workersi org profile rm ai-workerssi org secret rm openaisi org secret rm slackdeleted 6f1c0f0e8adeleted 6f1c0f0e8bdeleted profile ai-workersdeleted secret openaideleted secret slackAfter the VMs and the profile are gone:
curl -sS -i -X DELETE "https://api.slashinfra.com/secrets/openai" \ -H "Authorization: Bearer $SI_API_KEY"API reference: Control API operation
HTTP/2 204...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)204const 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)204Options
Section titled “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 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. |
Scroll horizontally to see all columns.
Errors
Section titled “Errors”| Code | When | Fix |
|---|---|---|
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 |
Create or replace sends an empty value. | Send a non-empty value on standard input. |
invalid_description |
Create or describe sends more than 200 code points or a control character. | Shorten it and remove control characters. |
name_taken |
Create uses a name another secret of the project has. | Choose another name. |
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 |
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 |
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 |
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 |
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 |
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. |
Scroll horizontally to see all columns.
Errors that any request can return are in the error catalog.
Permissions
Section titled “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 |
Scroll horizontally to see all columns.
Limits
Section titled “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,cookieorproxy-*. - 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_pendingkeeps the new version.
The full list is in Limits.
- Projects: a secret belongs to one project, and a rule cannot cross projects.
- Who can reach your VM: member roles, key actions and project scope.
- Control API secrets: every operation, field and status code.