ibonon/Sigui

GitHub: ibonon/Sigui

为自主管理链上资产的 AI Agent 提供实时威胁检测、可视化攻击拓扑识别与去中心化密码学身份信誉体系的安全预言机基础设施。

Stars: 1 | Forks: 0

# 🛡️ Sigui — 多链 DePIN 安全预言机 [![硬件:AMD MI300X](https://img.shields.io/badge/Hardware-AMD%20MI300X-red)](https://www.amd.com/en/products/accelerators/instinct/mi300) [![数据集:100万图表](https://img.shields.io/badge/Dataset-1M%20Visual%20Graphs-blueviolet)](#) [![ERC-8259](https://img.shields.io/badge/Standard-ERC--8259-blue)](https://ethereum-magicians.org/t/erc-8259-ai-agent-identity-threat-registry/28473) **Sigui** 是一个为 AI agent 打造的去中心化安全基础设施 (DePIN),利用 **AMD MI300X** GPU 的大规模并行算力,通过可视化图表分析来检测链上威胁。 在 **< 50ms** 内,5 层风险引擎、Imina Na V2 视觉模型(基于 1,000,000 个样本训练)和 MemoClaw 记忆模块将返回判定结果:**ALLOW / BLOCK / ESCALATE**。 被阻止的攻击将被永久记录在 Arc L1 的 `ThreatRegistry.vy` 中。 风险阈值由社区通过 `Hogonat.vy` 质押进行治理。 **整个闭环完全自治。零人工干预。** ## 🌟 全新:Agent 身份系统(阶段 1) ### 🔐 AI Agent 的密码学身份 Sigui 现在包含一个革命性的 **Agent DID(去中心化身份)** 系统,解决了 agent 身份验证的基本问题: **问题:** 目前,任何攻击者都可以创建一个新钱包,用两周时间建立虚假信誉,然后执行攻击。Agent 的身份绑定的是钱包,而不是密码学身份。 **解决方案:** Agent DID 系统将信誉以密码学方式绑定到身份上,而不是钱包。 ### 🆔 Agent DID 功能 - **密码学身份:** 每个 agent 都拥有绑定到 Ed25519 公钥的唯一 DID - **可移植信誉:** 信誉跟随身份跨钱包/跨链转移 - **不可篡夺:** 没有私钥就无法伪造身份 - **防止信誉洗白:** 无法通过创建新钱包来“洗白”不良信誉 - **多层验证:** Bronze → Silver → Gold → Platinum 验证等级 ### 📊 身份验证层级 | 层级 | 要求 | 信任系数 | 权益 | |------|--------------|------------------|----------| | **Bronze** | DID 注册 + 邮箱 | 1.2x | 基础信誉 | | **Silver** | 组织验证 | 1.5x | 增强评分 | | **Gold** | 企业审计 + KYC | 1.8x | 高级功能 | | **Platinum** | 保险背书 | 2.0x | 最高信任 | ### 🧠 AI 驱动的信誉引擎 - **AMD MI300X 优化:** 相比 CPU 实现 10-100 倍的性能提升 - **6 维度评分:** 身份 (25%) + 交易 (30%) + 验证 (20%) + 跨链 (10%) + 威胁情报 (10%) + 保险 (5%) - **实时更新:** 信誉在 <50ms 内更新 - **异常检测:** 孤立森林算法用于检测可疑行为 - **预测性评分:** 基于 10,000+ 个 agent 行为训练的 ML 模型 ### 🔗 DID 格式 ``` did:sigui:arc:individual:0x7a3f2e1b9c8d4e5f ``` **组成部分:** - `did`:标准 DID 前缀 - `sigui`:Sigui 方法标识符 - `arc`:区块链网络 (Arc L1) - `individual`:Agent 类型 (individual/organization/enterprise) - `0x7a3f...`:公钥哈希(16 个字符) ## ⚡ 30 秒架构概览 ``` AI Agent ──── POST /evaluate ($0.001 x402) ────────────────────────────┐ │ ┌───────────────────────────────────────────────────────────┐ │ │ Sigui Security Pipeline │ │ │ │ │ │ ① Agent DID Check (cryptographic identity) │ │ │ ② Behavior Engine (numpy, < 2ms) │ │ │ ③ Anti-Splitting (flow tracking, cumulative USDC) │ │ │ ④ Service Registry (reputation scores, on-chain) │ │ │ ⑤ Contract Inspector (bytecode analysis, approvals) │ │ │ ⑥ Imina Na Vision (AMD MI300X ROCm, < 50ms) │ │ │ │ │ │ PolicyBrain ←→ LangGraph ←→ CrewAI (self-critique) │ │ └───────────────────────────────────────────────────────────┘ │ │ ALLOW ──────────────────────────────────────────────────────-─┘ BLOCK ──── ThreatRegistry.vy (Arc L1, permanent, immutable) ESCALATE ── Qwen2.5 (AMD MI300X) → Claude 3.5 fallback ``` ## ♻️ 经济飞轮 ``` Agent pays $0.001 ──→ Sigui Oracle receives revenue │ ┌───────┴────────┐ 80% 20% │ │ Treasury Hogonat.vy (pays Claude & Fee Pool Arc fees) │ Stakers claim proportional rewards │ Stakers vote risk_weights & thresholds │ PolicyBrain reloads live thresholds │ ←── Better protection → more agents ``` **每次评估都在强化协议。每个质押者都从每次被阻止的攻击中获益。** ## 🧠 Imina Na — 视觉预言机 传统安全引擎使用简单的阈值。Imina Na 能*看穿*攻击拓扑。 - **架构**:微调的 Qwen2-VL-2B-Instruct (LoRA) - **硬件**:用于训练和推理的 AMD MI300X (ROCm 技术栈) - **数据集**:The Dogon Dataset — 10,000+ 种自定义交易图拓扑 - **检测模式**:`DRAIN_STAR`、`MIXING_CHAIN`、`COORDINATED_CLUSTER` - **集成**:提供注入到 Kanaga 风险聚合器中的 `risk_delta` → [在 HuggingFace 上查看模型](https://huggingface.co/Ibonon/imina_na_lora) ## 🏗️ 完整技术栈 | 组件 | 技术 | 职责 | |:---|:---|:---| | **API** | FastAPI + uvicorn | 安全预言机 endpoint | | **支付** | x402 协议 + Circle DCW | $0.001/次调用的小额支付 | | **风险引擎** | numpy, 5 层 pipeline | 实时威胁评分 | | **视觉预言机** | Imina Na (Qwen2-VL, LoRA) | 图拓扑检测 | | **AI 硬件** | **AMD MI300X (ROCm)** | 训练 + 推理 | | **记忆** | MemoClaw (SQLite async) | 情景记忆,模式回忆 | | **自我审查** | PolicyBrain + LangGraph + CrewAI | 自主阈值调整 | | **智能合约** | Vyper 0.4.3 (2 个合约) | ThreatRegistry + Hogonat DAO | | **区块链** | Arc L1 Testnet | 不可篡改的攻击日志 | | **治理** | Hogonat.vy 质押 | 社区对风险阈值进行投票 | | **仪表盘** | Next.js 14 | 沉浸式实时监控 UI | | **SDK** | Python (pip install sigui) | 为 agent 提供的 2 行代码集成 | ## 🚀 快速入门 ### 前置条件 ``` # 需要 Python 3.11+ pip install -r requirements.txt # 对于 AMD GPU inference (ROCm): pip install -r requirements_amd.txt ``` ### 1. 配置环境 ``` cp .env.example .env # 使用你的 Circle API key 和 Arc testnet credentials 编辑 .env # DEMO_MODE=true 在无需 credentials 的情况下即可开箱即用 ``` ### 2. 启动安全预言机 ``` uvicorn main:app --port 8000 --reload # API: http://localhost:8000 # Swagger: http://localhost:8000/docs ``` ### 3. 启动仪表盘 ``` cd demo-ui npm install && npm run dev # Dashboard: http://localhost:3001 ``` ### 4. 部署自治生态系统 在仪表盘中点击 **⚡ Lancer le rituel** 以启动 5 个 agent 的模拟: - 🔥 **Danseur du Feu** (PayerAgent) — 合法支付,金额多变 - 🦊 **Renard Pâle** (AttackerAgent) — 对抗性,4 种轮换策略 - ⭐ **Étoile Apprenante** (LearnerAgent) — 热身 → 探测 → 攻击循环 - 🌫 **Gray Zone** (GrayZoneAgent) — 挑战 AI 的模糊交易 - 👁 **Œil de la Société** (MonitorAgent) — ROI 追踪,异常检测 ## 🆔 Agent 身份 SDK — 3 行代码集成 ``` pip install sigui ``` ``` from sigui import SiguiClient, AgentIdentity # 创建 agent identity identity = AgentIdentity.create( agent_type="trading_bot", verification_tier="silver" ) async with SiguiClient(api_url="http://localhost:8000") as client: # Register identity await client.register_identity(identity) # Evaluate transaction with identity result = await client.evaluate_with_identity( amount=5.0, destination="0xRecipient", agent_did=identity.did ) print(f"✅ ALLOW — reputation={result.reputation_score:.3f} — {result.processing_time_ms}ms") ``` ## 🐍 基础 SDK — 2 行代码集成 ``` pip install sigui ``` ``` from sigui import SiguiClient async with SiguiClient(api_url="http://localhost:8000") as client: result = await client.evaluate(amount=5.0, destination="0xRecipient") if result.is_safe: print(f"✅ ALLOW — risk={result.risk_score:.3f} — {result.processing_time_ms}ms") else: print(f"🚫 BLOCK — {result.reason}") ``` ## 📊 链上证明 | 指标 | 值 | |:---|:---| | **ThreatRegistry** | `0x17430A67e11535466cC5f17e736D5e4643B86ba1` | | **Hogonat DAO** | [`0x1e497ed89fc4f6ae2Da826a18B4a7728919684a1`](https://testnet.arcscan.app/address/0x1e497ed89fc4f6ae2Da826a18B4a7728919684a1) | | **浏览器** | [testnet.arcscan.app](https://testnet.arcscan.app) | | **记录的攻击** | 380+ 次被阻止并永久记录 | | **模型** | [Ibonon/imina_na_lora](https://huggingface.co/Ibonon/imina_na_lora) | ## 🔑 核心差异化优势 | 功能 | 传统安全 | Sigui | |:---|:---|:---| | **响应** | 被动过滤 | 自主经济 agent | | **身份** | 基于钱包 | 密码学 DID | | **信誉** | 单钱包范围 | 可跨链移植 | | **学习** | 静态规则 | MemoClaw 情景记忆 + 自我审查 | | **治理** | 中心化 | 链上质押 DAO (Hogonat.vy) | | **支付** | 订阅制 | x402 按次付费 ($0.001) | | **证明** | 日志 | 不可篡改的链上记录 (ThreatRegistry.vy) | | **视觉** | 无 | Imina Na 图拓扑 (AMD MI300X) | | **审计追踪** | 中心化数据库 | Arc L1 区块链 | ## 🐳 Docker ``` docker-compose up # Backend: http://localhost:8000 # Dashboard: http://localhost:3001 ``` ## 📁 项目结构 ``` Sigui/ ├── main.py # FastAPI app — 10-step startup sequence ├── modules/ │ ├── gateway.py # All routes, x402 middleware (50KB) │ ├── security_engine.py # 5-layer risk engine (numpy) │ ├── memory.py # MemoClaw episodic memory (SQLite async) │ ├── ai_engines.py # PolicyBrain + CrewAI + LangGraph + Claude │ ├── imina_na_vision.py # Imina Na vLLM client (AMD MI300X) │ ├── response_validator.py # LLM response poisoning detection │ ├── treasury.py # Autonomous treasury management │ └── identity/ # 🆕 Agent DID system │ ├── agent_did.py # DID generation & management │ ├── reputation_engine.py # AI-powered reputation scoring │ └── identity_integration.py # Identity + security pipeline ├── contracts/ │ ├── ThreatRegistry.vy # Onchain attack log (Vyper 0.4.3) │ ├── Hogonat.vy # Governance DAO — staking + threshold votes │ └── AgentIdentityRegistry.vy # 🆕 Agent identity registry ├── ecosystem/ │ └── agents.py # 5 autonomous agents (Payer, Attacker, Learner...) ├── governance/ │ └── hogonat_client.py # Dual-mode governance client (mock/on-chain) ├── sdk/python/sigui/ # Python SDK (pip install sigui) └── demo-ui/ # Next.js 14 live dashboard ``` ## 🌟 愿景:Agent 信任的 AWS **阶段 1** ✅ **Agent 身份系统** - AI agent 的密码学身份 **阶段 2** 🔄 **威胁情报网络** - 去中心化的攻击模式市场 **阶段 3** 🔄 **保险层** - 自主交易的风险覆盖 **阶段 4** 🔄 **开放协议标准** - EIP-XXXX Agent 安全标准 **目标:** 到 2030 年,每一个转移价值的 AI agent 都将经过 Sigui。我们正在为自主经济构建信任基础设施。 *Sigui · 为 Agent 经济而生 · Arc + Circle 黑客松 · 2026* *"防火墙不会等待人类。它学习、适应并保护——全自主运行。"* **下一步:** - [ ] 将 AgentIdentityRegistry.vy 部署到 Arc 主网 - [ ] 为 1,000 个 agent 接入密码学身份 - [ ] 启动威胁情报网络(阶段 2) - [ ] 提交 EIP-XXXX Agent 安全标准(阶段 4)
标签:AI代理, AI安全, AMD MI300X, AMSI绕过, Arc L1, Chat Copilot, CISA项目, DePIN, DID, Ed25519, ERC-8259, USDC资金保护, Vyper, Web3安全, 区块链安全, 去中心化安全基础设施, 去中心化身份, 图分析, 声誉系统, 多链, 威胁检测, 密码学, 密码管理, 恶意流量拦截, 手动系统调用, 拓扑攻击防御, 提示词注入防御, 智能合约, 视觉模型, 逆向工具, 防火墙, 零人工干预, 风险评估引擎