Limits and safety

Fubby catches runaway programs and common mistakes with clear errors. It doesn't protect your computer from a hostile program, so please read this before running code you didn't write.

Don't run programs you don't trust. Fubby isn't an operating-system sandbox. A Fubby program can read and write your files unless you restrict it, and these limits are designed to catch mistakes rather than attacks. Fubby hasn't had an independent security audit.

Limits you can change

Set these as environment variables when you start a program. Values outside the allowed range are limited to it, except the Bela settings, which report an error.

FUBBY_MAX_STEPS=500000 FUBBY_TIMEOUT_MS=5000 fubby run app.fab
VariableDefaultMaximumWhat it limits
FUBBY_MAX_STEPS2,000,000100,000,000Interpreter steps in one run
FUBBY_TIMEOUT_MS10,000600,000Run time in milliseconds
FUBBY_MAX_ALLOC_BYTES32 MiB256 MiBApproximate memory charged to one run
FUBBY_MAX_ACTIVE_ALLOC_BYTES128 MiB1 GiBApproximate memory across the whole process
FUBBY_BELA_WORKERS48Bela workers
FUBBY_BELA_QUEUE1664Bela tasks waiting for a worker
FUBBY_BELA_TASK_MS1,00030,000Run time for one Bela task

Controlling access

VariableIf not setWhat it does
FUBBY_NET_ALLOWLISTAll HTTP is deniedA comma-separated list of hosts that Moon can reach
FUBBY_FS_ROOTFiles are unrestrictedThe only folder that file functions, SQLite and Snow's static files can use
FUBBY_LOCAL_REGISTRYNoneThe default local package registry folder

FUBBY_FS_ROOT helps prevent accidents, but it isn't a secure sandbox, and it shouldn't be trusted against symbolic-link or timing attacks.

Fixed limits

AreaLimitValue
SourceOne source file1 MiB
SourceAll files in one program8 MiB
SourceImported files128
SourceNesting of code500 levels
SourceOperators in one expression chain10,000
RunningDepth of function calls1,000
ValuesItems in one collection100,000
ValuesNesting of lists, maps and objects512 levels
ValuesOne string16 MiB
ValuesText printed for one value before it's shortened1 MiB
LibraryJSON size and nesting1 MiB, 128 levels
LibraryRegular expression text and pattern16 KiB, 1 KiB
Librarystr_repeat result1 MiB
SnowRoutes256
SnowBefore and after middleware32 each
SnowStatic folders16
SnowQuery keys128
BelaTasks and channels in one run128, 16
BelaOne message or result64 KiB
BelaMessages and results waiting8 MiB
ThreadsBela and Snow workers in one process32

Moon's HTTP and SQLite limits are on the web and data page, and Snow's server options are listed there too.

What Fubby catches for you

What Fubby doesn't protect against

Reporting a problem

Report bugs through the public issue tracker. Please don't post passwords, private code, personal information, or details of how to exploit a security problem there.