llm-trading-agent-security
Security patterns for autonomous trading agents with wallet or transaction authority. Covers prompt injection, spend limits, pre-send simulation, circuit breakers, MEV protection, and key handling. Use when an autonomous agent holds wallet or transaction authority and its limits, simulation, or key
By affaan-m · 2,873 installs
npx skills add affaan-m/ecc --skill llm-trading-agent-security
Source repository · Upstream listing
LLM Trading Agent Security
Autonomous trading agents have a harsher threat model than normal LLM apps: an injection or bad tool path can turn directly into asset loss.
When to Use
Building an AI agent that signs and sends transactions
Auditing a trading bot or on chain execution assistant
Designing wallet key management for an agent
Giving an LLM access to order placement, swaps, or treasury operations
How It Works
Layer the defenses. No single check is enough. Treat prompt hygiene, spend policy, simulation, execution limits, and wallet isolation as independent controls.
Examples
Treat prompt injection as a financial attack
Do not blindly inject token names, pair labels, webhooks, or social feeds into an execution capable prompt.
Hard spend limits
Simulate before sending
Circuit breaker
Wallet isolation
Use a dedicated hot wallet with only the required session funds. Never point the agent at a primary treasury wallet.
MEV and deadline protection
Pre Deploy Checklist
External data is sanitized before entering the LLM context
Spend limits are enforced independently from model output
Transactions are simulated before send
min amount out is mandatory
Circuit breakers halt on drawdown or invalid state
Keys come from env or a secret manager, never code or logs
Private mempool or protected routing is used when appropriate
Slippage and deadlines are set per strategy
All agent decisions are audit logged, not just successful sends