When your business runs on internal software, you can’t afford for it to unexpectedly break. And though Retool apps have always been reliable, our legacy runtime kept us from being able to give builders a way to test apps before shipping them to production.
The new app builder changes that. Your app is now real React code, written by an agent. That makes "did that last change break something?" more important than ever—and much easier to answer. Retool’s agent can now write and run tests that check your app’s code and fix problems before the app is published, making sure the agent doesn’t make unintended changes.
Why AI-built apps need tests
Teams we spoke to spent as much as 20% of their build time clicking through apps by hand to check the agent's work. They wanted to catch regressions before publishing, control when tests get written, and keep tests away from production data.
So in the new app builder, tests are just code. They live alongside the components they cover, run in your app's sandbox, and use mock data, so they never get production credentials or access to live systems.
Why Retool uses integration tests instead of browser tests
We considered running tests in a real browser, still against mock data, but chose to start with behavior-level integration tests run with Vitest. They exercise your app the way a user would (render a page, click a button, check what shows up) without spinning up a browser at all. Here's why:
- They tell you what's actually broken. A behavior-level test fails when real functionality stops working, like "approving a refund marks the order as refunded and triggers a refund in Stripe." You don't need to know the code to understand what broke.
- They're faster, cheaper, and less brittle. A real browser makes every test run slower and heavier, and adds complexity for self-hosted teams. Browser tests can catch a little more, but they often break for reasons unrelated to your app. For most apps, the marginal benefit isn't worth the cost.
- They run anywhere. Because they have fewer dependencies, the same tests are easy to run in a CI pipeline or locally when you build with the Retool CLI or MCP.
Other platforms like Replit test with an agent that clicks through a running app in a real browser. This approach continually burns credits and leaves the user without a reusable suite of tests, as the results are only reviewable through a video replay. Retool’s test results are persistent in the Test tab and rerun for free.
How to turn on app testing
Tests cost AI credits to write, and not every session or app needs them, so we didn’t want to write them after every single prompt by default. Instead, there's a Build with tests toggle in Chat settings.

When it's on, the agent writes and updates tests as it builds, then runs the relevant ones at the end of each turn. If a test fails, the agent checks whether its own change caused a regression. Leave it off to experiment freely until you're ready to protect your changes.
You can also run your whole suite from the Tests tab as often as you like, since running tests doesn't use AI credits. Failing tests also block publishing until they pass, so regressions get caught before they reach your users.
Early results
The number we watch most is the percentage of apps that get tests once a team has tried testing. So far, once a team has tried building with tests, they turn it on for 56% of the apps they work on afterward, so they aren't just trying it once.
Generally, building with tests adds about 10% to the AI credits each turn uses. And while the main value is catching regressions, the agent will often catch its own mistakes, resulting in less back-and-forth, which helps smooth out costs over time. Plus, since testing is off by default, each team decides which apps are worth it.
The new App Tests feature we’ve had the opportunity to beta test, however, is a genuine game changer. It opens the door to a new tier of internal tools for us and strengthens our internal case for staying in the Retool ecosystem. We’re looking forward to seeing how this feature develops.
Kieran Black, Head of Data Engineering & Governance at Aiera
Availability and what's next
This is the first version. General availability is next, and the teams testing it now will shape what it becomes.
App testing is available today on all Retool Cloud plans, and self-hosted admins on the latest stable release can turn it on under Settings > Beta. Try building with tests on your next app, and let us know what you think.


