safety
who can make the runner change your code
the runner turns text into code changes, so who can reach it matters more than anything else. these are the exact rules
on your laptop
the dev runner:
- listens on
127.0.0.1only, checks each connection comes from this machine and that the request named this machine (which stops dns rebinding) - answers browser requests only from pages this machine served, so neither another site in your browser nor another computer on your network can use it
- needs the box's header and a json body on anything that changes something, which a form or image on another site can't send
to reach it from elsewhere, start it with --secret and give the box the same secret. anyone with it can change your code, so treat it like commit access. without a secret it won't listen beyond this machine, and an app on another address needs --origin. the agent runs with your permissions
what the runner says to different callers:
this part is yours to mess with. open the box with Ctrl+. (or ⌘. on a mac) and say how it should be different, and only you will see your version
when the runner serves the app
- identity comes from
identityand nowhere else. visitors never see the box and their hand-made requests are refused - changes come from the app's own pages, same address, with the box's header and a json body, so another site can't borrow a signed-in visitor's browser
- members are fenced in. their changes only reach their own version,
memberPathslimits the files andmemberCheckthe contents, and a change or build fix that breaks either gets taken back out. 20 requests a day unless you setmemberDailyLimit,dailyLimitcaps them all together, and only owners promote - guests' code stays in their own browser. how that works is on letting anyone change it
- the agent can work in a sandbox, on a copy without your ignored files, and only a patch comes back
- requests are bounded: 4000 characters, and 15 minutes of agent before it's stopped
the limits
without a sandbox a member's agent has the same access to the machine as an owner's, and memberPaths limits what a change touches, not what the agent reads. with one the agent is contained, but the code it writes still runs on the serving machine once built
whatever someone types, the agent will try with everything it can reach, and unsandboxed that includes reading a file and putting it on the page. so for strangers use a sandbox and browser-only pieces checked by clientOnly(), and otherwise only let people type who you'd let run an agent on that machine