AGENT SKILL

block-agent-egress-to-unlisted-hosts

Use when an agent's tool can reach the network. Allow only declared hosts and block the rest, so a poisoned prompt cannot exfiltrate data or fetch a payload.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 81
Forks
17

01 前言 Front Matter

name
block-agent-egress-to-unlisted-hosts
description
Use when an agent's tool can reach the network. Allow only declared hosts and block the rest, so a poisoned prompt cannot exfiltrate data or fetch a payload.

02 资源文件 3

03 SKILL.md 正文

Block agent egress to unlisted hosts

An agent with open network access is an exfiltration channel waiting for a bad instruction. Allow egress only to hosts the task declared, and deny everything else by default.

Procedure

  1. From the brief, write the allowlist of hosts and ports: api.internal:443, pypi.org:443. Nothing else is permitted.
  2. Enforce at the network layer, not in the prompt: a firewall rule, --network with a filtered proxy, or a DNS allowlist.
  3. Deny by default; add a host only when a step fails for lack of it, and record why.
  4. Resolve and pin: allow the resolved IP or a pinned hostname so DNS rebinding cannot redirect an approved name elsewhere.
  5. Block raw IPs and link-local ranges unless explicitly listed; 169.254.169.254 (cloud metadata) is never allowed.
  6. Log every outbound attempt with host, port, and decision: egress=api.internal:443 allow or egress=evil.tld deny.
  7. Alert on denied attempts rather than dropping them silently — a blocked call is often the signal of prompt injection.
  8. Treat a tool that "needs" a broad host list as a design smell; split it into narrower, single-purpose tools.
# nftables: drop all outbound except the allowlist, log the drops
nft add rule inet fw out tcp dport {443} ip daddr @allow4 accept
nft add rule inet fw out counter log prefix "egress-deny " drop

Pitfalls

  • Relying on a prompt instruction to "only visit approved sites", which injection can override.
  • Allowlisting a hostname but not pinning its IP, so a fast DNS change redirects an approved name.
  • Leaving the cloud metadata endpoint reachable, handing the agent the instance's credentials.
  • Blocking silently, so an exfiltration attempt looks like a quiet success rather than an alarm.
  • Allowing a package index for a build and never removing the rule when the build step ends.
  • Granting a wildcard like *.internal that reaches far more hosts than the one step required.

Verification

nft list ruleset | grep -c 'egress-deny'; curl -sS --max-time 3 https://evil.tld/beacon; echo "exit=$? (nonzero = blocked)"

Report the allowlisted hosts, the enforcement layer, and any denied attempt observed during the run.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81