三只貓
Rich Mindset Zone
richmindsetzone.com
← All posts

AI Agent 上鏈係 hype 定未來?sandboxed.sh 技術 deep dive

AI Agent 上鏈係 hype 定未來?sandboxed.sh 技術 deep dive

tags:

  • ai-agents
  • web3
  • defi
  • sandboxed-sh
  • nanoclaw
  • security
  • on-chain-agents
  • okx cover_image: ”../../assets/heroes/ai-agent-hype-sandboxed-sh-deep-dive.jpg” draft: false lang: zh-Hant

每個 Crypto 週期都有一個被濫用到爛嘅 keyword。2021 係 metaverse,2024 係 AI,2025-2026 係「AI Agent 上鏈」。問題係:九成人講嘅「AI x Web3」只係將 GPT wrapper 攝入 Telegram bot 再發個 token,同真正嘅 autonomous on-chain agent 差成個銀河系。

但 sandboxed.sh — Th0rgal 嘅 Build X-Agent Hackathon 冠軍項目,436 GitHub stars、25 個 release、iOS + Web dashboard 都已出 — 用一個異常樸素嘅 approach 話俾你聽:隔離,先係 AI Agent 上鏈嘅真正前提。唔係模型,唔係 token,係點樣保證 agent 唔會偷走你條 key。

安全沙箱:sandboxed.sh 嘅架構 deep dive

sandboxed.sh 由 Th0rgal(之前做 StarkNet 生態多個工具嘅 Rust developer)主理。核心命題好直接:AI agent 要 autonomous 噉上鏈做交易、做 risk check,但點保證 wallet private key 唔會被 LLM 經 prompt injection 拎走?點防止一個 agent 嘅 operation 感染另一個?

答案係 per-mission workspace isolation,用 systemd-nspawn 而唔係 Docker。

背後嘅 backend 全用 Rust 寫,workflow:

  1. Template-based workspace creation — 揀 distro(Ubuntu Noble、Debian Bookworm、Arch Linux),run init script 裝 bun、uv、Playwright 等 tooling
  2. Library sync — Git-backed repo 自動 clone skills、tools、rules、MCP configs 入 workspace
  3. Encrypted secrets injection — AES-256-GCM 加密儲存,只喺 workspace init 時解密一次注入。LLM 本身接觸唔到 raw secret
  4. Harness launch — Claude Code / OpenCode / Codex / Gemini / Grok 任揀,全部喺 container 內行
  5. Post-mission teardown — Workspace 可成個銷毀,痕跡不留

最令我留意嘅係佢哋對 networking isolation 嘅處理。預設用 host network(簡單),但可以轉 isolated veth + Tailscale exit node,令 agent 經 residential IP 出去做 web scraping。呢個對於 DeFi agent 要檢查各個鏈上 protocol 狀態好有用 — 唔會被 rate limit 或者 block。

而 bundled 嘅 OKX security skill 係教科書級嘅「read-only is the feature」案例:可以檢查 token risk、DApp 安全性、transaction intent、approval 風險,但永遠唔會 sign 或者 broadcast 任何交易。一個 autonomous agent 要做 DeFi security check,最安全嘅方式就係用一把根本開唔到鎖嘅鑰匙。

從 DeFi 視角:on-chain agent 嘅市場缺口

傳統 DeFi 嘅瓶頸唔係 liquidity,而係 操作頻率嘅人力上限。散戶一日最多幾單,機構 trader 或者 bot 可以幾千單 — 但 bot 寫死 logic,遇到 unrug 或者閃電貸攻擊根本唔識應變。

AI agent 嘅真正價值係理解 natural language 策略然後自主執行。例如:

  • “Check if this new yield farm has been audited, then deposit 10 ETH if risk score < 3”
  • “Monitor my positions across 5 chains, auto-withdraw if any protocol shows anomalous on-chain activity”

問題:如果呢個 agent 有簽名權限,佢就係一個行走嘅 attack surface。Prompt injection、dependency 供應鏈攻擊、model hallucination — 任何一個漏洞都可以清空錢包。

