What Fibre isolates
Fibre keeps several boundaries in place for you, without any setting:What you control
On top of Fibre’s own boundaries, a few settings and habits make a big difference.Keys
- Give each job its own key, with only the scopes it needs and the shortest lifetime that works. If one key leaks, only that job is affected.
- Inside a sandbox, use a key bound to that sandbox (with
resource). An agent holding it can manage its own sandbox and nothing else, and the key stops working when the sandbox is deleted. See a key for one sandbox. - Never put your account’s main key in a sandbox. Any program running there could read it.
Secrets in sandboxes
Your agent may need a secret, such as a model API key or a database password. Store it in Fibre and give it to the command that needs it by name: it reaches that command only, Fibre keeps it encrypted, and its value is never shown again. A sandbox that names no secret gets none. See secrets. Avoid putting secrets inenv_vars when you create a sandbox: those are visible to every command in it, and they are
copied into snapshots made from the sandbox.
Users inside a sandbox
Commands run asroot inside the sandbox. That is root of the sandbox’s own machine, which is isolated from Fibre’s
hosts and from every other sandbox, so it can install packages and change any file in the sandbox, and nothing
beyond it.
Some programs refuse to run as root, and sometimes you want a tool to have less power than the agent that started
it. Create an ordinary user in the sandbox and run those commands as that user:
Response
Response
response
Network
By default a sandbox can reach the whole internet. For untrusted code, allow only the hosts it really needs, or none at all:create body
Public URLs
A sandbox’surl is public: anyone who has the address can reach whatever the sandbox
serves on its exposed port. Only serve what you mean to share, and add your own sign-in to anything private.
Browser and desktop links
cdp_url gives full control of the sandbox’s browser, so treat it like a password and keep it on your server.
live_view_url and desktop links only show the screen and pass on clicks, so they are safe to show a user.
Desktop links also work only once.
How Fibre handles your data
This is how Fibre treats the sensitive things you give it:A checklist for untrusted code
When you run code you do not trust, follow these steps:- Use a fresh sandbox for each job, and delete it when the job is done. Starting from a snapshot keeps this fast.
- Set a network allow list, or
{"block": true}if the code needs no network at all. - Keep long-lived secrets out of the sandbox. If the code must call an API, give it a short-lived key with narrow scopes.
- Give the sandbox a short lifetime, so that a forgotten sandbox ends by itself.
- Use the
standardruntime unless the job needs Docker or another kernel feature. Both runtimes are isolated;vmadds a kernel of its own. - Take results out through the files API, and check them before your app uses them.
Related
Network access
Allow lists and fully offline sandboxes.
API keys
Scoped, bound and expiring keys.