[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CS6FB5AFZD057FPR7CQ4SX":3,"skill-same:01M7CS6FB5AFZD057FPR7CQ4SX":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7CS6FB5AFZD057FPR7CQ4SX","llm-trading-agent-security",null,"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.","Henrique1601\u002FSkiilsToIAs","Henrique1601","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F92006691?v=4","01M7CRXVT0GVXVK80JT1GR687S","Henrique Bezerra Dos Santos","01M7CRXVTN5Y8TMWJ1MDSKCQ1T",0,"MIT","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fai-agents\u002Fllm-trading-agent-security\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: llm-trading-agent-security\ndescription: 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.\nmetadata:\n  origin: ECC direct-port adaptation\nversion: \"1.0.0\"\n---\n\n# LLM Trading Agent Security\n\nAutonomous trading agents have a harsher threat model than normal LLM apps: an injection or bad tool path can turn directly into asset loss.\n\n## When to Use\n\n- Building an AI agent that signs and sends transactions\n- Auditing a trading bot or on-chain execution assistant\n- Designing wallet key management for an agent\n- Giving an LLM access to order placement, swaps, or treasury operations\n\n## How It Works\n\nLayer the defenses. No single check is enough. Treat prompt hygiene, spend policy, simulation, execution limits, and wallet isolation as independent controls.\n\n## Examples\n\n### Treat prompt injection as a financial attack\n\n```python\nimport re\n\nINJECTION_PATTERNS = [\n    r'ignore (previous|all) instructions',\n    r'new (task|directive|instruction)',\n    r'system prompt',\n    r'send .{0,50} to 0x[0-9a-fA-F]{40}',\n    r'transfer .{0,50} to',\n    r'approve .{0,50} for',\n]\n\ndef sanitize_onchain_data(text: str) -> str:\n    for pattern in INJECTION_PATTERNS:\n        if re.search(pattern, text, re.IGNORECASE):\n            raise ValueError(f\"Potential prompt injection: {text[:100]}\")\n    return text\n```\n\nDo not blindly inject token names, pair labels, webhooks, or social feeds into an execution-capable prompt.\n\n### Hard spend limits\n\n```python\nfrom decimal import Decimal\n\nMAX_SINGLE_TX_USD = Decimal(\"500\")\nMAX_DAILY_SPEND_USD = Decimal(\"2000\")\n\nclass SpendLimitError(Exception):\n    pass\n\nclass SpendLimitGuard:\n    def check_and_record(self, usd_amount: Decimal) -> None:\n        if usd_amount > MAX_SINGLE_TX_USD:\n            raise SpendLimitError(f\"Single tx ${usd_amount} exceeds max ${MAX_SINGLE_TX_USD}\")\n\n        daily = self._get_24h_spend()\n        if daily + usd_amount > MAX_DAILY_SPEND_USD:\n            raise SpendLimitError(f\"Daily limit: ${daily} + ${usd_amount} > ${MAX_DAILY_SPEND_USD}\")\n\n        self._record_spend(usd_amount)\n```\n\n### Simulate before sending\n\n```python\nclass SlippageError(Exception):\n    pass\n\nasync def safe_execute(self, tx: dict, expected_min_out: int | None = None) -> str:\n    sim_result = await self.w3.eth.call(tx)\n\n    if expected_min_out is None:\n        raise ValueError(\"min_amount_out is required before send\")\n\n    actual_out = decode_uint256(sim_result)\n    if actual_out \u003C expected_min_out:\n        raise SlippageError(f\"Simulation: {actual_out} \u003C {expected_min_out}\")\n\n    signed = self.account.sign_transaction(tx)\n    return await self.w3.eth.send_raw_transaction(signed.raw_transaction)\n```\n\n### Circuit breaker\n\n```python\nclass TradingCircuitBreaker:\n    MAX_CONSECUTIVE_LOSSES = 3\n    MAX_HOURLY_LOSS_PCT = 0.05\n\n    def check(self, portfolio_value: float) -> None:\n        if self.consecutive_losses >= self.MAX_CONSECUTIVE_LOSSES:\n            self.halt(\"Too many consecutive losses\")\n\n        if self.hour_start_value \u003C= 0:\n            self.halt(\"Invalid hour_start_value\")\n            return\n\n        hourly_pnl = (portfolio_value - self.hour_start_value) \u002F self.hour_start_value\n        if hourly_pnl \u003C -self.MAX_HOURLY_LOSS_PCT:\n            self.halt(f\"Hourly PnL {hourly_pnl:.1%} below threshold\")\n```\n\n### Wallet isolation\n\n```python\nimport os\nfrom eth_account import Account\n\nprivate_key = os.environ.get(\"TRADING_WALLET_PRIVATE_KEY\")\nif not private_key:\n    raise EnvironmentError(\"TRADING_WALLET_PRIVATE_KEY not set\")\n\naccount = Account.from_key(private_key)\n```\n\nUse a dedicated hot wallet with only the required session funds. Never point the agent at a primary treasury wallet.\n\n### MEV and deadline protection\n\n```python\nimport time\n\nPRIVATE_RPC = \"https:\u002F\u002Frpc.flashbots.net\"\nMAX_SLIPPAGE_BPS = {\"stable\": 10, \"volatile\": 50}\ndeadline = int(time.time()) + 60\n```\n\n## Pre-Deploy Checklist\n\n- External data is sanitized before entering the LLM context\n- Spend limits are enforced independently from model output\n- Transactions are simulated before send\n- `min_amount_out` is mandatory\n- Circuit breakers halt on drawdown or invalid state\n- Keys come from env or a secret manager, never code or logs\n- Private mempool or protected routing is used when appropriate\n- Slippage and deadlines are set per strategy\n- All agent decisions are audit-logged, not just successful sends\n","# LLM Trading Agent Security\n\nAutonomous trading agents have a harsher threat model than normal LLM apps: an injection or bad tool path can turn directly into asset loss.\n\n## When to Use\n\n- Building an AI agent that signs and sends transactions\n- Auditing a trading bot or on-chain execution assistant\n- Designing wallet key management for an agent\n- Giving an LLM access to order placement, swaps, or treasury operations\n\n## How It Works\n\nLayer the defenses. No single check is enough. Treat prompt hygiene, spend policy, simulation, execution limits, and wallet isolation as independent controls.\n\n## Examples\n\n### Treat prompt injection as a financial attack\n\n```python\nimport re\n\nINJECTION_PATTERNS = [\n    r'ignore (previous|all) instructions',\n    r'new (task|directive|instruction)',\n    r'system prompt',\n    r'send .{0,50} to 0x[0-9a-fA-F]{40}',\n    r'transfer .{0,50} to',\n    r'approve .{0,50} for',\n]\n\ndef sanitize_onchain_data(text: str) -> str:\n    for pattern in INJECTION_PATTERNS:\n        if re.search(pattern, text, re.IGNORECASE):\n            raise ValueError(f\"Potential prompt injection: {text[:100]}\")\n    return text\n```\n\nDo not blindly inject token names, pair labels, webhooks, or social feeds into an execution-capable prompt.\n\n### Hard spend limits\n\n```python\nfrom decimal import Decimal\n\nMAX_SINGLE_TX_USD = Decimal(\"500\")\nMAX_DAILY_SPEND_USD = Decimal(\"2000\")\n\nclass SpendLimitError(Exception):\n    pass\n\nclass SpendLimitGuard:\n    def check_and_record(self, usd_amount: Decimal) -> None:\n        if usd_amount > MAX_SINGLE_TX_USD:\n            raise SpendLimitError(f\"Single tx ${usd_amount} exceeds max ${MAX_SINGLE_TX_USD}\")\n\n        daily = self._get_24h_spend()\n        if daily + usd_amount > MAX_DAILY_SPEND_USD:\n            raise SpendLimitError(f\"Daily limit: ${daily} + ${usd_amount} > ${MAX_DAILY_SPEND_USD}\")\n\n        self._record_spend(usd_amount)\n```\n\n### Simulate before sending\n\n```python\nclass SlippageError(Exception):\n    pass\n\nasync def safe_execute(self, tx: dict, expected_min_out: int | None = None) -> str:\n    sim_result = await self.w3.eth.call(tx)\n\n    if expected_min_out is None:\n        raise ValueError(\"min_amount_out is required before send\")\n\n    actual_out = decode_uint256(sim_result)\n    if actual_out \u003C expected_min_out:\n        raise SlippageError(f\"Simulation: {actual_out} \u003C {expected_min_out}\")\n\n    signed = self.account.sign_transaction(tx)\n    return await self.w3.eth.send_raw_transaction(signed.raw_transaction)\n```\n\n### Circuit breaker\n\n```python\nclass TradingCircuitBreaker:\n    MAX_CONSECUTIVE_LOSSES = 3\n    MAX_HOURLY_LOSS_PCT = 0.05\n\n    def check(self, portfolio_value: float) -> None:\n        if self.consecutive_losses >= self.MAX_CONSECUTIVE_LOSSES:\n            self.halt(\"Too many consecutive losses\")\n\n        if self.hour_start_value \u003C= 0:\n            self.halt(\"Invalid hour_start_value\")\n            return\n\n        hourly_pnl = (portfolio_value - self.hour_start_value) \u002F self.hour_start_value\n        if hourly_pnl \u003C -self.MAX_HOURLY_LOSS_PCT:\n            self.halt(f\"Hourly PnL {hourly_pnl:.1%} below threshold\")\n```\n\n### Wallet isolation\n\n```python\nimport os\nfrom eth_account import Account\n\nprivate_key = os.environ.get(\"TRADING_WALLET_PRIVATE_KEY\")\nif not private_key:\n    raise EnvironmentError(\"TRADING_WALLET_PRIVATE_KEY not set\")\n\naccount = Account.from_key(private_key)\n```\n\nUse a dedicated hot wallet with only the required session funds. Never point the agent at a primary treasury wallet.\n\n### MEV and deadline protection\n\n```python\nimport time\n\nPRIVATE_RPC = \"https:\u002F\u002Frpc.flashbots.net\"\nMAX_SLIPPAGE_BPS = {\"stable\": 10, \"volatile\": 50}\ndeadline = int(time.time()) + 60\n```\n\n## Pre-Deploy Checklist\n\n- External data is sanitized before entering the LLM context\n- Spend limits are enforced independently from model output\n- Transactions are simulated before send\n- `min_amount_out` is mandatory\n- Circuit breakers halt on drawdown or invalid state\n- Keys come from env or a secret manager, never code or logs\n- Private mempool or protected routing is used when appropriate\n- Slippage and deadlines are set per strategy\n- All agent decisions are audit-logged, not just successful sends\n",{"name":5,"version":24,"metadata":25,"description":7},"1.0.0",{"origin":26},"ECC direct-port adaptation","main","a73152352c0612252131e5cf84e91312a6cf17dc","ai-agents\u002Fllm-trading-agent-security","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs","https:\u002F\u002Fgithub.com\u002FHenrique1601","https:\u002F\u002Fbezerraportifolio.netlify.app\u002F","Full Stack Developer | React, Next.js, TypeScript, Node.js & IA | Construindo produtos digitais e soluções SaaS","2026-11-15 02:56:04",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Henrique1601\u002FSkiilsToIAs --skill llm-trading-agent-security",{"tool":41,"command":42},"bunx","bunx skills add Henrique1601\u002FSkiilsToIAs --skill llm-trading-agent-security",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Henrique1601\u002FSkiilsToIAs --skill llm-trading-agent-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fai-agents\u002Fllm-trading-agent-security\u002FSKILL.md",true,[],[50,57,64,72,79,86],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7E2ANBW9V6AVX5JXNCEAWF8","rag-architect-agent","Agente Arquiteto de RAG, Embeddings & Busca Vetorial. Especialista em design e implementação de pipelines de Retrieval-Augmented Generation de alta fidelidade: chunking semântico, modelagem pgvector no PostgreSQL (Neon\u002FSupabase), busca híbrida (cosseno + BM25), reranking, validação via TypeSafe AI e filosofia Ponytail (anti-overengineering).","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fcustom-agents\u002Frag-architect-agent\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7E29KKF8R02ZRGYE2MJM67G","rag-architecture-patterns","Padrões arquiteturais e implementação de pipelines RAG (Retrieval-Augmented Generation) de alta fidelidade para qualquer projeto ou sistema. Cobre chunking semântico, embeddings, busca híbrida (pgvector + BM25), reranking, validação via TypeSafe AI e filosofia Ponytail (anti-overengineering).","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fai-agents\u002Frag-architecture-patterns\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CWRA8E3BJ7CPY8N8EG28J1","skill-repair","Use this to fix and re-install agent skills that have failed installation.\nThis skill provides the necessary context and permissions to surgically update\nthe `manifest.json` after a fix has been applied.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fskill-repair\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CWR66FZP8FA47WVZ4Z2EXC","security-scan","Scan your Claude Code configuration (.claude\u002F directory) for security vulnerabilities, misconfigurations, and injection risks using AgentShield. Checks CLAUDE.md, settings.json, MCP servers, hooks, and agent definitions.","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fsecurity-scan\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CWR0QPY58QPTR1P759TFNG","security-review","Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment\u002Fsensitive features. Provides comprehensive security checklist and patterns.","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fsecurity-review\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CWQXCE40XWT4FZ3VWZFGDP","security-bounty-hunter","Hunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of noisy local-only findings.","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fsecurity-bounty-hunter\u002FSKILL.md",[],[]]