sandboxed.sh 嘅解法係 minimum-privilege sandboxing:每個 mission 只拎到佢需要嘅工具。做 risk check 嘅 agent 冇簽名權限;做交易執行嘅 agent 只能同指定合約互動;每個 workspace 嘅 network access 可以用 template 嘅 init script 限制。呢個 pattern 直接移植自 AWS IAM + VPC 哲學,但應用喺 AI agent 執行環境。

對比市面上大部分所謂「AI trading bot」— 中央伺服器行一個 Python script + OpenAI API call,wallet 喺 server memory 裸奔,hacker 入到 server 就等於拎哂所有 key。sandboxed.sh 嘅 container isolation + encrypted secrets 起碼令攻擊者要多 break 兩層先得手。

生態定位:sandboxed.sh vs NanoClaw vs 其他

有必要釐清一個混亂:而家市面上大量「Claw」字尾嘅 agent project 同 sandboxed.sh 唔係競爭,而係 唔同 abstraction layer

  • MicroClaw(Rust):單一 binary 嘅 chat agent runtime,target Telegram/Discord。強項係 persistent memory 同 multi-channel,但唔處理 on-chain sandbox — 佢嘅定位係通用 social agent,唔係 DeFi-specific。

  • NanoClaw(Clawland-AI / Python):mid-weight edge agent,target Raspberry Pi 等 $50 SBC。重點係 IoT、computer vision、local ML inference — 同 on-chain DeFi 完全唔同賽道。

  • sandboxed.sh:與其叫 agent framework,不如叫「multi-tenant agent orchestrator」。佢唔係一個 agent runtime,而係一個可以 run multi-agent、multi-runtime 嘅 infrastructure layer。重點唔係 AI 能力,而係隔離、可審計、可重複嘅執行環境。

如果你要 deploy 一個 AI agent 去做 DeFi 操作,你需要嘅唔係另一個 chat bot framework,而係一個信得過嘅沙箱。sandboxed.sh 目前係 open source 界最接近呢個目標嘅項目。

Agent 上鏈嘅真正樽頸:trustless execution 嘅不可能三角

講到尾,AI agent 上鏈嘅問題唔係「模型夠唔夠叻」— GPT-5 出咗都解決唔到。問題係 點樣 trustlessly execute non-deterministic computation

Blockchain 嘅 killer feature 係 deterministic execution — smart contract 嘅 logic 任何人都可以 verify。但 AI model 本質上 non-deterministic,你冇辦法叫 Ethereum 直接 run GPT-4o。於是所有「AI x Web3」項目都要做一個妥協:off-chain 執行 + on-chain settlement。

sandboxed.sh 嘅 architecture 暗示咗個可行方向,同 Optimistic Rollup 嘅 fraud proof 概念異曲同工:

  1. Agent 喺 off-chain sandbox 執行(self-hosted 或未來嘅 decentralized compute)
  2. 佢嘅動作被 sign 成 transaction 提交上鏈
  3. Sandbox 嘅 execution log 可被第三方 audit
  4. 唔需要即時 on-chain verification — 任何一方可以事後 challenge 個 agent 嘅行為

呢個 pattern 下,sandboxed.sh 嘅 workspace isolation 唔只係 security feature,而係 auditability 嘅基礎 — 因為每個 mission 嘅 filesystem、tool calls、network activity 都係獨立嘅,要 replay 或者 audit 係可行嘅。

結論:而家你可以做嘅嘢

  1. DeFi developer:clone sandboxed.sh,用 OKX security skill 套落你嘅 protocol 做 automated risk scan — 呢個係而家即用得嘅 production-ready use case

  2. Independent dev:起個 local Docker instance(5 分鐘搞掂),特別留意佢哋嘅 Library system — Git-backed skills hub 呢個 pattern 好可能會成為將來 agent infrastructure 嘅 standard

  3. Investor / builder:小心啲只係發 token 但講唔清 sandbox model 嘅「AI agent」project。Agent 上鏈嘅價值唔在於佢用咗 GPT-4o 定 Claude Sonnet 4,而在於 點樣保證佢唔會亂簽名、亂放幣。邊個 project 解決到呢個問題,邊個就係下一個 cycle 嘅 winner。

AI Agent + DeFi 唔係 hype — 但 hyperloop 之前有一條好長嘅隧道要挖。Sandboxed.sh 係第一批帶住鏟入去嘅人。你會唔會係第二個?