OPENAI_API_KEY, and give it to a sandbox by
name. Fibre keeps the value encrypted and adds it as an environment variable only where you ask for it:
A sandbox that names no secret gets none. A stored value is write-only: once it is set, Fibre never shows it
again, not in the API, the SDKs or the CLI. You can only replace it or delete it.
Store a secret
Give it a name inUPPER_SNAKE_CASE, which becomes the name of the environment variable, and the value. In the
CLI, fibre secret set OPENAI_API_KEY asks for the value without showing it, or reads it from a pipe, so the
value never appears on the command line:
Response
Response
response
Give a secret to one command
This is the safest way to use a secret, and the one to reach for first: only the command that needs the secret gets it, and nothing else that runs in the sandbox before or after can read it. First, a sandbox to work in. It names no secrets:Response
Response
output
secrets works on Start a command, alongside env. A name
cannot be both in secrets and in env.
Give a secret to a whole sandbox
Some programs run for a long time and need a secret the whole time, such as a server you start in the background or an agent that runs many commands. Name the secret when you create the sandbox, and every command in it gets the value. The sandbox’s details list the secrets it uses, by name only:Response
Response
response
Change or delete a secret
To change a value, set it again with the same name. Its version goes up, and from then on:- Commands that name it get the new value straight away.
- New sandboxes that name it start with the new value.
- A sandbox that got it when it was created keeps the value it started with. Create a new sandbox, or name the secret on its commands, to use the new one.
Response
Response
response
secret_not_found, and sandboxes that named it start without it. Here we also clean up the two sandboxes:
Response
Response
response
Who can use secrets
Naming a secret puts its value into a sandbox, so Fibre treats it like reading the secret:
The last row matters for agents. An agent working inside a sandbox should hold a
key for that one sandbox. With it, the agent can run its own commands,
but it cannot pull any of your secrets into its sandbox. Give the agent the secrets it needs yourself, when you
create its sandbox or start its commands, from your own code.
Good practice
- Name secrets on the command that needs them, rather than on the whole sandbox, so that nothing else in the sandbox can read them.
- Never print a secret. Command output is returned to whoever runs the command and may end up in logs, and in a model’s context when an agent runs it.
- Remember that code in a sandbox can send what it can read. For untrusted or model-written code that uses a
secret, also limit the sandbox’s network to the services the secret is for, such as
api.openai.com. - Use a separate key per purpose, such as one model key for your agents and another for evals, so you can change or revoke one without touching the others.
- Change secrets from time to time, and at once if one may have leaked: set the new value, then revoke the old one at its provider.
Limits
See the API reference for every field.