Skip to main content

Mirage: A Virtual Terminal for AI Agents

Status: preview
Python docs
TypeScript docs

README in English 简体中文 README 繁體中文 README README en Français README auf Deutsch README Tiếng Việt README 한국어

Mirage is a Virtual Terminal for AI Agents. The virtual filesystem delivers broad data context, virtualized CLIs give an agent more flexibility on tool use, dynamic runtimes save underlying infrastructure cost and are more token efficient, and fine-grained control over an agent's actions and even over what it can see gives the best security. Together these parts form one virtualized terminal, giving the best agent performance, cost efficiency and security.

Mirage architecture: agents and harness reach profiles and the Mirage shell, which resolve Unix-like commands, virtual CLIs and programming languages onto runtimes and the virtual filesystem, with authentication, the policy engine and notifications alongside

Here is an example of launching Mirage inside an application:

ws = Workspace(
    {
        "/tmp":   (RAMVFS(), MountMode.EXEC),
        "/redis": (RedisVFS(url=redis_url), MountMode.WRITE),
        "/slack": (SlackVFS(SlackConfig(token=slack_bot_token)), MountMode.EXEC),
    },
    # monty captures python, so scripts run sandboxed inside the workspace
    runtimes=[MontyRuntime(captures=["python", "python3"]), "workspace"],
)

# one grep sweeps every source
await ws.shell("grep -rln session /redis /tmp")

# run a script that lives in Slack, file the report into Redis
await ws.shell("python3 /slack/channels/general_.../files/example__F....py > /redis/report.txt")

# install a typed CLI under a head word: dispatched by name, not by path,
# and discoverable through `man`, `type` and `which` like any other program
ws.register_cli("slack", SLACK, {"token": slack_bot_token})
await ws.shell('slack send-message --channel general --text "report is up"')

About

  • Unified virtual terminal interface, not N SDKs and M MCPs. Every backend speaks the same filesystem semantics, so pipelines compose across services.
  • A virtual filesystem over every source. S3, Google Drive, Slack, Gmail, Redis and the rest mount side by side under one root, so an agent reaches all of them through a unified interface with the unix tools it already knows, like ls, grep, find and jq.
  • Virtual command line tools (CLIs). git, slack and ntn are answered by Mirage itself, so an agent drives the service with nothing installed, across different runtimes and machines, and one tool can be virtualized into two or more, each under its own name with its own credentials.
  • Routed, dynamic runtimes. Python, JavaScript and any other command can be sent to a configured runtime, in process, sandboxed or remote, which decouples computation from storage and lets either change without touching the other.
  • The virtualized Mirage shell. It binds the filesystem, the CLIs and the runtimes into one command line, so pipes, redirection, variables, jobs and history work across all three.
  • Profiles designed for agents. allow, ask and deny govern commands and CLIs, while hide and show govern files and folders, so a hidden path is not merely unreadable but absent from the filesystem the agent sees.
  • A scriptable policy engine. A policy script can prohibit any dangerous action before it runs, and the same stack gates every VFS op and session write, so neither a file nor an environment variable leaks.
  • Notifications wired into the VFS and agents. External changes become an event stream on the mount, so a new Slack reply surfaces as a change to the chat file in the virtual filesystem, and the agent reacts to it instead of rescanning the tree.

Virtual Filesystem

Everything Mirage "mounts" as one unified virtual filesystem for AI agents. Each service sits side-by-side under a single root and answers the same POSIX semantics.

VFS
Object Storage Amazon S3  Cloudflare R2  Google Cloud Storage  Oracle OCI  Supabase Storage  MinIO  Ceph  SeaweedFS  Wasabi  Backblaze B2  DigitalOcean Spaces  Alibaba Cloud OSS  Tencent Cloud COS  Scaleway  QingStor  Hugging Face Buckets  GridFS
Files and Documents Google Drive  Google Docs  Google Sheets  Google Slides  OneDrive  SharePoint  Box  Dropbox  Nextcloud
Messaging and Work Slack  Discord  Gmail  IMAP / SMTP email  GitHub  Linear  Notion  Trello  Google Calendar
Databases and Data Platforms PostgreSQL  MongoDB  Redis Upstash Redis  LanceDB  Qdrant  Chroma  Mem0  Hugging Face Datasets  Hugging Face Models  Hugging Face Spaces  Databricks Volumes  Dify
Observability Langfuse  Jaeger
Local and Remote RAM  Disk  OPFS  SSH

