AGENT SKILL

defi-security-audit-agent

Guides DeFi protocol security review and rug-risk assessment from public chain data, verified source, and historical patterns-covering EVM and Solana-style deployments, liquidity and tokenomics, governance centralization, bridges, exploit pattern matching, and evidence-structured audit reports. Use when the user asks for a DeFi security audit, rug risk analysis, contract vulnerability triage, LP lock verification, governance or upgrade risk, or cross-chain bridge review from observable data only.

License 许可
Apache-2.0
所属仓库
zkos-labs/bastion
最近更新
2026-11-13
Stars
★ 3
Forks
1

01 前言 Front Matter

name
defi-security-audit-agent
description
Guides DeFi protocol security review and rug-risk assessment from public chain data, verified source, and historical patterns-covering EVM and Solana-style deployments, liquidity and tokenomics, governance centralization, bridges, exploit pattern matching, and evidence-structured audit reports. Use when the user asks for a DeFi security audit, rug risk analysis, contract vulnerability triage, LP lock verification, governance or upgrade risk, or cross-chain bridge review from observable data only.

03 SKILL.md 正文

DeFi security audit agent

Role overview

Structured workflow for DeFi security and rug-risk analysis using public deployments, verified source where available, bytecode/decompilation when not, and historical on-chain events. Treats signatures, authority state, and events as auditable evidence-while labeling severity and separating proven issues from theoretical risks.

Principle: this skill supports triage, research, and reproducible findings-it does not replace a formal engagement by a licensed audit firm, insurance underwriter, or legal counsel. For generic investigation posture and ethics, see on-chain-investigator-agent; for wallet clustering, see address-clustering-attribution (and solana-clustering-advanced on Solana). For Solana program–centric DeFi vulnerability patterns (Anchor, PDAs, CPIs, oracles, pools), see solana-defi-vulnerability-analyst-agent. For EVM Solidity-centric triage (proxies, oracles, reentrancy, access control on Ethereum/L2s), see evm-solidity-defi-triage-agent. For flash-loan and atomic exploit post-mortems across EVM and Solana, see flash-loan-exploit-investigator-agent. For launch-focused rug-pattern triage (liquidity, dev clusters, LP events, risk scores), see rug-pull-pattern-detection-agent. For honeypot-style transfer and sell restriction patterns (EVM and Solana), see honeypot-detection-techniques. For governance, multisig, social-engineering, and Solana durable-nonce mitigation patterns anchored on public case studies (for example Chainalysis on Drift), see defi-admin-takeover-mitigation-lessons.

Do not assist with exploits, mainnet attacks, or bypassing access controls. Do not request or use private keys, insider materials, or non-public data.

1. Smart contract code review and decompilation

  • Pull verified source from chain explorers when available; otherwise use disassembly/decompilation with explicit uncertainty bounds.
  • Static review for common classes: reentrancy, unchecked external calls, overflow/underflow (Solidity era-dependent), access control gaps, proxy/upgrade misconfiguration (implementation slot, admin, initializer).
  • Map ownership and roles: renounce claims vs on-chain state, multisig thresholds, timelocks, proxy admins.
  • Scan for privileged or hidden paths: fee switches, mint/burn backdoors, emergency withdraws, pausable overrides-cite functions and modifiers.
  • Compare deployment and upgrade history: post-audit changes, unverified upgrades, new implementations.

Tools (examples): Slither, Mythril (where applicable), explorer verification, reputable decompilers-verify tool output on-chain.

2. Liquidity and tokenomics forensics

  • Liquidity locks - Where a public lock contract exists, verify lock duration, beneficiary, and unlock mechanics on-chain; third-party dashboards may lag-confirm contract state.
  • LP distribution - Track LP token holders, large unlocked positions, burns/removals, concentrated clusters (use clustering skills cautiously; probabilistic).
  • Supply mechanics - Mint authority, max supply, taxes/fees, transfer hooks or blacklists-read token standard and extensions.
  • Launch behavior - Early buyers, sniper bands, coordinated windows-heuristic; avoid definitive “illicit” labels without corroboration.
  • Rug-risk style metrics - Unlocked liquidity share, holder concentration, historical large exits-frame as risk indicators, not verdicts.

3. Governance and centralization risk

  • Map admin keys, multisigs, timelocks: signers, thresholds, delays-on-chain verification.
  • Upgradeable contracts: who controls implementation updates and proxy admin?
  • Governance token: voting power concentration, delegation, snapshot quirks-governance ≠ decentralization by default.
  • Privilege paths: single compromised signer → fund movement or pause? Document attack trees as hypotheses with preconditions.
  • Emergency functions: who can invoke, and under what guards?

4. Historical exploit and pattern matching

  • Compare protocol interactions and dependencies to known classes of incidents (oracle manipulation, flash-loan composability, reentrancy, bad admin op)-without claiming “same as X” without evidence.
  • Use analytics (e.g. Dune-style) for event volumes, spikes, and unusual actors-corroborate with raw logs where possible.
  • Monitoring concepts: large liquidity moves, admin txs-lawful APIs and rate limits; no unauthorized probing.

5. Cross-chain and bridge review

  • For listed integrations (Wormhole, LayerZero, deBridge, etc.), read public docs and verify on-chain mint/burn or message patterns for wrapped assets.
  • Trace lock/mint/burn accounting; flag single relayer or verifier assumptions when observable.
  • Treat bridges as high inherent trust assumptions-scope assumptions explicitly.

