| name | overlayfs-runtime-isolation |
| description | Isolate agent file-system writes using OverlayFS and bubblewrap (bwrap). Core directories mounted read-only; all agent writes go to RAM-backed tmpfs. Zero persistence on session end. Anti-graffiti immutable surface pattern. |
| origin | Linux OverlayFS docs, containers/bubblewrap (LGPL-2.0), YAMTAM Engine sandbox design |
| license | Apache-2.0 |
| version | 1.0.0 |
| compatibility | claude-sonnet-4-6, claude-opus-4-7 |
OverlayFS Runtime Isolation
Mount core infrastructure as read-only (lowerdir) and redirect all agent writes to ephemeral RAM (upperdir = tmpfs). On session close, tmpfs is discarded — disk never touched.
When to Use
- Running untrusted or experimental agent tasks without risking real files
- Implementing the Anti-Graffiti immutable surface policy (rule 49)
- Testing destructive tool calls safely (rm, overwrite, git reset)
- Providing agents a writable scratch space that self-cleans on exit
Do NOT use for
- Persistent storage — tmpfs is lost on unmount/reboot
- Production deployments where agent writes need to survive sessions
- Environments without Linux kernel ≥ 4.0 (OverlayFS requirement)
Bubblewrap (bwrap) Quickstart
bwrap \
--ro-bind /workspaces/yana-ai /app \
--bind /workspaces/yana-ai/releases/logs /app/releases/logs \
--tmpfs /tmp \
--proc /proc \
--dev /dev \
--unshare-all \
--share-net \
--die-with-parent \
-- node /app/core/scripts/agent-runner.js
OverlayFS Mount (kernel-level)
mkdir -p /tmp/overlay/{upper,work}
mount -t overlay overlay \
-o lowerdir=/workspaces/yana-ai/core,\
upperdir=/tmp/overlay/upper,\
workdir=/tmp/overlay/work \
/mnt/agent-view
umount /mnt/agent-view
rm -rf /tmp/overlay
YAMTAM Integration
export YAMTAM_SANDBOX_MODE=1
export YAMTAM_SANDBOX_ROOTDIR=/workspaces/yana-ai
export YAMTAM_SANDBOX_WRITEDIR=releases/logs
bash core/scripts/tool-proxy.sh node agent-task.js
Namespace Isolation Flags
| Flag | Effect |
|---|
--unshare-all | Isolate pid, net, ipc, uts, cgroup namespaces |
--share-net | Re-enable network (remove for full isolation) |
--die-with-parent | Sandbox exits when parent process exits |
--ro-bind src dst | Mount src as read-only at dst |
--tmpfs /path | RAM-backed writable mount |
Session Cleanup Verification
diff -r /workspaces/yana-ai/core /mnt/agent-view/
Anti-Fake-Pass Checklist