SuperAPI AI Directory

tas-guard

tas-guard is an open-source trading guardrail launched by TradingAgentStack, used to add a layer of fund safety control between AI agents, bots and their brokerage MCP servers or EVM wallets. It runs locally, and before an order or transaction is sent it can enforce per-transaction and daily limits, trading symbol and contract allowlists, human approval, an emergency stop switch, and record a tamper-proof audit log. It supports MCP connectors such as Alpaca, ccxt, and Robinhood, and also provides an EVM on-chain JSON-RPC mode, Solana transaction simulation interception, and a Hyperliquid direct connection mode. The project has zero dependencies and about 4,600 lines of pure JavaScript, suitable for limiting fund risk when letting Claude, ChatGPT, Cursor, or a self-built bot trade on your behalf.

Open website

About this tool

tas-guard is an open-source guardrail for AI agents and trading bots that "move money", maintained by TradingAgentStack. It is deployed between trading software (such as Claude, ChatGPT, Cursor, a self-built agent or bot) and brokerages, exchanges, or wallets, and enforces fund safety policies before an order or transaction is actually sent. The project runs locally, has zero dependencies, and is about 4,600 lines of pure JavaScript.

Main capabilities

  • Limit control: supports per-transaction caps, daily cumulative caps, and per-minute and daily order count caps; hard limits cannot be bypassed through human approval.
  • Allowlists: allowlists can be set by trading symbol, direction, chain, contract, recipient, etc., with wildcard support.
  • Human approval: when an order amount exceeds the threshold, the amount is unknown, a new recipient is involved, or a token approval is involved, approval is requested from a human rather than from the agent.
  • Emergency stop: the kill switch can block all sending and signing, while reads, order cancellations, and position closes still work.
  • Audit log: every decision is appended to ~/.tas-guard/audit.jsonl, including tool, category, redacted parameters, decision, reason, order amount, and whether it was executed, with each line carrying the hash of the previous line.
  • Connector configuration: built-in verified configurations for MCP servers such as Alpaca, ccxt, and Robinhood, describing each tool's fund capabilities and where order fields are located; when there is no configuration, auto mode can classify by name and MCP annotations, and by default blocks unrecognized tools.
  • EVM on-chain mode: tas-guard rpc provides a local JSON-RPC endpoint, parses calldata selectors, identifies native transfers, ERC-20/721/1155 approvals, Permit2, etc., and enforces chain allowlists, limits, unlimited-approval interception, pre-check revert checks, and human approval.
  • Solana mode: simulates each transaction, intercepts drainer-type patterns (hidden delegation, account takeover), abnormal priority fees, and over-limit transactions, and supports setting limits by program.
  • Hyperliquid mode: trades directly on Hyperliquid without needing another MCP server, signs with an API wallet that can only trade and cannot withdraw, and charges a 0.02% builder fee.
  • Telegram mobile approval: receives pending approval operations through a self-built bot, providing approve/reject buttons, interception alerts, /status, /pending, /kill, /resume commands; only accepts operations from your own account.

Usage

  • Quick trial: npx tas-guard demo runs the guardrail in front of a built-in simulated brokerage, and can be connected to AI applications as an MCP server.
  • MCP mode: write a configuration file (such as ~/tas-guard/alpaca.json) and point the MCP client at the guardrail instead of the brokerage; you can also use npx tas-guard run --profile alpaca-mcp-server -- uvx alpaca-mcp-server to use the default policy.
  • Approval: clients that support elicitation will pop up a human confirmation; otherwise use npx tas-guard approve <id> or deny <id>, and each approval is valid only for the current call and is valid for 15 minutes.
  • On-chain mode: point the agent's RPC URL at the local endpoint (such as http://127.0.0.1:8547),可用 npx tas-guard rpc-demo for a chainless, keyless experience.
  • Phone approval: follow the guide to create a Telegram bot, save the token and chat id to the config, and restart the AI application.

Use cases Suitable for users who want an AI assistant or automation bot to place orders on their behalf, manage EVM wallet transactions, send transactions on Solana, or trade directly on Hyperliquid, while limiting per-transaction and daily fund exposure, requiring manual confirmation for large amounts, and keeping auditable records.

Limitations Cannot protect custodial bots that store keys on their own servers (such as most Telegram trading bots), nor bots that bypass the guardrails and call exchange APIs directly. On-chain mode requires a configured wallet and cannot prove the original transaction signer via secp256k1 public key recovery; the precheck is only a revert check, not a full simulation; generic contract calls are priced only by native coin value, and tokens transferred inside the call are not counted toward the USD limit; prices come from static configuration rather than a market data source; only agents using this RPC URL are protected. Hyperliquid mode charges a 0.02% builder fee, and Base on-chain mode adds a Builder Code attribution tag by default (no fee, can be disabled).