aegis-defi
Aegis
自律型DeFiエージェントのための安全レイヤー。 | ウェブサイト | ドキュメント
オンチェーンで取引を行うAIエージェントには、正当なトークンとハニーポットを見分ける手段がありません。Aegisはそれを解決します。これは、あらゆるエージェントが接続可能なMCPサーバーであり、安全チェックを強制するオンチェーンコントラクトによって支えられています。
エージェントがスワップを行う前に、Aegisはターゲットのコントラクトをスキャンし、トランザクションをシミュレートして、単純な実行可否(go/no-go)を返します。もしコントラクトに99%の売却税や隠された一時停止機能がある場合、エージェントは決してそれに触れることはありません。
なぜこれが必要なのか
私たちは、あるエージェントが30秒以内にハニーポットトークンによってウォレットの全資産を失うのを目撃しました。そのトークンは、検証済みのコントラクト、十分な流動性、活発な取引など、表面上は問題ないように見えました。しかし、コードの奥深くには99%の売却税と、偽の renounceOwnership() の背後に隠された所有者が存在していました。
既存のエージェントフレームワークには、これを検知する手段がありませんでした。そこで私たちはそれを作りました。
Related MCP server: agentshield-mcp
仕組み
Agent -> Aegis (scan + simulate + decide) -> ChainエージェントがMCP経由でAegisに接続(設定は1行)
スワップ/承認/転送の前に、エージェントが
assess_riskを呼び出すAegisがコントラクトソースをスキャンし、トランザクションをシミュレートし、ハニーポットパターンをチェックする
リスクスコア(0-100)と共に、ALLOW(許可)、WARN(警告)、またはBLOCK(拒否)を返す
オンチェーン:AegisGatewayコントラクトが、トランザクションを転送する前に証明(attestation)を強制する
クイックスタート
# Add to Claude Code
claude mcp add aegis npx aegis-defi
# Or clone and try the demo
git clone https://github.com/StanleytheGoat/aegis
cd aegis && npm install
npx tsx demo/catch-honeypot.tsデモでは、意図的に悪意のあるトークン(99%の売却税、偽の所有権放棄、隠された管理者)をデプロイし、Aegisがすべての危険信号をキャッチする様子を確認できます:
Aegis Risk Assessment
Risk Score: 100/100
Findings:
[CRITICAL] Fake Ownership Renounce
[CRITICAL] Asymmetric Buy/Sell Tax (99% sell)
[CRITICAL] Sell Pause Mechanism
[HIGH] Hidden Max Sell Amount
[HIGH] Hidden Admin Functions
Decision: BLOCKツール
MCPサーバー (TypeScript) - MCP互換エージェントが利用可能な6つのツール:
ツール | 目的 |
| 165種類の既知の脆弱性タイプとのパターンマッチング |
| フォークされたチェーン上でのドライラン |
| ハニーポット対策チェック(売却可能性、保有の集中度) |
| 署名付き証明を含むオールインワンのリスク評価 |
| すべての内部呼び出しをトレースし、各コントラクトをスキャン |
| 5万件以上の実際の監査結果との照合 |
スマートコントラクト (Solidity) - Baseメインネットにデプロイ済み:
コントラクト | アドレス | 目的 |
AegisGateway | あらゆるDeFiインタラクションのための安全ラッパー。証明を検証し、リスクスコアをチェックする。 | |
AegisSafetyHook | Uniswap v4 |
ドキュメント
エージェント統合ガイド - エージェントの接続方法
プロジェクト統合ガイド - Aegisを製品に統合する方法
Flaunch統合 - Flaunchミームコイン取引の安全チェック
ElizaOSプラグイン - ElizaOSエージェント向けのネイティブAegisアクション
AgentKitプロバイダー - Aegis用Coinbase AgentKit ActionProvider
llms.txt - エージェント検索用の機械可読な説明
セキュリティ
イーサリアムのセキュリティベストプラクティス(ethskillsに基づく)に従って構築されています:
署名: すべての署名済みメッセージにチェーンIDとコントラクトアドレスを含める(クロスチェーンリプレイ攻撃の防止)。EIP-2のs値の可変性チェック。ecrecoverをaddress(0)に対して検証。
手数料計算: 除算の前に乗算を行う。明示的なオーバーフローガード。パーセンテージではなくベーシスポイントを使用。
アクセス制御: GatewayにOZ Ownable + ReentrancyGuardを実装。Hookにはイミュータブルな所有者。イミュータブルな手数料受取人。
デプロイ: Safe Singleton Factory CREATE2デプロイヤーを使用。Basescanでソース検証済み。所有権はSafeマルチシグに転送済み。
テスト: 165件のテスト(コントラクト42件 + TypeScript 123件)。実際のBaseメインネット状態に対するフォークテスト。
テスト
npm test # TypeScript unit tests (123)
npm run test:contracts # Solidity contract tests (42)
npm run demo # Honeypot detection demo変更履歴
v0.5.0 (最新)
フック証明のサポート -
assess_riskがUniswap v4保護プール向けにゲートウェイとフックの両方の証明を返すようになりましたEVMアドレス検証 - すべてのMCPツール入力で適切なアドレス形式を検証
既知のコントラクトの拡充 - Paraswap, Balancer Vault, CoW Protocol, Permit2, Uniswap V4 PoolManager
SDKエクスポート - attesterおよびsoloditモジュールがプログラム利用可能に
フェッチの強化 - response.okチェック、すべての外部リクエストに10秒のタイムアウトを設定
セキュリティヘッダーおよびランディングページ用のSEOファイル
v0.4.0
Solodit統合 -
search_soloditツールがCyfrin, Sherlock, Code4rena, Trail of Bitsなどによる5万件以上の実際の監査結果をクエリ可能に自動エンリッチメント -
SOLODIT_API_KEYが設定されている場合、assess_riskが検出されたパターンを実際の監査結果と照合オプトインAPIキーモデル - 各エージェントが独自のSoloditキーをプロビジョニングし、レート制限を共有しない
v0.3.0
165種類の脆弱性パターン(25カテゴリ、以前は22)
トレースレベル分析 -
trace_transactionツールがすべての内部呼び出しを追跡し、各コントラクトをスキャン
v0.2.0
22種類の脆弱性パターン(以前は12) - メタモーフィックコントラクト、オラクル操作、MEVサンドイッチ
エージェントスキル - Claude Code用のインストール可能なスキルファイル
Flaunch SDK統合 - Uniswap v4プールでのミームコインローンチの安全スキャン
ライセンス
MIT
Available Tools
4 toolsassess_riskA
Comprehensive risk assessment combining contract scanning, transaction simulation, and token checks. This is the recommended all-in-one safety check before any DeFi interaction. Returns a go/no-go recommendation.
Inputs: action (required), targetContract (required), from (required), chainId, +3 more.
check_tokenA
Check if a token is safe to trade. Detects honeypot mechanics (can't sell), concentrated holdings, fake ownership renouncement, and other scam indicators. Use this before swapping into any unfamiliar token.
Inputs: tokenAddress (required), chainId, holderAddress.
scan_contractA
Analyze a smart contract's source code or bytecode for known exploit patterns, honeypot mechanics, rug-pull signals, and security vulnerabilities. Returns a risk score (0-100) and detailed findings. Use this BEFORE interacting with any unfamiliar contract.
Inputs: source, bytecode, contractAddress, chainId.
simulate_transactionA
Simulate a transaction on a forked chain WITHOUT actually executing it. Detects reverts, abnormal gas usage, and other red flags. Use this to preview what will happen before sending a real transaction.
Inputs: from (required), to (required), data (required), chainId, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: assess_risk is a comprehensive all-in-one safety check, check_token focuses on token-specific scams, scan_contract analyzes contract code/bytecode, and simulate_transaction previews transaction outcomes. There is no overlap or ambiguity between these tools.
All tool names follow a consistent verb_noun pattern (assess_risk, check_token, scan_contract, simulate_transaction), using snake_case throughout. The naming is predictable and readable across the entire set.
With 4 tools, this server is well-scoped for DeFi security. Each tool earns its place by covering distinct aspects of safety assessment: holistic risk, token checks, contract analysis, and transaction simulation. This count is appropriate and avoids bloat.
The tool set provides complete coverage for DeFi security workflows: it includes comprehensive risk assessment (assess_risk), targeted checks for tokens and contracts, and transaction simulation. There are no obvious gaps—agents can perform end-to-end safety evaluations before any DeFi interaction.
Maintenance
Related MCP Connectors
Token rug-risk scans, Know Your Agent wallet checks and deployer reputation for AI agents.
Web3 security, DEX honeypot detector, and DAO governance auditor for Base & EVM chains.
Read-only smart-contract security intelligence for autonomous agents.
Crypto security, honeypot detection, wallet analysis, and token risk scoring across 31 blockchains.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePre-execution safety layer for autonomous agent wallets. Risk scoring, transaction simulation, and policy enforcement via MCP.MIT
- AlicenseBqualityDmaintenanceReal-time smart contract security for autonomous AI agents, offering tools for contract verification, wallet monitoring, drain detection, threat reporting, and leaderboards.1925 npmMIT
- AlicenseNot gradedqualityDmaintenanceSecurity layer for AI agents that evaluates transaction intents and returns verdicts (ALLOW/WARN/DENY) using deterministic rules, on-chain checks, and simulation.13 npmMIT
- AlicenseAqualityDmaintenanceThe safety layer that checks a DeFi transaction or token before your agent (or you) signs — on Base L2.672 npmMIT