ff, check the output. Each entry names its source guide for the full walkthrough.
Permissions
Fairyfly is deny-by-default, so the run commands below carry the smallest--allow-* set each snippet needs. Add a grant when you add an API; a missing
one fails closed with PermissionDenied / PERMISSION_DENIED.
- Loading code is not a read:
import,Workerscripts,ff.jsonplus itsmain, andff testfiles need no--allow-read. process.argvis not environment access. Readingprocess.env.NAMEneeds--allow-env=NAME; an ungranted name reads asundefined, not an error.--allow-runand--allow-ffiare trust-equivalent to full process access. Neither confines the code it enables.--allow-allis not used below. It exists for fully trusted runs and the repo’s full test suite.
Hello, world
HTTP server
http.serve always binds 0.0.0.0; --allow-net=127.0.0.1:3000 does not
match the listener.
Routing, JSON REST API, SQLite-backed notes API: HTTP Server guide. Method/options tables: http API.
Fetch client
example.com:443 covers only HTTPS on 443. Use
--allow-net=example.com to allow any port, or a bare --allow-net to allow
every host.
POST JSON, redirect rules, private-CA trust, mirror script: Fetch Client guide. Types and readers: fetch API.
WebSocket chat room
ff client needs
--allow-net=127.0.0.1:3000 (or localhost:3000); browsers are outside the
runtime’s permission policy.
Upgrades are automatic when the websocket block is present — no handler branch. Presence counter, binary frames, client API: WebSocket guide.
TLS + WSS
--cert / --key before the runtime, so those paths need no
--allow-read. A tls: { cert, key } object inside the app is a runtime read
and does:
SQLite notes API
--allow-write=. is required even though only notes.db was named: SQLite
creates notes.db-wal and notes.db-shm beside it. The read scope covers the
database file; the directory write scope covers the siblings.
Transactions, lastInsertRowId(), busy timeout: SQLite API.
Workers (hash offload)
hasher.js is a program-loading carve-out. The worker inherits
the parent’s policy, so a worker that calls fs.readFile needs the parent to
hold --allow-read.
Spawn rules, { data } vs workerData, terminate, pool pattern: Workers guide.
Packages (markdown blog)
ff init and ff imprint are CLI operations, not runtime APIs — no permission
flags. Imports from installed packages load as program files. The server needs
only the listener scope.
Install/remove/rebuild/CI: Packages guide. Resolution rules: Modules guide.
Testing a JSON endpoint
--allow-read; reads inside a test do. Both net scopes are required here:
0.0.0.0:3902 for the listener and 127.0.0.1:3902 for the client.
check/done, server fixtures, run.sh: Testing guide.
Bytecode ship
ff compile is a CLI operation and needs no flags. Bytecode carries no policy:
ff app.ffbc needs the same grants the source needed — for example
--allow-net=0.0.0.0:3000 for a server.
When to compile, caps, stripped traces: Bytecode guide.
Timers + process CLI
poll.js needs the outbound net scope. tool.js reads only process.argv,
which is not gated; if it read process.env, that would need
--allow-env=<NAME>.
Sleep, intervals, unref, microtasks: Timers guide. argv/env/exit: Process guide. Env vars: Env guide.
Blobs and forms
--allow-read. If you load the upload with
fs.readFile, add --allow-read for that path.
slice, round-tripping, file-drop endpoint: Blob and FormData.
Deploy checklist
FF_ECHO is runtime configuration, not app env, so it needs no --allow-env.
If the app reads PORT, add --allow-env=PORT and make the net scope match
that port. The policy lives in the start command, not ff.json.
Docker, ff start, production TLS, health endpoint: Deploy guide. Install paths: Installation. Caps: Limitations.
See also
- Permissions — flags, scopes, denial contract
- CLI reference — every command and flag
- Quickstart — first run
- Limitations — every hard cap