Use Rift with Vercel Sandbox
Vercel Sandbox runs the code and Rift keeps the files. Rift runs on Linux, which is what the sandbox runs.
Set it up
On your own machine, make an invite for the sandbox and share the folder the run should write to.
$ rift invite vercel-sandbox-run$ rift share runs/vercel-sandbox-1 vercel-sandbox-run
Give the sandbox the token as a secret, for example an environment variable named RIFT_INVITE. The sandbox needs outbound network access.
A sandbox that kept its disk is already joined. Run rift status first, and skip the two commands below if it prints a line that contains folder at. Otherwise install Rift and join.
$ curl -fsSL https://rift.sh/install | sh$ rift init --invite "$RIFT_INVITE"
To skip the install on a fresh sandbox, add the first command to the image or template it boots from. Have the agent keep its work in the shared folder. In the sandbox it appears under its own name, at ~/rift/vercel-sandbox-1.
What you get
Files the agent writes there reach your machines as they are written. When the sandbox ends, they are still on your machines. A later sandbox that joins and is given the same folder starts with those files.
Before the sandbox stops, run rift status and wait for in sync. A file still uploading when it stops is lost. When the run is over, remove its access.
# your machine$ rift unshare runs/vercel-sandbox-1 vercel-sandbox-run
The token still lets a machine join under that name, with no folders. If it may have leaked, share nothing more with that name and make an invite under a new name.