Skip to main content

Ghost Mode

See what your AI agent would do, without letting it do anything.

Standalone package extracted from the UNWIND monorepo (250+ commits, 1,859 tests). Full development history lives there.

Ghost Mode is a safe first step before giving an AI agent real authority.

It's a zero-config dry-run layer for AI agents. It intercepts every write and lets reads through. Think of it as a flight simulator for AI agents — nothing gets modified, but you see everything the agent tried to do.

Requires Python 3.9+.

Quick Start

MCP Client Users (Claude Desktop, Cursor, etc.)

pip install ghostmode
ghostmode -- npx @modelcontextprotocol/server-filesystem ~/Documents

Point your agent at Ghost Mode instead of the real server. When the session ends, a summary is written to ghostmode-summary.txt in your working directory (or your home directory if that isn't writable) and printed to stderr.

OpenClaw Users

# 1. Install Ghost Mode
pip install ghostmode

# 2. Install the OpenClaw plugin
openclaw plugins install @unwind/ghostmode-openclaw

# 3. Restart the gateway

Ghost Mode hooks into OpenClaw's tool-call system. Every write is intercepted. Every read passes through.

What it does

Ghost Mode intercepts state-modifying tool calls — file writes, deletions, emails, API posts, shell commands — and returns fake success responses. The agent thinks it completed the action. Your filesystem, email, and APIs are untouched.

A shadow virtual filesystem keeps the agent consistent: if it "writes" a file and then reads it back, Ghost Mode serves the written content from memory. The agent doesn't know it's in a sandbox.

Example output

=======================================================
  GHOST MODE SESSION SUMMARY
=======================================================
  Duration:     47.3s
  Total events: 12
  Intercepted:  4 writes blocked
  Passed:       7 reads forwarded
  Shadow reads: 1 served from VFS

  Files the agent tried to write:
    /home/user/Documents/report.md
    /home/user/Documents/summary.txt

  Files the agent tried to delete:
    /home/user/Documents/old_draft.md

  4 write(s) were blocked. Nothing was modified.

  Full timeline:
  14:23:01  [PASSED]  fs_read  /home/user/Documents/notes.txt
  14:23:02  [PASSED]  fs_list  /home/user/Documents
  14:23:03  [BLOCKED] fs_write /home/user/Documents/report.md
  14:23:04  [SHADOW]  fs_read  /home/user/Documents/report.md
  14:23:05  [BLOCKED] fs_delete /home/user/Documents/old_draft.md
  14:23:06  [BLOCKED] send_email
  14:23:07  [PASSED]  fs_read  /home/user/Documents/config.json
=======================================================

Use cases

Testing untrusted tools. Install a new MCP server and see what it actually does before giving it real access.

Reviewing agent behaviour. Let your agent plan and "execute" a complex task, then review the timeline before running it for real.

Demos and training. Show stakeholders what an AI agent workflow looks like without risking real data.

Compliance dry runs. Verify that an agent workflow stays within policy boundaries before going live.

What Ghost Mode is not

Ghost Mode does not enforce policy or provide rollback. It is a visibility tool, not a security system. If you need enforcement, audit trails, or recovery, that's what UNWIND is for.

CLI options (MCP proxy mode)

ghostmode -- <upstream command>        Basic usage
ghostmode -v -- <command>              Verbose: log every action to stderr
ghostmode --export log.json -- <cmd>   Export session log on exit
ghostmode --also-block my_tool -- ...  Add custom tool names to intercept
ghostmode --allow my_tool -- ...       Pass an unknown read-only tool through

How it knows what to block

Ghost Mode recognises 50+ common MCP tool names as state-modifying (filesystem writes, email sends, API posts, shell commands, database mutations, git operations). It also uses prefix heuristics: any tool starting with create_, delete_, send_, write_, execute_, etc. gets intercepted. Anything else is only passed through if it is known to be read-only: either the server marks it with the MCP readOnlyHint annotation, or its name starts with read_, get_, list_, search_, fetch_ and similar. Unknown tools are blocked by default, and listed in the session summary.

  • If a read-only tool is being blocked, use --allow tool_name to pass it through.
  • If a tool slips through, use --also-block tool_name to add it.

Keeping the agent consistent

For filesystem servers (including @modelcontextprotocol/server-filesystem), the shadow VFS keeps everything the agent sees in line with what it "did": edited files read back with the edit applied, moved files appear at their new path and are gone from the old one, and new files and directories show up in list_directory, directory_tree, search_files, get_file_info and read_multiple_files. Real file contents are fetched through the upstream server, so its own access rules still apply.

Zero dependencies

Ghost Mode has no external dependencies. It uses only Python 3.9+ stdlib (asyncio, json, pathlib). It installs in under a second.

Known limitations

Shell commands can't see ghost-written files. If the agent writes a file through Ghost Mode and then tries to run it via bash_exec or shell_exec, the shell will fail because the file only exists in the in-memory shadow VFS, not on disk. Ghost Mode works best for tool-call-level dry runs, not multi-step build/execute workflows.

Moved directories appear empty. Moving a real directory shows it at the new path, but its contents are not mirrored there.

Session summary in background clients. Claude Desktop and Cursor run MCP servers in the background and may not surface stderr output. Ghost Mode automatically writes a ghostmode-summary.txt file to your working directory on exit (falling back to your home directory), whether the client disconnects or stops the server with a signal. You can also use --export log.json for a machine-readable session log.

Want more?

Ghost Mode shows you what happened. UNWIND lets you control it:

  • 15-stage enforcement pipeline (path jail, SSRF shield, DLP, canary honeypots)
  • Smart snapshots with one-command rollback
  • CRAFT tamper-evident audit chain
  • Real-time trust light dashboard
  • Detects encoded/obfuscated data exfiltration attempts
pip install unwind-mcp

github.com/unwind-mcp/unwind

License

MIT

Metadata

Release files for ghostmode 0.2.0

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

Source distribution (sdist)

Source distribution for ghostmode 0.2.0
File Size Uploaded Provenance Actions
ghostmode-0.2.0.tar.gz 28.9 kB Without provenance Details for ghostmode-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghostmode 0.2.0
File Interpreter ABI Platform Actions
ghostmode-0.2.0-py3-none-any.whl Python 3 none any Details for ghostmode-0.2.0-py3-none-any.whl

Total release size: 50.0 kB

Release files / ghostmode-0.2.0.tar.gz

Download URL ghostmode-0.2.0.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
881fdf6bf8fdc5d7d269666d2f9b84c24f69b39d388e3d0cc8ccdcc5dffb7e75
BLAKE2b-256 checksum
How to use checksums
42a1843d502189c4419440047e77f3ff20fd70bbb707aeb9bec83294dbfb4fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ghostmode-0.2.0-py3-none-any.whl

Download URL ghostmode-0.2.0-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9357371486b85e3f1ebc8a09ed369fa8f24de4e7c652aa67fa10f022d5871272
BLAKE2b-256 checksum
How to use checksums
24dd981a74e6d32448704137b4451f4bdb0027b1d039e19220a2d3b83f970d45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for ghostmode 0.2.0

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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