Toolchain and data sources (examples)

Layer Examples Strength
Code Verified source, static analyzers Repeatable bug classes
Explorers Etherscan family, Solscan, Blockscout Source, ABI, txs
Liquidity locks On-chain lock contracts + dashboards Timelines (verify contract)
Analytics Dune, Flipside, etc. Events at scale
Visualization TVL dashboards, custom graphs Trend context
Real-time Indexer webhooks, mempool APIs Alerts (authorized use)

Vendor depth varies-always cross-check critical state on the canonical explorer for the chain.

Operational workflow (suggested)

  1. Intake - Protocol name, contract address(es), or token mint (public).
  2. Rapid triage (~10 min) - Verification status, obvious admin/upgrade flags, recent large txs.
  3. Full pass (scope-dependent) - Code review, liquidity/tokenomics, governance, history, bridges as relevant.
  4. Cross-validation - Two sources for critical state (e.g. implementation address, lock owner).
  5. Severity and reporting - Critical / High / Medium / Low with evidence and remediation ideas; label theoretical findings.
  6. Follow-up - Optional public monitoring plan; responsible disclosure norms for unreleased critical issues (user/legal context).

Reporting and evidence delivery

  1. Executive TL;DR - Overall risk posture and top findings (no hype).
  2. Vulnerability list - Severity, impact, affected code/tx, reproduction steps or simulation in safe environments, fix suggestions.
  3. Liquidity and tokenomics - Lock proofs, distribution notes, charts if helpful.
  4. Governance and centralization - Signer maps, upgrade paths.
  5. Visuals - Flow diagrams, call graphs, holder snapshots-clearly marked as snapshots in time.
  6. Reproducibility - Links, queries, contract addresses, block numbers.

Every item should tie to verifiable code or chain state; hypotheses must be labeled.

Ethical and professional guardrails

  • Work only from public deployments and lawful data collection.
  • No private keys, no stolen data, no instructions to exploit production systems.
  • Prefer user safety and accurate severity-avoid alarmism and false certainty on clustering.
  • Transparency - methods and limits stated so others can reproduce triage steps.
  • For multi-chain Solana-specific deep dives, use solana-tracing-specialist / solana-clustering-advanced alongside this skill.

Goal: turn observable DeFi deployments and activity into actionable, checkable security intelligence-without replacing professional audit engagements where those are required.

04 同仓库更多 Skills

zkos-labs
zkos-labs/bastion

bastion

Programmable Trust Runtime for Autonomous Systems. Orchestrates identity, policy, privacy, durable execution, and multi-chain settlement.

★ 3
zkos-labs
zkos-labs/bastion

web2-api-firewall-administrator

Guides configuring Bastion Web2 API adapter policies for the Trust Runtime. Covers endpoint allowlists, provider budgets, rate limits, content inspection (PII/secrets detection), header filters, and OpenAPI spec-based auto-configuration. Use when configuring API call security for AI agents, setting provider spending caps, inspecting outbound API traffic, or setting up the Web2 adapter.

★ 3
zkos-labs
zkos-labs/bastion

transaction-screening-workflow-concepts

Educational map of transaction-centric compliance screening-transfer as the atomic unit, deposit vs withdrawal direction, single and CSV import, transaction list and detail views, per-transfer screening, rescreen, and STR-style exports. Use when the user asks how monitoring UIs treat tx hashes, directions, or regulatory reporting hooks-not for legal filing advice or evading reporting.

★ 3
zkos-labs
zkos-labs/bastion

solana-tracing-specialist

Guides Solana-specific on-chain forensics-ATA resolution, SPL instruction parsing, transaction history via RPC and indexers (e.g. Helius-style APIs), fund-flow graphs, Solana clustering heuristics, and program authority review. Use when the user investigates Solana wallets, SPL tokens, DEX/Jito flows, rug or phishing patterns on Solana, or needs evidence-structured tracing reports with public data only.

★ 3
zkos-labs
zkos-labs/bastion

solana-onchain-intelligence-resources

Companion to blockint-skills Solana work-official doc indexes and stacks for RPC/indexers, sanctions and address intel MCP, web research, agent payments, graph UIs, Solana Foundation dev skills, Solana Policy Institute (policy/regulatory education), optional open-source Scrapy collection (BlockchainSpider), Impersonator Solana (dApp dev/testing), coral-xyz sealevel-attacks (security pattern examples), Neodyme Solana Security Workshop (workshop.neodyme.io), and Osec Solana auditor introduction blog (osec.io). Use when the user needs pointers to Helius, Range AI, Tavily, PayAI x402, React Flow, Solana.com skills, or SPI alongside on-chain forensics-not as a substitute for reading current provider docs, legal counsel, or API keys.

★ 3
zkos-labs
zkos-labs/bastion

solana-defi-vulnerability-analyst-agent

Guides discovery and documentation of Solana DeFi protocol risks from public code and chain state-Anchor/native programs, PDAs, CPIs, oracles, pools, SPL mechanics, and historical tx reconstruction. Use when the user asks for Solana program security review, DeFi vulnerability triage, PDA or CPI safety, oracle or liquidity-pool risk, launchpad/bonding-curve issues, or evidence-backed severity findings without exploits or private keys.

★ 3