PRODUCTS

KEYWORDS

Sandboxing Agents With Dolt: Taking a Look at Prat

I’m sure you’ve seen one of those social media posts about “my AI agent deleted my database.” They keep happening again and again and again, and each time it does, we share it around the office and we’re just agog.

We know as an industry how to prevent this problem. We’ve known how to prevent it from day one, and it’s the exact same way you protect your database from any errant tool, or from an inexperienced intern, or an unauthenticated user: you don’t give them write access to the data in the first place.

But people keep doing it. Either because they can’t be bothered to make data replicas, or because they’re convinced that guardrail instructions are sufficient to keep their agent from misbehaving, or because they want the agent to be able to make changes to their database and lack a good way to review or test those changes before they land.

To be fair, there’s currently not a standard way to achieve that last bit. But we think that Dolt is a pretty good candidate. It’s our SQL database with Git-style version control, which is a killer feature if you’re giving agents access to your database.

To see how much version control helps, think about how much rarer it is to hear about an AI deleting someone’s codebase. It’s happens, but it’s not nearly as common, and usually it’s because the victim wasn’t using any version control. Simply having a git remote is enough to make that kind of data loss impossible.

Isolation and Change Review#

Version control is more than just data protection; by having an agent work in a separate code branch, the user responsible for that agent can review and diff the code changes, and then make an informed decision about whether or not to merge them, discard them, or request further changes. The usefulness of version control for coding agents is so universally understood that many agent harnesses have version control workflows built in.

But most people don’t version control their database, only their code. Even though they really should. I’m not going to advocate whether or not you should give an AI agent direct access to your database. But if you’re going to do it anyway, you need isolation. You need auditing. And you need the ability to diff and review changes.

Dolt accomplishes all of those. You can create an isolated branch for each agent, and create a database role that only has access to that branch, and can’t invoke any of Dolt’s version control functionality. Then you can spun up a SQL server and point your agent at it, and you’ll have total confidence that no matter what changes the agent makes, you’ll be able to review them before they can affect any other branch.

Dolt isn’t a full agent sandbox on its own, but it can be a powerful component in a full sandbox solution. And we recently learned about PRAT, a project by Matthew Summers which is attempting to do just that.

Full disclaimer: PRAT is prerelease software. It doesn’t currently achieve the full database sandboxing I described above, although that’s on its roadmap. As it currently stands, the way that PRAT uses Dolt is a lot closer to guardrail instructions than enforced isolation. Given that agents can and do ignore guardrails, you current shouldn’t use PRAT yet for any data you’re not prepared to lose.

But with that out of the way, I think that PRAT is at least worth understanding and discussing.

The Good#

The idea behind PRAT is pretty easy to understand: its goal is to achieve total isolation for AI agents by creating an environment where the agent can freely access all approved resources, and only those resources:

  • Most commands executed by the agent run in a Docker container. This prevents the agent from interacting with other processes on the host machine, or accessing files outside of the project root. The container is configured to have no network access by default.
  • Your project exists in a Git repo on the host machine. PRAT clones the repo and the agent works on the downstream clone. Git runs on the host machine, but uses both a custom Git configuration and Git hooks to block most operations. For example, the agent can fetch changes from upstream but cannot push.
  • PRAT runs a Dolt SQL server with a branch per-agent. Currently, the agent connects to the Dolt server with the same credentials as the user, meaning that the agent could potentially write SQL statements that modify other branches or run version control operations. In the future, PRAT plans to leverage Dolt’s role permissions to prevent this.

PRAT has a notion of cards, which represents a single in-progress task. When a user creates a card, they enumerate the scripts that the agent is allowed to invoke, such as build, lint, and test hooks. Then each card is given its own isolated environment. When the agent completes the task, the harness can validate the test hooks against the current state of the environment. Then the produced artifacts (the Git diff, the Dolt diff, and the log journal) can be manually reviewed and collectively merged or rejected.

I like this design a lot because it minimizes the trust placed in the agent. When the agent is responsible for running tests and summarizing its own behavior, users don’t have guarentees that these summaries are accurate, or that no additional changes were made between running the tests and the user review.

The Ugly#

The general design of PRAT is great. It’s exactly in line with what I had imagined for a Dolt-powered sandbox. But I’m not completely sold on it yet.

Some of this might be because PRAT is prerelease software. It’s not fair to judge prerelease software with release standards. But given that Matthew has been promoting PRAT himself on LinkedIn, I figure he’s ready to get some eyeballs on it, so I figure it was fair game for me to make my own assessment.

PRAT currently has some limitations that make perfect sense for prerelease software. For instance, it currently only supports Anthropic’s agent API. There’s the aforementioned fact that PRAT does not currently enforce database branch isolation: while each agent initially connects to a dedicated Dolt branch, there is nothing preventing the agent from running SQL statements against the main branch.

My bigger concern is about the documentation: namely, there’s a lot of it, and it’s pretty obviously AI-generated with minimal human review. I’ve been blunt in the past about how good documentation needs to be human-edited, for two reasons:

  • Good documentation is concise and targeted, and that often requires an editor with a firm grasp on the project’s design.
  • In an age where generated text and code is cheap, anything clearly human made is demonstrable proof of real effort and intent behind the project. It’s like “proof of work” for meatspace. Regardless of whether or not it actually correlates with code quality, good documentation communicates the creator’s vision and inspires confidence.

When you have a lot of documentation with minimal review, the pages inevitably drift out of sync, and important signal can get lost in the noise. For example, the ARCHITECTURE.md has a disorganized, stream-of-consciousness writing style typical of AI generated documentation. It reads like a laundry list of features but struggles to frame those features in the context of the project’s overall design. As a potential user, I struggled to identify which features were actually important and created the impression of software bloat.

For a more serious example, remember how I mentioned that PRAT currently doesn’t enforce database isolation and instead gives the agent the full database permissions of the user? That’s a pretty important disclaimer and should probably appear in the project’s README. But it doesn’t. It’s buried in SECURITY.md inside the documentation folder. Instead, the README says this:

Status

Pre-release, in daily use on real projects. The engine, policy, gates, reviewers, approvals, checkpoints, setup agent, environment checks with the infra agent, data branches on Doltgres and Dolt with the PostgreSQL fallback, clients, the crew with its memory, skills, jobs, epics, the governor, mission control, knowledge and dreams, and the web UI are built and tested, and so are an optional container sandbox for macOS and Linux and an evaluation harness. Next: per-card database users. Interfaces may still change.

“Next: per-card database users” is a very easy-to-miss part of a paragraph that leads with “in daily use on real projects”, which may create a false sense of confidence in the current state of the project.

The velocity at which modern software projects are producing code and documentation makes it important that the documentation is thoughtful, concise, and reflects the project’s design. Disorganized documentation creates the impression of a disorganized project. And regardless of whether that impression is accurate, project maintainers benefit from bearing that in mind and writing document that creates the best first impression of the project.

Overall Impressions#

Like I said, I think that the high-level design of PRAT makes a ton of sense. At the same time, the quality of the documentation gave me some pause and made the project feel bloated even though it’s currently in a pre-release state. I think that manual editing of the documentation could go a long way to combatting that impression. But this is also a pretty subjective take, so readers should feel free to check out the project themselves and form their own opinions.

In any case, I’m very excited to see how the project develops.

If you have your own thoughts and opinions about PRAT or agentic coding or sandboxing or version control, or if you just want to come by and say hello, you can always join our Discord and chat with the whole Dolt team.