NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

Add cryptographic message signing for MCP tool calls (MCPS)

Open razashariff opened this issue 8 months ago • 2 comments

NemoClaw's OpenShell sandbox provides strong process-level isolation -- nice work on the runtime security model.

However, there are attack vectors that sandbox isolation alone doesn't cover:

  1. Replay attacks -- an intercepted tool call can be replayed to a different server instance
  2. Tool poisoning -- tool descriptions modified in transit (prompt injection via altered tool metadata)
  3. Agent impersonation -- no cryptographic proof that a tool call came from an authorized agent
  4. Response tampering -- tool responses can be modified between server and agent
  5. Rogue server injection -- a compromised MCP server can join a cluster undetected

These are protocol-level threats that exist regardless of how locked-down the sandbox is.

Proposed addition:

  • ECDSA P-256 message signing on every MCP JSON-RPC message
  • Nonce + timestamp for replay protection
  • Tool attestation (signed tool hashes to detect poisoning)
  • Agent identity via cryptographic passports

We built this as an open-source npm package: mcp-secure (zero dependencies, ~4KB). IETF Internet-Draft submitted: draft-sharif-mcps-secure-mcp.

I would be happy to contribute an integration if there's interest. The signing layer sits above transport and below application logic -- fully compatible with existing MCP servers including NemoClaw's OpenShell runtime. Supporting NemoClaw for improved security and the industry.

razashariff avatar Mar 17 '26 12:03 razashariff

Following up — MCPS has shipped framework integrations since this was filed. The core signing library is on npm and PyPI, with drop-in MCPS packages for CrewAI (crewai-mcps) and LangChain (langchain-mcps).

Also integrated MCPS alerting with Microsoft Defender for Cloud and Azure Sentinel — MCP threat events (tool poisoning, replay attacks, credential access) push directly to SOC consoles via Graph Security API and Log Analytics.

MCPS IETF draft is progressing: draft-sharif-mcps-secure-mcp

If there's interest in a NemoClaw-specific MCPS integration, happy to work on it.

razashariff avatar Mar 21 '26 14:03 razashariff

We have a working implementation of this: Signet signs every tools/call at the transport layer with Ed25519.

Mechanically: it wraps StdioClientTransport, intercepts outbound tools/call requests, and injects a signed receipt into params._meta._signet containing tool name, params hash, timestamp, agent pubkey, and signature. MCP servers ignore unknown _meta fields, so it's backward-compatible with no server changes.

One design choice worth discussing: we sign at dispatch (client-side), which covers origin authentication but not response integrity. If NemoClaw needs bilateral signing, the receipt schema is extensible — a server-side co-signature field is spec'd but not yet shipped. Happy to align on schema if there's interest in a shared standard.

willamhou avatar Apr 02 '26 08:04 willamhou