Skip to content
affaan-m avatar

Llm Trading Agent Security

Layered security patterns that keep an LLM trading agent with wallet authority from losing funds.

CCM score
75 of 100
skills.sh installs
10.8K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers prompt injection defense, hard spend limits, pre-send simulation, circuit breakers, MEV protection, and wallet key handling
  • Includes Python patterns for sanitizing on-chain data, enforcing daily and per-transaction USD caps, and halting after losses
  • Enforces mandatory min_amount_out checks, transaction deadlines, and per-strategy slippage bounds before any transaction is signed
  • Designed for autonomous agents that sign and send transactions, using a dedicated hot wallet rather than a primary treasury

Install

$ npx -y skills add affaan-m/ecc --skill llm-trading-agent-security -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/affaan-m/ecc
Categories
Web3 & Crypto, Security, Finance & Trading
First seen
Jul 14, 2026

Questions

What does the llm-trading-agent-security skill do?

It gives security patterns for autonomous trading agents that hold wallet or transaction authority. It covers prompt injection, spend limits, pre-send simulation, circuit breakers, MEV protection, and key handling.

How do I install llm-trading-agent-security?

Run npx -y skills add affaan-m/ecc --skill llm-trading-agent-security -y in your project. The skill then gives your agent guidance for reviewing limits, simulation, and key handling in trading agents.

Who should use the llm-trading-agent-security skill?

It is for developers building AI agents that sign and send transactions, auditing trading bots or on-chain execution assistants, and designing wallet key management for an agent. It also fits anyone giving an LLM access to swaps, order placement, or treasury operations.

Where does llm-trading-agent-security rank in its category?

It sits in the Web3 & Crypto category and ranks in the top 50 on that category page. Other skills in the category include solana-dev, binance-agentic-wallet, okx-dex-market, gmgn-market, and gmgn-token.

What wallet setup does the skill recommend?

It recommends a dedicated hot wallet holding only the funds needed for a session, loaded from an environment variable such as TRADING_WALLET_PRIVATE_KEY. It warns against pointing the agent at a primary treasury wallet.

More from affaan-m/ecc

All 257

Similar to Llm Trading Agent Security

More Web3 & Crypto