What does this skill do?

The Security Agents Trading AI Skill provides a set of defense-in-depth controls for building and auditing LLM-based trading bots that sign and submit on-chain transactions. It covers prompt injection, spending limits, pre-simulation, circuit breakers, wallet isolation, and MEV protection, reducing the risk of asset loss due to key compromises or execution errors.

Prompt Injection Detection
Sanitize token names, webhooks, and social media feeds before injecting them into the LLM's context to prevent financial attacks.
Strict spending limits
Set transaction- and daily-level limits that are independent of the model's output, with automatic validation before signing.
Pre-shipment Simulation
It simulates every on-chain transaction, requires a mandatory min_amount_out, and rejects transactions with excessive slippage.
Circuit Breakers in Response to Drawdowns
The strategy automatically stops out after consecutive losses or when hourly PnL falls below the configured threshold.

Usage examples

🛡️ Security Audit
Audit my on-chain trading bot and check to see if it has prompt injection controls and spending limits.
💸 Spending Limits
Set spending limits of $500 per transaction and $2,000 per day for my trading bot.
🚦 Circuit breaker
Design a circuit breaker that stops the agent after 3 consecutive losses or a 5% hourly drawdown.
🔒 Isolation and MEV
Set up wallet isolation using a dedicated hot wallet and MEV protection via private mempools.

Features

External Data Cleanup Filters prompt injection patterns in token names, pair labels, and social feeds before they enter the LLM's context.
Spending limits enforced Transaction- and daily limits are validated independently of the model, with automatic logging of each transaction.
Mandatory simulation Each transaction is simulated on-chain before being signed, requiring a `min_amount_out` that prevents excessive slippage.
Automatic circuit breakers The agent halts trading in the event of drawdowns, consecutive losses, or invalid portfolio statuses.
MEV Protection and Wallet Isolation Dedicated hot wallet with minimum balances, private mempools, and slippage and deadlines that can be configured by strategy.

Frequently asked questions

No. The skill provides Python code snippets that you can integrate directly into your agent. It does not require any additional MCPs, although you can combine it with blockchain MCPs if you use them.
Yes. The examples use EVM-oriented web3.py and eth_account, but the principles of prompt sanitization, spending limits, simulation, and circuit breakers are chain-agnostic.
Python with standard libraries from the web3 ecosystem: web3.py, eth_account, and regular expressions for injection detection.
Yes, these are proven strategies, but you should adapt the thresholds (spending limits, slippage, drawdowns) to your strategy and conduct thorough testing on the testnet before deploying with real funds.
AI Trading Agents Security — Defense in Depth for On-Chain Trading Bots

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.