cd /news/ai-agents/in-memory-privacy-shield-to-prevent-… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-153809] src=github.com β†— pub= topic=ai-agents verified=true sentiment=↑ positive

In-memory privacy shield to prevent context leaks in MCP tools

Rohan Protocol released version 0.6.0 of its open-source Model Context Protocol server, published on npm as @rohan-protocol/mcp, which evaluates MCP tool-call arguments in isolated client RAM and uses V-02 deterministic memory zeroization (zeroize) so plaintext parameters such as API keys and database passwords never enter the LLM context window. The public beta also enforces client-side RAM witness isolation and V-01 semantic policy firewalls, while native client-side WASM ZK-SNARK proving circuits remain under research as Milestone 1. The server exposes a single tool, rohan_zk_handshake, which strips prompt injections, generates a 32-byte intent commitment and anchors state transitions gaslessly to Midnight, and can be added to Claude Desktop via npx.

read4 min views1 publishedOct 20, 2026
In-memory privacy shield to prevent context leaks in MCP tools
Image: Michielbdejong (auto-discovered)

The in-memory security proxy preventing LLM context leaks, credential exfiltration, and prompt injections during tool execution.

πŸ“¦ Official Open-Source MCP Server Monorepo

The core Model Context Protocol (MCP) server implementation is located directly in this repository at packages/mcp/ and distributed on npm as @rohan-protocol/mcp.

Run from Source β€’ MCP Tools β€’ Client Setup β€’ Architecture β€’ Security

⚠️ Public Beta (v0.6.0): Rohan currently enforces client-side RAM witness isolation, V-01 semantic policy firewalls, and V-02 deterministic memory zeroization (zeroize) to shield MCP tool calls while native client-side WASM ZK-SNARK proving circuits are under active research (Milestone 1).

The Model Context Protocol (MCP) connects autonomous agents to tools. However, transport encryption (TLS) only protects data in flight β€” at the host boundary, standard MCP tools execute in cleartext:

πŸ”΄ WITHOUT ROHAN (Standard MCP)
Agent calls tool βž” { "api_key": "sk_live_...", "db_password": "secret" } in plaintext
                 βž” Leaked directly into LLM conversation context & inference logs
                 βž” Permanent risk of context exfiltration & prompt injection

🟒 WITH ROHAN SHIELD
Agent calls tool βž” Arguments evaluated strictly in isolated client RAM
                 βž” V-02 Zeroize wipes witness memory immediately from volatile memory
                 βž” Zero plaintext parameters ever enter the model context window

This repository contains the complete open-source MCP server implementation. You can clone and run the server locally over standard stdio:

git clone https://github.com/rohan-protocol/sdk.git
cd sdk

npm install
npm run build

node packages/mcp/dist/server.js

Or run directly via npx without cloning:

npx -y @rohan-protocol/mcp@latest

The @rohan-protocol/mcp server registers standard Model Context Protocol tool endpoints over JSON-RPC:

MCP Tool Description Input Parameters
rohan_zk_handshake Evaluates tool execution parameters in ephemeral RAM, strips prompt injections, generates a cryptographic 32-byte intent commitment, and anchors state transitions gaslessly to Midnight. targetAgentId (string),intent (string),privatePayload (object)

Add rohan-shield to your claude_desktop_config.json:

{
  "mcpServers": {
    "rohan-shield": {
      "command": "npx",
      "args": ["-y", "@rohan-protocol/mcp@latest"],
      "env": {
        "ROHAN_RELAYER_URL": "https://api.rohanprotocol.network/api/v1/handshake"
      }
    }
  }
}
  1. Navigate to Settings β†’ Features β†’ MCP Servers β†’ Add New MCP Server .
  2. Set the name to rohan-shield .
  3. Set the type to command .
  4. Use the command: npx -y @rohan-protocol/mcp@latest
rohan-protocol/sdk
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ mcp/         # πŸ€– The Official Model Context Protocol (MCP) Server (Stdio)
β”‚   β”œβ”€β”€ sdk/         # βš™οΈ Core in-memory commitment engine & relayer client
β”‚   └── webmcp/      # 🌐 React / Next.js browser hooks with V-07 DOM isolation
β”œβ”€β”€ contracts/       # πŸ“œ Midnight Compact smart contracts (rohan_handshake.compact)
└── README.md
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           AUTONOMOUS AGENT RUNTIME                          β”‚
β”‚               Claude Desktop / Cursor IDE / Custom Agent Workflows          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚ Tool Execution (JSON-RPC)
                                       β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                  [@rohan-protocol/mcp] SERVER (packages/mcp)              β”‚
 β”‚  β€’ Stdio MCP Protocol Server: Compliant with Anthropic MCP Specification  β”‚
 β”‚  β€’ V-01 Semantic Firewall: Filters hidden Unicode & prompt injections     β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚ In-Memory Witness
                                       β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                  [@rohan-protocol/sdk] ENGINE (packages/sdk)              β”‚
 β”‚  β€’ Ephemeral RAM Commitment (32-Byte Intent Hash)                         β”‚
 β”‚  β€’ V-02 Deterministic Zeroize: Overwrites buffers immediately in memory   β”‚
 β”‚  β€’ ZERO disk writes. ZERO swap-file exposure.                             β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚ Streamable HTTP (NDJSON)
                                       β”‚ received βž” approved βž” proving βž” anchored
                                       β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                       ROHAN RELAYER PAYMASTER                             β”‚
 β”‚  β€’ Gasless Transaction Sponsoring ($tDUST covered automatically)          β”‚
 β”‚  β€’ Scale-to-Zero Native (No persistent SSE connection bottlenecks)        β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚ Immutable Replay Protection
                                       β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                      MIDNIGHT BLOCKCHAIN LEDGER                           β”‚
 β”‚  Contract: rohan_handshake.compact (Preprod: 585ac0c4448257507d8ffa2a...) β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Threat ID Threat Vector Mitigation Mechanism
V-01 Adversarial Prompt Injection Pre-Prover Semantic Firewall: intercepts out-of-bounds payloads and strips zero-width Unicode injection characters ([\u200B-\u200D\uFEFF]).
V-02 Residual Heap Exfiltration Deterministic Memory Zeroize: multi-pass volatile memory wiping overwriting witness buffers with deterministic 0x00 byte patterns.
V-05 Persistent Socket Exhaustion Scale-to-Zero NDJSON: uses chunked Streamable HTTP instead of long-lived SSE connections, allowing proxies to spin down on idle.
V-07 DOM / WebWorker Scraping WebMCP Thread Isolation: isolates execution buffers inside WebWorkers, shielded from malicious third-party browser extensions.

The cryptographic foundations, threat registers, and formal mathematical proofs are documented in our research paper:

Rohan: A Stateless Zero-Knowledge Trust Gateway for Privacy-Preserving Agentic Workflows via Streamable HTTP

Model Context Protocol Working Group & Rohan Protocol Lab

Published via Zenodo / IEEE Spec v2.0 β€’ DOI: 10.5281/zenodo.22730240

We build in the open.

  • πŸ› Found a bug or bypass vector? Open a GitHub Issue.
  • ⭐️ Support: consider starring the repository to help other developers discover privacy-first MCP tools.

<sub>Licensed under the</sub>

── more in #ai-agents 4 stories Β· sorted by recency
── more on @rohan protocol 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/in-memory-privacy-sh…] indexed:0 read:4min 2026-10-20 Β· β€”