Skip to main content

agentenv-vfs

tests

An agent-env plugin that gives an agent any env's tools through agentvfs: a shell in a Mirage workspace, where each of the env's MCP tools is a command of the same name, instead of MCP tool calls.

$ add_note --title "Budget sync" --body "Q3 budget is flat" --tags finance
{"id": 2, "title": "Budget sync", ...}
$ list_notes | jq -r '.[] | select(.tags | index("finance")) | .title'
Budget sync

It works with any env that serves MCP tools, a plain MCP server or a gateway env, and needs no change to the env, its tasks' other steps or agent-env itself.

Install

uv tool install --python 3.12 agentenv-framework --with agentenv-vfs
agent-env vfs --help

Or pip install agentenv-vfs into an environment of your own, which brings agent-env with it. Pin a release with agentenv-vfs==<version>: wrap points bundles at the server image of the same version.

You need Docker, as for any local agent-env run.

Use it on a bundle

agent-env vfs wrap my-bundle --out my-bundle-vfs
agent-env run my-bundle-vfs

wrap copies the bundle and, in each task, puts an agentvfs env in front of the agent's envs:

  • a deploy_env of agentvfs names the envs it fronts (env_params.env, one id or a list) and the agent's role, and waits for those envs, for the tool locks on the role that come before the agent's work, and for whatever the agent's own deploy waits for (a lock applied later, such as a colleague frozen after the prompt, the env enforces as it comes);
  • the agent's env_ids become ["agentvfs"], and its built-in tools go off (builtin_tools: {"disable": "*"});
  • the agent's instructions gain one paragraph on working through commands (--no-note leaves them as they are).

After the steps that send the agent work, a step copies the agentvfs env's log of the agent's shell lines and the tool calls each made into the run's record, as script_results.agentvfs_calls (--no-call-log leaves it out). Every other step (other agents, judges, verifiers) is kept as it is. Keep the agent's built-in tools with --keep-builtins (see Agents for which agents can have them turned off).

Choosing the agents

The agent to wrap is the one the tasks prompt. Name others with --agent, by their agent_name, once per agent:

agent-env vfs wrap my-bundle --out my-bundle-vfs --agent judge --agent judge-b   # only the judges work through agentvfs

Any agent a deploy_agent deploys can be wrapped, whatever sends it work:

The agent Its paragraph goes in Its log is copied
prompted by prompt_agent steps their system_prompt after its prompts
a judge for verifier steps their grading_policy_prompt (a configured system prompt would replace the agent's own) after those verifiers
sent work some other way, such as by an env's triggers its deploy_agent system_prompt, if it has one at the end of the run

Each wrapped agent gets its own agentvfs env, so two agents of one role (two judges, say) don't share a workspace. With one agent wrapped its env is agentvfs and its log agentvfs_calls; with several, each agent's env is agentvfs-<agent> and its log agentvfs_calls_<agent>.

To wire tasks yourself, add the env with agent-env vfs add-env my-bundle and deploy it after the env it fronts:

{"id": "vfs", "type": "deploy_env", "env_id": "agentvfs", "env_params": {"env": "notes", "role": "alice"},
 "depends_on": ["env"]},
{"id": "agent", "type": "deploy_agent", "env_ids": ["agentvfs"], "builtin_tools": {"disable": "*"},
 "depends_on": ["vfs"]}

examples/notes is a small bundle to try it on: a notes env, a task, and a check that reads the notes back. examples/notes-and-contacts gives one agent two envs, which wrap fronts from one workspace.

Agents

It works with any agent-env agent: agentvfs is an env, and the agent reaches it over MCP as it reaches any env. Pass wrap --for-agent NAME when you run with agent-env run --agent NAME, so the bundle fits that agent:

Agent Built-in tools Checked with
claude-code (the default), codex, opencode, antigravity (agent-env 0.9.1650+) turned off: the shell is the agent's only tool the notes example; claude-code and codex on a gateway env's tasks too
gemini, hermes, letta-code, openhands, pi kept: agent-env can't turn them off the notes example; gemini on a gateway env's task too
pydantic-ai kept not yet: its own coding tools include one named shell, which agent-env adds MCP tools beside without a prefix

How it works

  • One tool. The agent's only tool is shell, a bash line in its role's workspace. /SKILL.md lists the commands, <command> --help shows one, and /workspace and /tmp are its own. python3 is CPython in Pyodide, inside the workspace: its standard library, the workspace's files and commands, no network. curl and wget are refused: the env is reached through its commands.
  • Commands are the envs' tools. One workspace serves the tools of every env it fronts, each call going to the env that serves its tool; two envs that serve a tool of the same name are refused. Each tool is a command named as the tool is, each parameter a flag of the same name (--channel_id, or --channel-id); a list or an object is one JSON value. The shell tool's description lists every command for the role named at deploy, so the agent sees them up front, as it would see MCP tools.
  • Calls go to the env as the agent. A command's call goes to the fronted env's MCP endpoint with the agent's AgentEnv-Role, which the agent sends with every call. So the env sees the calls an MCP agent of that role would make: its tool locks, triggers and logs all apply, and each role gets its own workspace. A tool locked for the role when its workspace opens is no command there; one locked later is refused by the env, as it would be over MCP (the integration test checks both).
  • What a run keeps. The env logs every shell line and every tool call a line makes (role, tool, arguments, outcome, timing), in order, and what each role was shown: the commands its workspace has, and the length of the shell description that lists them. data/get of calls.jsonl returns it, and the step wrap adds copies it into the run, with a summary per role (shown: its commands, its description's length, and how many of its lines read /SKILL.md or asked for --help).
  • Where it runs. The env is an MCP server env. Its image (Python, Node 24, Mirage's npm packages and Pyodide) is published at ghcr.io/earakely-scale/agentenv-vfs, tagged with the plugin's version, for linux/amd64 and linux/arm64. A wrapped bundle pulls it, and keeps its build context in envs/agentvfs, which a deploy builds only where it can't pull the image (--build always builds it). The env reaches the fronted env at the address agent-env gives for its sandbox. Checked locally (Docker) and on Modal (agent-env run --sandbox modal), where the image is pulled and the fronted envs are reached over their Modal tunnels.

Not covered yet

  • Python packages beyond the standard library (Pyodide fetches them from the network, which the workspace refuses).
  • Mounting an env's data as files: reads are commands, as writes are.
  • Waiting for the world: a shell-only agent waits with sleep.
  • Remote sandbox providers other than Modal have not been tried.

Development

uv venv && uv pip install -e . 'agentenv-framework>=0.9.1637' pytest
.venv/bin/python -m pytest tests            # unit tests
PATH=.venv/bin:$PATH tests/integration/run.sh  # the server image against a plain MCP server (Docker)

Releasing

Set version in pyproject.toml, push to main, then tag v<version> and push the tag. The image workflow publishes ghcr.io/earakely-scale/agentenv-vfs:<version>, which wrap of that version points bundles at, and the publish workflow publishes the package to PyPI through trusted publishing (no token).

License

Apache-2.0. Parts are adapted from agentvfs/vfs-bench (MIT); see NOTICE.

Metadata

Release files for agentenv-vfs 0.5.1

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

Source distribution (sdist)

Source distribution for agentenv-vfs 0.5.1
File Size Uploaded Provenance Actions
agentenv_vfs-0.5.1.tar.gz 63.4 kB With provenance Details for agentenv_vfs-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentenv-vfs 0.5.1
File Interpreter ABI Platform Actions
agentenv_vfs-0.5.1-py3-none-any.whl Python 3 none any Details for agentenv_vfs-0.5.1-py3-none-any.whl

Total release size: 119.5 kB

Release files / agentenv_vfs-0.5.1.tar.gz

Download URL agentenv_vfs-0.5.1.tar.gz
Size 63.4 kB
Tags Source
SHA-256 checksum
How to use checksums
83e51d5536b34bbeef3d18d212b6105eae7d417a0045ae7cf8fc01f68720106e
BLAKE2b-256 checksum
How to use checksums
a86569529849e7352eebcfa0e7167f699bd149f3aa7039b5fd886f5b7a2639e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / agentenv_vfs-0.5.1-py3-none-any.whl

Download URL agentenv_vfs-0.5.1-py3-none-any.whl
Size 56.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f9ca518b74ffa50d1094ee3d8c67c30c87c7795f351679adba88ea086d6d3a1
BLAKE2b-256 checksum
How to use checksums
e2e3cdc5c33993c3128c356031eceb9495253408ec870014acbc48cd001ec364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for agentenv-vfs 0.5.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agentenv_vfs-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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