Case Study
How Mastra Built a Scalable Agent Platform With Daytona

250+
sandboxes provisioned in 2 days
40%
faster sandbox provisioning
10
hours of engineering time saved weekly
Mastra is a TypeScript framework for building, testing, and deploying AI agents and workflows end-to-end. Companies like Brex, Replit, and PayPal use it to automate high-stakes workflows and ship AI features at scale.
Headquarters
San Francisco, CA
Industry
Computer Science
Department
Engineering and Operations Product
Key Features
Sandbox Creation Speed Sandbox Statefulness Long‑Running Sandboxes
Learn how this agent framework and platform partnered with Daytona to power its cloud features and support users’ agent deployment with secure, configurable sandboxes.
Daytona’s sandbox infrastructure works seamlessly. We now have the confidence that our users can deploy new agents without worrying about security or integrity.

Abhi Aiyer
Co-Founder and CTO at Mastra
01 -- CHALLENGE
Building Production-Ready Agents Required Dedicated Sandbox Infrastructure
When he first built Mastra, Abhi Aiyer, Co-Founder and CTO, and his team focused on providing the key primitives that let users build, test, and iterate on AI agents locally, from memory to tool-calling and workflow orchestration. Their next priority was giving users a way to collaborate on and deploy their agents to production securely and safely. That required dedicated sandbox infrastructure that could serve as a first-class building block for both their platform and their users.
The agents built with Mastra read repositories, write new files, and interact with external APIs. Without strong isolation, they can inadvertently access sensitive data or make changes beyond their intended scope. Dedicated sandboxes would empower Mastra users to ship agents with broader capabilities, knowing every action stays within defined boundaries.
Security and isolation were just the baseline. Framework users often built agents that run for hours, pause, wait for human approval, and resume to build on what they've already done. To sustain that kind of multi-step work without losing progress mid-task, each sandbox had to be stateful and long-running.
Sandbox startup speed also mattered. Abhi and his team needed a way to pre-configure sandbox dependencies and configurations so each sandbox could start in a fully equipped state. That would keep developers focused on building and enable tighter iteration cycles.
Even if users chose to run their own sandbox infrastructure for production deployment, Mastra still needed a sandbox layer to power its own platform. With several cloud-hosted features in development, sandboxes were critical for ensuring consistent, reproducible agent behavior and preserving progress across sessions.
However, building a sandboxing layer and connecting it to a storage provider like S3 or Google Cloud Storage to persist agent output would have pulled hours away from Mastra’s core roadmap. So Abhi and his team set out to find a dedicated sandbox infrastructure solution that offered both.
That’s when Abhi turned to Daytona. Their managed sandbox infrastructure, with native filesystem persistence built in, was exactly what he needed to power Mastra’s development and production workloads.
We needed a sandbox solution we could confidently add to our framework’s capabilities and integrate into our own cloud architecture. Daytona was the one.

Abhi Aiyer
Co-Founder and CTO at Mastra
02 -- SOLUTION
Isolated, Stateful Sandboxes That Run Agent Workloads on Demand
A simple API key was all it took to onboard Daytona. The platform’s SDK integrated cleanly into Mastra's TypeScript stack without any additional configurations. While Daytona’s team was available for any questions, Abhi and his team hardly needed to reach out. As Abhi shares, “The beauty of Daytona is that we signed up and it worked out of the box.”
Now, when Mastra runs cloud agent workloads, Daytona provisions a sandbox with its own file system, network stack, and compute. This isolation ensures Mastra can support any number of agents running simultaneously without the risk of cross-tenant interference. Framework users who choose Daytona as their sandbox provider get the same isolation and safety guarantees, giving them the confidence to deploy agents to production and grant them broader tool access.
Because Daytona’s sandboxes are stateful by design, project files, dependencies, and configurations are preserved across the full lifecycle of every workload. When an agent workflow needs to pause, branch, or repeat, Daytona enables any Mastra user to checkpoint its exact state. That way, workloads can be scaled or paused for human review without requiring redundant setup.
To reduce setup overhead, Abhi and his team use Daytona Snapshots for faster sandbox provisioning. By pre-building Mastra’s runtime environment into a reusable image, they ensure that every new sandbox inherits that baseline, from hosting a new workspace to running new agents. And since each sandbox is container-based with layers and caching built in, it starts in sub-second time.
With Daytona, Abhi and his team launched one of their flagship products, Mastra Studio. Using Studio, teams can build, test, and refine agents in the cloud, with every session running inside its own Daytona sandbox to keep workloads safe and consistent.
While the Daytona platform exceeded Abhi’s expectations, what cemented the partnership was the team. Daytona set up a dedicated Slack channel with the Mastra team, giving Abhi direct access to engineers for technical questions around logs and observability. That level of responsiveness turned the Daytona team into a true partner, giving Abhi and his team the confidence to continue scaling Mastra’s capabilities.
Daytona not only opened up new possibilities for our products, but also for our users. Their sandbox infrastructure saved us real resources, too, so we brought one of our core capabilities to market faster.

Abhi Aiyer
Co-Founder and CTO at Mastra
03 -- RESULT
Mastra Provisions 250+ Sandboxes in 2 Days With Daytona
With Daytona, Mastra now has the scalable, stateful sandbox infrastructure to underpin its cloud features and support developers using their framework through production. Users can now develop, collaborate on, and deploy agents without stitching together infrastructure solutions, while Abhi and his team stay fully focused on advancing Mastra’s roadmap.
250+ sandboxes provisioned in 2 days
40% faster sandbox provisioning
10 hours of engineering time saved weekly
Looking ahead, Mastra plans to deepen its integration with Daytona. This shift will enable more developers to focus on building intelligent agents while benefiting from secure, configurable sandboxes by default.
With Daytona, you're never just a number. It quickly becomes clear that they want you to be successful, from their support to how fast they iterate on their platform features.

Abhi Aiyer
Co-Founder and CTO at Mastra



