
Llm Trading Agent Security
If you're building an AI agent that can actually send transactions or move money, this gives you a layered defense checklist. It covers prompt injection detection tuned for wallet addresses and transfer commands, hard spend caps with daily limits, mandatory pre-send simulation with slippage checks, circuit breakers that halt on drawdown, and wallet isolation patterns. The examples are Python but the ideas port anywhere. The core insight is right: no single control is enough when a bad LLM output can drain funds. Treat every piece of external data as hostile, simulate before you sign, and keep the agent's keys separate from your treasury.
- skills.sh installs
- 3.6K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill llm-trading-agent-security --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
import re
INJECTION_PATTERNS = [
r'ignore (previous|all) instructions',
r'new (task|directive|instruction)',
r'system prompt',
r'send .{0,50} to 0x[0-9a-fA-F]{40}',
r'transfer .{0,50} to',
r'approve .{0,50} for',
]
def sanitize_onchain_data(text: str) -> str:
for pattern in INJECTION_PATTERNS:
if re.search(pattern, text, re.IGNORECASE):
raise ValueError(f"Potential prompt injection: {text[:100]}")
return text
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- Categories
- Security, AI & Agent Building, Finance & Trading
- First seen
- May 16, 2026
More from affaan-m/everything-claude-code
All 256- Project Flow Ops3.6K
- Social Graph Ranker3.6K
- Terminal Ops3.6K
- Defi Amm Security3.5K
- Ecc Tools Cost Audit3.5K
- Email Ops3.5K
- Hookify Rules3.5K
- Messages Ops3.5K
- Nodejs Keccak2563.5K
- Product Capability3.5K
- Research Ops3.5K
- Unified Notifications Ops3.5K
- Evm Token Decimals3.4K
- Gateguard3.1K
- Everything Claude Code2.7K
- Claude Api2.4K
- Hermes Imports2.3K
- Literature Review1.9K
- Fastapi Patterns1.8K
- Frontend Design1.8K
- Mysql Patterns1.8K
- Pubmed Database1.8K
- Windows Desktop E2e1.8K
- Agent Architecture Audit1.7K