Gillsift
Back to site

Guide

Guard an MCP trading agent

Last updated 2 December 2026

An agent that trades on Robinhood Chain reads launchpad pages, stock-token news, social posts and tool replies, then calls a tool that moves value. This guide shows the two places where a gill belongs, using the same filter that runs in the lab.

Status. The hosted Filter API is coming as a free beta, and the SDKs are planned for January 2027. Until then, the open filter at assets/filter.js runs in the browser and in Node 18+ (save it as filter.mjs). It is a heuristic filter, not a guarantee: keep spending limits in the wallet too.

1 · Screen every tool reply

Whatever an MCP tool returns goes through the gill before the model sees it. A closed reply never reaches the model; it gets a short note instead.

import { judge } from "./filter.mjs";

async function callTool(name, args) {
  const reply = await mcp.callTool(name, args);       // e.g. get_news, get_token_page
  const text = reply.content.map(c => c.text ?? "").join("\n");
  const v = judge({ content: text, source: "mcp.output", action: "read" });
  if (v.state === "closed") return { text: `[blocked by Gillsift: ${v.closes} detectors closed]` };
  return { text, verdict: v.state };                  // "narrow" stays visible but is marked
}

2 · Judge again right before a trade

Before any tool that buys, sells, approves or signs, judge everything the agent read in this turn with the action it is about to take. Money-moving actions are judged strictly, so a single doubt is enough to stop the trade.

const TRADE = { buy: "transfer", sell: "transfer", approve: "approve", sign_order: "sign" };

async function beforeTool(name, args, readThisTurn) {
  const action = TRADE[name];
  if (!action) return true;                              // not a value-moving tool
  const v = judge({ content: readThisTurn.join("\n---\n"), source: "mcp.output", action });
  if (v.state !== "open") {
    log("trade stopped", name, v.state, v.detectors.filter(d => d.vote === "close").map(d => d.name));
    return false;                                        // narrow means read-only: no trade
  }
  return true;
}

Rules of thumb

Try it first

The lab has two Robinhood Chain style attacks ready: a launchpad token page with an invisible buy order, and a stock-token headline with a sell order hidden in an HTML comment. Open the lab, or check the numbers on the public benchmark.

Gillsift is an independent project. It is not affiliated with, endorsed by or sponsored by Robinhood. Tool names above are examples, not a real Robinhood API.