Agents reach it through the Python and TypeScript SDKs, the mirage CLI, or a real mountpoint over FUSE and FSKit, then work it with the unix tools they already know, like ls, grep, find and jq.

Virtual Command Line Tool

These command line tools are virtualized: Mirage answers git, slack or ntn itself, so an agent drives the service without that program being installed on the machine. Each one mimics the real tool, so an agent that knows the CLI needs nothing new. Because they are virtual, the same tool can be installed more than once under different names, each with its own credentials, so every agent gets exactly the accounts it is given.

CLIs
Code git  gh
Communication slack  discord  himalaya
Work and Data linear  ntn  gws  hf

Virtual Runtime

Runtimes are virtualized the same way, and not only for coding languages. Any command on the line can be redirected to a configured runtime, so Python might run in-process with Monty while another command, say kubectl, is sent to a remote machine over SSH. Which runtime serves a given line can be decided by a scripted runtime router.

Runtimes
Python Monty  WASI CPython on wasmtime  Pyodide  sandlock  Host CPython
JavaScript QuickJS, serving node and js JavaScript TypeScript
Sandboxes Docker  E2B  Daytona  smolVM Apple Container  SSH

Security

A profile decides what a session may run and what it may see. Commands are governed by customizable allow, ask and deny rules, and paths by hide and show, so a hidden file is not merely unreadable but absent from the filesystem the agent sees. For anything those rules cannot express, a profile can name a policy script that runs at the gate on every command and answers allow, deny or ask itself, though like every rule it can only restrict and never grant. Separately, a host can register its own policies on the policy engine, an ordered stack the workspace consults on every command, VFS op and session write. See the policy docs.

Authentication

Credentials and authentication integrate with the stores secrets already live in, including AWS Secrets Manager, 1Password, Auth0 and dotenv, so an environment variable in Mirage can resolve straight to a credential held in one of them.

Sources
Built in Environment dotenv AWS Secrets Manager
Custom 1Password Auth0

Installation

  • Python ≥ 3.11 for the mirage-ai package and the mirage CLI
  • Node.js ≥ 20 for the TypeScript SDK

Python

uv add mirage-ai    # installs the `mirage` library and the `mirage` CLI binary

TypeScript

npm install @struktoai/mirage-node      # Node.js servers and CLIs
npm install @struktoai/mirage-browser   # browser / edge runtimes
npm install @struktoai/mirage-agents    # OpenAI / Vercel AI / LangChain / Mastra adapters

Both runtime packages pull in @struktoai/mirage-core automatically.

CLI

curl -fsSL https://strukto.ai/mirage/install.sh | sh
# or
npm install -g @struktoai/mirage-cli
# or
uvx mirage-ai
# or
npx @struktoai/mirage-cli

Quickstart

Python

from mirage import Workspace
from mirage.vfs.ram import RAMVFS
from mirage.vfs.s3 import S3Config, S3VFS

ws = Workspace({
    "/data": RAMVFS(),
    "/s3":   S3VFS(S3Config(bucket="my-bucket")),
})

await ws.shell("cp /s3/report.csv /data/report.csv")
await ws.shell("grep alert /s3/data/log.jsonl | wc -l")

await ws.snapshot("demo.tar")

TypeScript

import { Workspace, RAMVFS, S3VFS } from '@struktoai/mirage-node'

const ws = new Workspace({
  '/data': new RAMVFS(),
  '/s3':   new S3VFS({ bucket: 'my-bucket' }),
})

await ws.shell('cp /s3/report.csv /data/report.csv')
await ws.shell('grep alert /s3/data/log.jsonl | wc -l')

await ws.snapshot('demo.tar')

CLI

