Mirage separates the terminal interface from file storage and compute, and agents only see the terminal. Each virtual terminal starts with only KBs of memory, so it lives everywhere.
npm install @struktoai/mirage-node npm install @struktoai/mirage-browser
const ws = new Workspace({
'/tmp': [new RAMVFS(), MountMode.EXEC],
'/redis': [new RedisVFS({ url: redisUrl }), MountMode.WRITE],
'/slack': [new SlackVFS({ token: slackToken }), MountMode.EXEC],
}, {
machines: { py: { provider: 'in_process', runtime: 'monty' } },
})
// one grep sweeps every source
await ws.shell('grep -rln session /redis /tmp')
// run a script that lives in Slack, report into Redis
await ws.shell('python3 /slack/report.py > /redis/report.txt')
// read the report back with a POSIX-style call
const report = await ws.vfs.read('/redis/report.txt')
// a typed CLI under a head word, found by man and which
ws.registerCli('slack', SLACK, { token: slackToken })
await ws.shell('slack send-message --channel general --text "report is up"')Real Examples
Five live Mirage terminals in the browser, one for each part.
- Virtual Filesystem. The strukto-ai/mirage repository on GitHub as a read-only VFS, searched with grep.
- Virtual CLIs. The DeepWiki MCP server installed as a virtual CLI, one subcommand per tool.
- Policies. Hidden files, denied commands and a policy script that asks first.
- Virtual Machines. Two Python interpreters, picked line by line by a route policy.
- Shell. Pipes, Python and a background job over two RAM filesystems.
Unified Virtual Filesystem
S3, Google Drive, Slack, Gmail and more in one unified virtual filesystem, read with ls, grep and jq.
Virtual CLIs
git, slack and ntn run inside the workspace, with nothing installed.
The
Shell
Pipes and redirection work across every VFS, CLI and script.
$ grep -rl VFS | Virtual CLI | Script
Virtual Machines
One shell drives many machines at once. Each command runs on the machine that fits it, from Monty in process to containers, cloud sandboxes and SSH hosts, and one pipeline can span several.
$ grep -rl VFS | Virtual CLI | Script
Machine
Policies
A scriptable policy engine decides whether each command runs, asks first or is refused, and where it runs.
Policy
$ grep -rl VFS | Virtual CLI | Script
Machine
Service Credentials and Notifications
Credentials come from an existing secret store, and outside changes arrive as changes to files.
CredentialsService Credentials
Policy
$ grep -rl VFS | Virtual CLI | Script
Machine
Profiles and Agents
Each agent runs under a profile that decides what it can see and do.
CredentialsService Credentials
Profile 1…
Policy
$ grep -rl VFS | Virtual CLI | Script
Machine
Portability
lives in a server, in a browser tab, or behind a real mountpoint.
CredentialsService Credentials
Agents & Harness
Profile 1…
Policy
$ grep -rl VFS | Virtual CLI | Script
Machine
Performance and Efficiency
AgentVFS's benchmark shows agents need far fewer tokens through a virtual filesystem than through MCP.
MCPRequests 0Tokens 0.00M
VFSRequests 0Tokens 0.00M
$
- Token reduction
- Up to 88%
- Average success rate increase
- +5.5%