---
title: "AgentFS with copy-on-write overlay filesystem"
description: "AgentFS 0.4 adds `agentfs run`, which launches a coding agent in a sandbox where the working directory is a copy-on-write overlay."
url: "https://swe.quest/articles/agentfs-with-copy-on-write-overlay-filesystem-c1809b9cbbc5773b"
canonical: "https://turso.tech/blog/agentfs-overlay"
source: "Turso"
published: "2025-12-31"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 5
tags: ["sandboxing","ai-agents","storage-systems","linux","sqlite"]
---

# AgentFS with copy-on-write overlay filesystem

A post on [Turso](https://swe.quest/sources/turso.md), published 2025-12-31, 5 min read, Deep dive. Original: [https://turso.tech/blog/agentfs-overlay](https://turso.tech/blog/agentfs-overlay)

## Summary

AgentFS 0.4 adds \`agentfs run\`, which launches a coding agent in a sandbox where the working directory is a copy-on-write overlay. The host filesystem is the read-only base layer and a SQLite database is the writable delta layer, so agent edits and deletions (tracked through a whiteout table) never touch the host checkout, and other shells can join the same session by ID. On Linux the overlay is a FUSE filesystem combined with user and mount namespaces that remount everything read-only except allowed paths. On macOS it is served by a localhost NFS server, avoiding the need for macFUSE, and confined with a generated sandbox-exec profile.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)

## Prerequisites

- Linux namespaces ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- FUSE basics
- overlay filesystems

## Keywords

AgentFS, FUSE, NFS, sandbox-exec, SQLite, Claude Code, Turso

## Related posts

- [AgentFS with FUSE: SQLite-backed agent state as a POSIX filesystem](https://swe.quest/articles/agentfs-with-fuse-sqlite-backed-agent-state-as-a-posix-filesystem-5f39c709b604ee45.md): Turso · 2025-12-08 · Medium · 7 min read · AI agents, SQLite, Linux, Storage systems, Rust
  AgentFS adds an \`agentfs mount\` command that exposes its SQLite-backed agent filesystem as a real POSIX filesystem via Linux FUSE.
- [AgentFS in the Browser](https://swe.quest/articles/agentfs-in-the-browser-5b295716ac634197.md): Turso · 2025-12-22 · Medium · 5 min read · AI agents, SQLite, WebAssembly, Browsers, Local-first & sync
  AgentFS gives browser-based agents a virtual filesystem stored in a SQLite database, using Turso's WASM build of its Rust rewrite of SQLite.
- [The Missing Abstraction for AI Agents: The Agent Filesystem](https://swe.quest/articles/the-missing-abstraction-for-ai-agents-the-agent-filesystem-ef7d12c3499d3c42.md): Turso · 2025-11-13 · Medium · 8 min read · AI agents, SQLite, Observability, Storage systems
  AgentFS is an SDK that stores all of an AI agent's state in a single SQLite (Turso) database file: a POSIX-like virtual filesystem, a key-value store, and an append-only tool call audit log.
- [Sandboxing](https://swe.quest/articles/sandboxing-a1efb1bf6e8282ad.md): Zed · 2026-08-05 · Medium · 7 min read · Sandboxing & isolation, AI agents, AI for coding, Linux, Developer tools
  Zed's agent panel now sandboxes the terminal and fetch tools by default (from 1.14) using OS-enforced restrictions: Seatbelt on macOS, Bubblewrap namespaces on Linux, and WSL on Windows.
- [Building Agents that Don't Break Themselves](https://swe.quest/articles/building-agents-that-don-t-break-themselves-946af945ee4733ac.md): Fly.io · 2026-06-08 · Medium · 6 min read · AI agents, Sandboxing & isolation, Identity & auth, Virtualization
  Separate where an agent lives from where it executes code: keep the agent loop on a durable host and send every shell command to a disposable Sprite sandbox.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