mirage workspace create ws.yaml --id demo
mirage shell --workspace_id demo --command "cp /s3/report.csv /data/report.csv"
mirage workspace snapshot demo demo.tar
mirage workspace load demo.tar --id demo-restored

Contributors

Thanks to everyone who has contributed to Mirage.

Mirage contributors

Metadata

Release files for mirage-ai 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mirage-ai 0.0.7
File Size Uploaded Provenance Actions
mirage_ai-0.0.7.tar.gz 3.6 MB Without provenance Details for mirage_ai-0.0.7.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mirage-ai 0.0.7
File Actions
mirage_ai-0.0.7-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for mirage_ai-0.0.7-cp311-abi3-win_arm64.whl
mirage_ai-0.0.7-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for mirage_ai-0.0.7-cp311-abi3-win_amd64.whl
mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_x86_64.whl
mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_aarch64.whl
mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
mirage_ai-0.0.7-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for mirage_ai-0.0.7-cp311-abi3-macosx_11_0_arm64.whl
mirage_ai-0.0.7-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for mirage_ai-0.0.7-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 56.8 MB

Release files / mirage_ai-0.0.7.tar.gz

Download URL mirage_ai-0.0.7.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
e7e9e6a69b388cc79c93eb6cb1e3fbd86b5b62f8b040f0aae6fd5a6360953f2b
BLAKE2b-256 checksum
How to use checksums
ad11b55a498b7c15c51c2b26ec8bd187e7a9f9a4d2c12805427ed8b94313eef3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-win_arm64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-win_arm64.whl
Size 6.6 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
73b0f1fe221c5334e9d31b615afbb88e534602f373f2235622a1138466393e9b
BLAKE2b-256 checksum
How to use checksums
857327ed58997aad9ba11af692bc0765aecd5bbf7c7b7a4514d49ada8fb78755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-win_amd64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-win_amd64.whl
Size 6.7 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4a354d6a243498703ebf32563ada84407e99987e7f4c81f7d9148c03cc23d25b
BLAKE2b-256 checksum
How to use checksums
7f220c877fccdf4f793dc76f36758246bd3b1806ca9850030de55e918e03cd02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_x86_64.whl
Size 6.9 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
64a9ae18c89f24e2b7b87e80bfd93186dc1a99669fe768e49fa5c73f4e54a9a0
BLAKE2b-256 checksum
How to use checksums
ffafd023ba667fb8f66c2183934320507e1f3bb4fe4d779f889067489e796c4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-musllinux_1_2_aarch64.whl
Size 6.8 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
f05fe3be3c1995cf2bae7818247dd1e8073944b2ccb086df7dafbe15f2bab6ec
BLAKE2b-256 checksum
How to use checksums
60a3fbb28a1e8b1f5c19d806d0e0a908c2f2346cced1a4b971cd832b23d283ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.7 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c2161dcf516b2419ea6ea6f55037f68e9b706d51b1f0fd143e7662b8f242487c
BLAKE2b-256 checksum
How to use checksums
827b2f4295ef8b3309f5a3d23a8a16dbc3c1c6649c460c231d3072b67a69ab7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.6 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5da1df2821f020e9409569589932827aaf9a1d0729104254d2f2eac0bb3ee52e
BLAKE2b-256 checksum
How to use checksums
224e28d7599495d4825e98fe09cd693a8cf0ab0e7b372a557ec43e0ad0663da3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-macosx_11_0_arm64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-macosx_11_0_arm64.whl
Size 6.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a4c8eb2177754228dbe6a1c87c6a669e76b26ff495cfa651c3c6a52ca87a837c
BLAKE2b-256 checksum
How to use checksums
a6a1a88c4dc9056eb4912c140054c62c764ed665df52a1ef1f020d0cda391c6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mirage_ai-0.0.7-cp311-abi3-macosx_10_12_x86_64.whl

Download URL mirage_ai-0.0.7-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.6 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
861ccdde9e8864210440017e11b3d3b29b6b877e8ceba2b2f971ac61720caea0
BLAKE2b-256 checksum
How to use checksums
a0fbfd55fb306b4052542a0dbfe71d112db9226c1491dd459a31fb6a57ad3315
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mirage-ai 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page