Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.7a3

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.7a3
File Size Uploaded Provenance Actions
mirage_ai-0.0.7a3.tar.gz 3.6 MB Without provenance Details for mirage_ai-0.0.7a3.tar.gz

Built distributions (wheels)

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

Total release size: 56.1 MB

Release files / mirage_ai-0.0.7a3.tar.gz

Download URL mirage_ai-0.0.7a3.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
6284c310315605001286898179b2d5ab6dd7ea7c0d55394d8501f6d84e953b85
BLAKE2b-256 checksum
How to use checksums
3adb330998d6c33319cdd2668fde49d295493bf7d6371ef4e4556e55e25b36ac
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.7a3-cp311-abi3-win_arm64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-win_arm64.whl
Size 6.5 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
88ceee57ed7240479ad28dcab37aafd1f83f6b15d211ebbe4e367b1290fbe28d
BLAKE2b-256 checksum
How to use checksums
bdec3326970a425681e087d1b730086f0578daca1825db709efe285c85fcfdfc
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.7a3-cp311-abi3-win_amd64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-win_amd64.whl
Size 6.6 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2e98c039f774a7a28e48ed5ff78a077decdb0fb9994da48b4d2a092165318015
BLAKE2b-256 checksum
How to use checksums
6b7a70a0ffbeb2efbb4cbda5f086fff96e2ea8ad0ef219a7d3b714986a39211d
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.7a3-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-musllinux_1_2_x86_64.whl
Size 6.8 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
477db40b23167572d228cb32323d604a60be59527ba87b7fe73e013bcab7e4f2
BLAKE2b-256 checksum
How to use checksums
bfc93f70062467a5de9df26ad66d73452990db4f201a19937df80bc26bb14676
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.7a3-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-musllinux_1_2_aarch64.whl
Size 6.7 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
9f7de26c5daced2668f1d7fcd0f589fc08a113556d015ce2e4dbdcb06bb30838
BLAKE2b-256 checksum
How to use checksums
e805954f28bef6e1c065a2b527c63168da7b91330fdd6d378d42158d763c77f8
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.7a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
064d022912578d9bacb73c27007a9463bd1756ce36dd8fb239bfc1b32d5bd95b
BLAKE2b-256 checksum
How to use checksums
656873e7c069acf046df778fdeeb96c85c159b8e9fd7b0c4b31f18418f5994a6
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.7a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.5 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
079c538ec01f21c2934f39f64611aad361f5a15ccc315b60f13cd1ac239c5124
BLAKE2b-256 checksum
How to use checksums
eb0a21d75d73197fee4ad596736eb89141e7274e2119ed6f524cc589ecadf869
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.7a3-cp311-abi3-macosx_11_0_arm64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-macosx_11_0_arm64.whl
Size 6.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
492728bcc4d63a7c4a2a3cc2be4476a0a77694458b63e32decb09f34dc75b945
BLAKE2b-256 checksum
How to use checksums
660cf827925391890e9c957891b318a7a61296a591e3e58489e22118efc14da2
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.7a3-cp311-abi3-macosx_10_12_x86_64.whl

Download URL mirage_ai-0.0.7a3-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8d6ab26b4653f0374de8e1f5574bf65f66b408991a7970f4981ba4f324271db7
BLAKE2b-256 checksum
How to use checksums
7d86fef93f8a3451c16878330705a280fbcff050981a1649a349fbc8d0f24d49
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.7a3

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