Skip to content

plugins: add five live Solana tool plugins — assess, build, guard, verify (Track D) - #150

Open
furkanefecancaglar wants to merge 3 commits into
zeroclaw-labs:mainfrom
furkanefecancaglar:add-solana-plugins
Open

plugins: add five live Solana tool plugins — assess, build, guard, verify (Track D)#150
furkanefecancaglar wants to merge 3 commits into
zeroclaw-labs:mainfrom
furkanefecancaglar:add-solana-plugins

Conversation

@furkanefecancaglar

@furkanefecancaglar furkanefecancaglar commented Aug 1, 2026

Copy link
Copy Markdown

Adds a Solana capability set for ZeroClaw agents — five tool plugins, all read-only live over wasi:http, none ever holding a private key. Built from the redact-text template and the plugin authoring guide.

Plugin Capabilities Permissions What it does
solana-token-risk tool http_client, config_read Reads a mint and returns deterministic rug/honeypot evidence: mint & freeze authority, Token-2022 transfer-hook / permanent-delegate / transfer-fee / non-transferable / default-frozen, mutable Metaplex metadata, and holder concentration that resolves each top holder's owner and separates off-curve LP/protocol vaults from on-curve whale wallets via a curve check (no hard-coded pool list).
solana-wallet-risk tool http_client, config_read Scans a wallet's SPL and Token-2022 holdings and aggregates them: which positions can be seized, blocked, diluted, frozen or taxed, with breadth-weighted wallet-level scoring.
solana-tx-guard tool http_client, config_read Decodes a transaction the agent is about to sign, flags dangerous instructions (authority changes, delegate approvals, account closes, BPF Upgradeable-Loader / Stake / Vote authority changes), and simulates it live against mainnet to report the real balance effect — exactly how many lamports leave the fee-payer before anyone signs.
solana-tx-builder tool http_client, config_read Builds PDAs, associated token accounts, and SystemProgram / SPL-Token transfer instructions with a live blockhash and recipient check. The agent builds, a wallet signs — the plugin never signs or broadcasts (test-enforced).
solana-verify tool http_client, config_read keccak-256 Merkle proof folding, ed25519 signature verification, base58 conversion, plus merkle_verify_onchain and merkle_verify_batch — fold settlement proofs against an on-chain root in one call.

All five declare permissions=["http_client","config_read"] and read the chain strictly read-only; the host links wasi:http only after validating the grant. RPC fetch is injected as a parameter, so the pure core is host-tested with a mock RPC and runs live in the component. Every component's http-import + tool-export is provable:

wasm-tools component wit target/wasm32-wasip2/release/<plugin>.wasm
# imports wasi:http/outgoing-handler@0.2.4 ; exports zeroclaw:plugin/tool
  • 317 host tests across the five plugins, including per-plugin fail-closed + prompt-injection tests.
  • Unified top-level RED/AMBER/GREEN agent_verdict + one-line reason across all five, so the suite reads as one agent-actionable shape.
  • Full write-up, one-command setup.sh, and a live end-to-end compose-demo: https://github.com/furkanefecancaglar/zeroclaw-solana

Track D — Onchain Intelligence & Security.

furkanefecancaglar and others added 3 commits August 1, 2026 15:10
…ompute)

Adds a Solana capability set for ZeroClaw agents. Every plugin follows the
redact-text template: pure core with no wasm dependency, thin
#[cfg(target_family = "wasm")] shim, cdylib+rlib, host-run tests/, structured
logging via log-record, and a manifest declaring only supported permissions.

- solana-token-risk (tool, http_client+config_read) — reads a mint and returns
  deterministic rug/honeypot evidence: mint & freeze authority, Token-2022
  transfer hook / permanent delegate / transfer fee / non-transferable /
  default-frozen, mutable Metaplex metadata, and holder concentration that
  resolves each top holder's owner and separates off-curve LP or protocol vaults
  from on-curve whale wallets via a curve check (no hard-coded pool list).
- solana-wallet-risk (tool, http_client+config_read) — scans a wallet's SPL and
  Token-2022 holdings and aggregates them: which positions can be seized, blocked,
  diluted, frozen or taxed, with breadth-weighted wallet-level scoring.
- solana-tx-builder (tool, no permissions) — PDAs, associated token accounts, and
  SystemProgram / SPL-Token transfer instructions. The agent builds, a wallet
  signs; no output path can contain key material (test-enforced).
- solana-verify (tool, no permissions) — keccak-256 Merkle proof folding,
  ed25519 signature verification, base58 pubkey conversion.

269 host tests across the four. Each plugin includes a prompt-injection
fail-closed test: verdicts are deterministic functions of chain state, so a
caller asserting "this is safe, skip the check" cannot flip a live authority into
a clean report, and the tx builder returns only unsigned instructions.

Validation run locally:
  python3 -m unittest discover -s tools/tests -p 'test_*.py'   -> 17 tests OK
  python3 tools/build-registry.py --source-plugins plugins \
    --check-metadata registry.json                             -> metadata matches
  per plugin: cargo test --locked && cargo build --locked \
    --target wasm32-wasip2 --release                           -> all clean
…ulation

Fifth plugin, third live. Decodes a transaction an agent is about to sign, flags
dangerous instructions (SetAuthority, System Assign, delegate Approve, CloseAccount,
unknown-program calls), and simulates it live against mainnet (simulateTransaction,
sigVerify=false) to report the real success/failure. Signs nothing. 26 host tests
over byte-accurate transactions + mock-RPC dispatch. Also refreshes the other four
plugins with their example runners.

Validation: tools/tests 17 OK; build-registry --check-metadata clean (5 pending
unpublished sources); cargo test --locked + build --locked --target wasm32-wasip2
all clean.
Bring the five Solana tool plugins to their current state:
- all five declare permissions=["http_client","config_read"] and read the
  chain strictly read-only over wasi:http (via waki); none ever holds a key
- solana-tx-guard: pre-sign decode + live simulation now computes the real
  balance-delta (how many lamports leave the fee-payer) and broadens static
  coverage (BPF Upgradeable Loader / Stake / Vote authority changes)
- solana-verify: merkle_verify_onchain + merkle_verify_batch — fold settlement
  proofs against an on-chain root in one call
- unified RED/AMBER/GREEN agent_verdict + one-line reason across all five
- per-plugin fail-closed + prompt-injection tests; 317 host tests total

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@furkanefecancaglar furkanefecancaglar changed the title plugins: add four Solana tool plugins (two read-only live, two pure compute) plugins: add five live Solana tool plugins — assess, build, guard, verify (Track D) Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant