HNHacker News
TopNewBestAskShowJobs

benswerd

726 karma · joined June 6, 2021

Building Freestyle (YC S24)

github.com/freestyle-sh github.com/worldhealthorganization/app github.com/theswerd

swerdlow[dot]dev

submissionscomments
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Generally compared to those two more powerful. Freestyle VMs are full Debian machines, with support for sysd, docker in docker, multiple users, hardware virtualization etc. Daytona and E2B are both great "sandbox" providers but don't really feel like VMs/you can't run everything you can in an EC2.

We also support the forking/snapshotting/long running jobs that they struggle to.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Ah we cannot do this without a restart. Hot pluggable ram is something I'm interested in but is currently a backburner feature.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
50 is not heavy, what is heavy is 1000 VMs that can be paused/brought back 50 in 1 second.

Though generally ya, handrolling this stuff can work at the scale of 50 VMs, it becomes a lot harder once you hit hundreds/thousands.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
So fork time is actually O(1) with VM size, its 500ms even for 64gb + disk. We're using some pretty weird COW techniques to pull it off.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Yes! You can def run something like K3s in these VMs.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Never tried them, I think the weird thing about VM providers is the difference really all is in the execution. These guys seem great in concept but I don’t know enough about how they properly work.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Our users are platforms, and many of the best already build on us.

Self hosting is a valuable feature but our technology is unfriendly to small nodes — it will not work on consumer hardware. Many of the optimizations we spend our time on only seriously kick in above 2TB of storage and above 500GB of RAM.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Tx it took a lot of work lol
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
That’s what I’m hoping for!
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
So the snapshotting tech is actually 100% independent of Git.

Git is useful for branching vs forking (IE you can't merge two VM forks back together), but all the tech I showed in the Loom exists independently from Git.

The hard part of it was making the VM large and powerful while making snapshotting/forking instant, which required a lot of custom VMM work.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
So we have there are 3 solutions to this, Freestyle supports 2 of them: 1. Freestyle supports multiple linux users. All linux users on the VM are locked down, so its safe to have a part of the vm that has your secret keys/code that the other parts cannot access. 2. A custom proxy that routes the traffic with the keys outside 3. We're working on a secrets api to intercept traffic and inject keys based on specific domains and specific protocols starting with HTTP Headers, HTTP Git Authentication and Postgres. That'll land in a few weeks.
benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
If you put your gmail credentials into a VM that an AI Agent dealing with untrusted prompts has access to they should be treated as leaked and be disabled immediately.

However, if you don't put your administrative credentials inside of the VM and treat it as an unsafe environment you can safely give it minimal permissions to access specific things that it needs and using that access it can perform complex tasks.

benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
yep you can choose ram + disk + cpu size
benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
This will just work on us.

We do auto suspend depending on your configured timeout. We'll pause your VM and when you come back the processes will be in the exact same state as when you left.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Kind of. The chat logs of the agent are trustworthly, as should any telemetry you have on it or coming out of the VM. Its behavior should be treated as probabilistic and therefore untrustworthly.
benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
Deterministic testing of edge cases. It can be really hard to recreate weird edge cases of running services, but if you can create them we can snapshot them exactly as they are.
benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
no, but the goal of these is if you are faced with prompt injection the worst case scenario is the AI uses that computer badly.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
I used to believe this, but I think the next generation of agents is much more autonomous and just needs a computer.

The work of a developer is open ended, so we use a computer for it. We don't try to box developers into small granular screwdrivers for each small thing.

Thats whats coming to all agents, they might want to run some analysis with python, want to generate a website/document in typescript, and might want to store data in markdown files or in MongoDB. I expect them to get much more autonomous and with that to end up just needing computers like us.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Exe.dev is a individual developer oriented service. Freestyle is more oriented at platforms building the next exe.dev.

Thats why our pricing is usage based and we have a much larger API surface.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
I recommend running the agent harness outside of the computer. The mental model I like to use is the computer is a tool the agent is using, and anything in the computer is untrusted.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
So we recommend branch per fork, merge what you like.

You have to change the branch on each fork individually currently and thats unlikely to change in the short term due to the complexity of git internals, but its not that hard to do yourself `git checkout -b fork-{whateverDiscriminator}`

benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
500ms. Less than 1 second. We're aiming to get that down to 200ms in the next 3 months.
benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
So first MicroVM != Container, and container is not a secure isolation system. I would not run untrusted containers on your nodes without extra hardening.

The memory forking was originally invented because for AI App Builders and first response driven applications its extremely important that they are instant (difference between running bun dev and the dev server already being running).

However its much more generally applicable, Postgres is a great example of this. You can't fork the filesystem under postgres and get consistency. Same thing with a browser state, a weird server state, or anything that exists in memory. The memory forking gives a huge performance boost while snapshotting whats actually going on at one instant.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
So isolation is correct. Forking a sandbox gives you multiple exact duplicates of isolated environments.

When your coding agent has 10 ideas for what to do, to evaluate them correctly it needs to be able to evaluate them in isolation.

If you're building a website testing agent and halfway down a website, with a form half filled out a session ongoing, etc and it realizes it wants to test 2 things in isolation, forking is the only way.

We also envision this powering the next generation of devcycles "AI Agent, go try these 10 things and tell me which works best". AI forks the environment 10 times, gets 10 exact copies, does the thing in each of them, evaluates it, then takes the best option.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
I disagree (as a sandboxing company).

With respect to the market, every single sandbox sucks. I'm not gonna shit talk competitors but there is not a good sandboxing platform out there yet — including me — compared to where we'll be in 6 months.

We've heard all the platforms have consistent uptime, feature completeness, networking and debugging issues. And in our own platform we're not 1/10ths of the way through solving the requests we've gotten.

Next generation of Agents needs computers, and those computers are gonna look really different than "sandboxes" do today.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
We're not going after hobbyists. We're building the platform for companies like exe.dev to build on. Thats why its all usage based.

That said, our $50 a month plan can be used as an individual for your coding agents, but I wouldn't recommend it.

benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
So this is an ongoing optimization point, no perfect solution exists. Freestyle VMs work with a network namespace and virtual ethernet cable going into them, so they all think they are the same IP.

This means that while complex protocol connections like remote Postgres can break in the forks, stuff like Websockets just automatically reconnects.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Self hosting can be doable for constant small/medium size workloads

You can handroll a lot with: https://github.com/nestybox/sysbox?tab=readme-ov-file https://gvisor.dev https://github.com/containers/bubblewrap?tab=readme-ov-file

For hardware virtualized machines it much harder but you can do it via: https://github.com/firecracker-microvm/firecracker/ https://github.com/cloud-hypervisor/cloud-hypervisor

Freestyle/other providers will likely provide better debugging experience but thats something you can probably get past for a lot of workloads.

The time when you/anyone should think about Freestyle/anyone is when the load spikes/the need to create hundreds of VMs in short spikes shows up, or when you're looking for some of the more complex feature sets any given provider has built out (forks, GPUs, network boundaries, etc).

I also highly recommend self hosting anything you do outside of your normal VPC. Sandboxes are the biggest possible attack surface and it is a feature of us that we're not in your cloud; If we mess up security your app is still fine.

benswerd··on Launch HN: Freestyle – Sandboxes for Coding Agents
Fly.io sprites is the most similar to us of the bunch. They do hardware virtualization as well, have comparable start times and are full Linux. What we call snapshots they call checkpoints.

The big pros of Sprites over us is their advanced networking stack and the Fly.io ecosystem. The big cons are that Sprites are incredibly bare bones — they don't have any templating utilities. I've also heard that Sprites sometimes become unavailable for extended periods of time.

The big pros of Freestyle over Sprites is fork, advanced templating, and IMO a better debugging experience because of our structure.

benswerd··on Launch HN: Freestyle: Sandboxes for AI Coding Agents
Reviewing this now. our public pricing at www.freestyle.sh/pricing seems to be working, can you point me in a more specific direction?
← PreviousPage 3 of 5Next →