llm-trading-agent-security

llm-trading-agent-security is a skill for Claude Code, Codex from Jamkris/everything-gemini-code. It costs 41 tokens per session (1,083 once invoked), scanned A, original, MIT.

A security guide for AI trading agents that can control wallets or send financial transactions. It covers threats such as prompt injection, unsafe tool use, and stolen or misused keys.

In plain words
What is it for?
It helps design or audit trading bots and on-chain assistants, including spend limits, transaction simulation, circuit breakers, MEV protection, and wallet key handling.
Why use it?
A bad instruction or execution path can cause direct asset loss, and ordinary AI safeguards may not be enough for transaction authority.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps design or audit trading bots and on-chain assistants, including spend limits, transaction simulation, circuit breakers, MEV protection, and wallet key handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamkris/everything-gemini-code/llm-trading-agent-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Jamkris/everything-gemini-code --skill llm-trading-agent-security
Clone the repo
git clone --depth 1 https://github.com/Jamkris/everything-gemini-code

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for llm-trading-agent-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamkris/everything-gemini-code/llm-trading-agent-security/github.svg)](https://agentmods.dev/skills/jamkris/everything-gemini-code/llm-trading-agent-security)
Your own site
<a href="https://agentmods.dev/skills/jamkris/everything-gemini-code/llm-trading-agent-security"><img src="https://agentmods.dev/badge/skills/jamkris/everything-gemini-code/llm-trading-agent-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for llm-trading-agent-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/jamkris/everything-gemini-code/llm-trading-agent-security"><img src="https://agentmods.dev/badge/skills/jamkris/everything-gemini-code/llm-trading-agent-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,083 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01083
Opus 5.5 $0.00016 $0.00433
Sonnet 5.5 $0.00008 $0.00217
Haiku 4.5 $0.00004 $0.00108

Measured 2mo ago against content hash 509477236036, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

llm-trading-agent-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

skills/llm-trading-agent-security/SKILL.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Do not blindly inject token names, pair labels, webhooks, or social feeds into an execution-capable prompt.

Hard spend limits

from decimal import Decimal

MAX_SINGLE_TX_USD = Decimal("500")
MAX_DAILY_SPEND_USD = Decimal("2000")

class SpendLimitError(Exception):
    pass

class SpendLimitGuard:
    def check_and_record(self, usd_amount: Decimal) -> None:
        if usd_amount > MAX_SINGLE_TX_USD:
            raise SpendLimitError(f"Single tx ${usd_amount} exceeds max ${MAX_SINGLE_TX_USD}")

        daily = self._get_24h_spend()
        if daily + usd_amount > MAX_DAILY_SPEND_USD:
            raise SpendLimitError(f"Daily limit: ${daily} + ${usd_amount} > ${MAX_DAILY_SPEND_USD}")

        self._record_spend(usd_amount)

Simulate before sending

class SlippageError(Exception):
    pass

async def safe_execute(self, tx: dict, expected_min_out: int | None = None) -> str:
    sim_result = await self.w3.eth.call(tx)

    if expected_min_out is None:
        raise ValueError("min_amount_out is required before send")

    actual_out = decode_uint256(sim_result)
    if actual_out < expected_min_out:
        raise SlippageError(f"Simulation: {actual_out} < {expected_min_out}")

    signed = self.account.sign_transaction(tx)
    return await self.w3.eth.send_raw_transaction(signed.raw_transaction)

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 147 lines · 41 tokens per session scan A 509477236036

Subscribe to this mod's changes

llm-trading-agent-security is a skill published in the GitHub repository Jamkris/everything-gemini-code (93 stars, last pushed 5mo ago), licensed MIT. It adds 41 tokens to every session and 1,083 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

llm-trading-agent-security compared with skills from other repositories

llm-trading-agent-security next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
llm-trading-agent-securityJamkris/everything-gemini-codeSkill935mo agoMITA41Claude Code, Codex
redteamBaba01hacker666/gemini-redteamSkill34mo agononeA23Claude Code, Codex
redteam-exploit-validationBaba01hacker666/gemini-redteamSkill34mo agononeA24Claude Code, Codex
redteam-reconBaba01hacker666/gemini-redteamSkill34mo agononeA26Claude Code, Codex
redteam-reportingBaba01hacker666/gemini-redteamSkill34mo agononeA22Claude Code, Codex
redteam-source-auditBaba01hacker666/gemini-redteamSkill34mo agononeA25Claude Code, Codex
redteam-cmsBaba01hacker666/gemini-redteamSkill34mo agononeA24Claude Code, Codex