Home › Build an AI agent › TAS Guard

TAS Guard: limits for AI agents that trade real money

A free, open-source proxy that sits between your AI client and any broker or exchange MCP server. It reads each order before it reaches your account: blocks orders over your limits, asks you before large or live-money orders, and gives you a kill switch and an audit log.

Get it on GitHubQuick start

Why it exists

Of the 14 official broker MCP servers we track, 6 let an AI agent place orders directly and 4 make approval optional (research). Generic MCP gateways can flag "create order" as risky, but they can't tell a $50 order from a $50,000 one. TAS Guard reads the order itself: symbol, side, size and price, including option contract multipliers and exchanges that preview before they fill.

What it does

Connectors where a guard matters most

Broker MCP servers that let an agent trade without a per-order confirmation, from our sourced listings:

ConnectorSafetyWho places the orderTAS Guard
Alpaca MCP ServerSafety 68%AI trades directlyVerified profile
Longbridge MCPSafety 68%AI trades directlyHeuristic mode
NinjaTrader MCP (beta)Safety 58%AI trades directlyHeuristic mode
moomoo MCPSafety 58%AI trades directlyHeuristic mode
Public Hosted MCP ServerSafety 17% (partial)AI trades directlyHeuristic mode
Tradier MCP ServerSafety 50%AI trades directlyHeuristic mode
Interactive Brokers AI Integration (MCP)Safety 71% (partial)Approval optionalHeuristic mode
Robinhood Trading MCPSafety 71% (partial)Approval optionalHeuristic mode
Axi MCP (MT5)Safety 72% (partial)Approval optionalHeuristic mode
CCXT MCP ServerSafety 80% (partial)Approval optionalVerified profile

Quick start (Alpaca, paper trading)

On Windows with Claude Desktop? Follow the step-by-step Windows guide: two copy-paste scripts, tested with an Alpaca paper account.

Needs Node 18+ and uv. Install Alpaca's server once with uv tool install alpaca-mcp-server, then save this as alpaca.json. Keep your API keys in this file rather than in your AI app's settings: some apps keep their own copy of server settings, and keys in the guard file always win. (${VAR} values are read from the environment if you prefer.)

{
  "name": "alpaca",
  "profile": "alpaca-mcp-server",
  "upstream": {
    "command": "alpaca-mcp-server",
    "args": [],
    "env": {
      "ALPACA_API_KEY": "PK...your paper key",
      "ALPACA_SECRET_KEY": "...your paper secret",
      "ALPACA_PAPER_TRADE": "true"
    }
  },
  "policy": {
    "max_order_value": 500,
    "max_daily_value": 2000,
    "approve_over": 250,
    "symbols_allow": [
      "SPY",
      "QQQ",
      "AAPL"
    ]
  }
}

Then point your MCP client at the guard instead of at Alpaca. Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "alpaca": {
      "command": "npx",
      "args": [
        "-y",
        "tas-guard",
        "run",
        "--config",
        "/path/to/alpaca.json"
      ]
    }
  }
}

Claude Code: claude mcp add alpaca -- npx -y tas-guard run --config ~/alpaca.json. Ask the agent to call tas_guard_status to see its limits.

Your controls

npx tas-guard pending           # actions waiting for you
npx tas-guard approve <id>      # approve one (the agent repeats the call)
npx tas-guard kill              # stop all new orders now
npx tas-guard resume
npx tas-guard log --tail 20     # what happened
npx tas-guard verify-log        # check the log wasn't edited

Connector profiles (open data)

A profile records what each tool of a connector can do with money and where its order fields live, checked against the connector's source code. They're published as JSON under the same CC BY 4.0 terms as our dataset:

Schema: connector-profile.v1.json. Index: /data/profiles/index.json. Profiles for more brokers are welcome as pull requests on GitHub.

Limits of the guard

TAS Guard is made by TradingAgentStack. It is our own tool, so it never affects safety scores or rankings. Version 0.1.1, MIT license.

FAQ

Is TAS Guard free?

Yes. It's open source under the MIT license: github.com/intoApex/tas-guard. It runs on your own computer, and your API keys never leave it.

Does it replace my broker's own safety controls?

No. It adds a second layer you control. Keep the broker's paper mode, read-only scopes and a separately funded account; the guard limits what an agent can do within them.

Can the AI agent turn the guard off or approve its own orders?

Approvals go to you through your AI app's own prompt, or through a command you run. The agent gets no tool to approve, change limits or switch off the kill switch. If your agent can run terminal commands, rely on the in-app prompt and tight hard limits; the README explains why.

Which brokers does it work with?

Any MCP server. 2 connectors have verified profiles (Alpaca MCP Server, CCXT MCP Server); for others it classifies tools by name and blocks anything it doesn't recognize.

Does TradingAgentStack see my trades?

No. The guard runs locally and sends nothing to us. The audit log stays on your machine.

Does using TAS Guard change a tool's safety score?

No. Safety scores describe what each connector can do on its own, from its official docs. The guard is our own tool and never affects scores or rankings.

More in Build an AI agent

Other paths: Trade with a bot · Markets & infrastructure · Learn · Search all tools

Get the weekly AI-trading stack update

New MCP servers, broker and data API changes, and safety notes. One email a week, unsubscribe anytime.

No spam. Unsubscribe anytime. Privacy