The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(crypto): stop the crypto agent describing five tools it can never call\n\n`crypto_agent`'s prompt built its entire safety procedure on tool names that\nresolve to nothing. Hard rule 2 told it to "confirm the relevant balance with\n`wallet_balances`"; rule 3 that "a `wallet_execute_prepared` call MUST be\npreceded by a matching `wallet_prepare_*`"; rule 4 to confirm before calling\n`wallet_execute_prepared`. None of those three tools exists. `ToolScope::Named`\ndrops an unregistered name at spawn (`subagent_runner/tool_prep.rs`), so they\nnever reached the model — the agent was following a procedure whose central\ncall could not be made.\n\nThe five names are not fiction, which is why this is a retarget and not a\ndeletion. Each has a working backing function exposed as a `wallet.*` RPC\nmethod (`web3/wallet/schemas.rs:59-68`) — `balances`, `network_defaults`,\n`supported_assets`, `encode_erc20_transfer`, `execute_prepared`. They were\nnever given agent Tool wrappers. `crypto_agent/agent.toml` said so itself:\n"this list also describes the agent's *intended* tool surface as wallet +\nexchange tools land." The intent never landed; the prompt was written as though\nit had.\n\nThe agent does have a real execute path, and the safety rules now gate on it:\n`web3_swap_execute` / `web3_bridge_execute` / `web3_dapp_execute`, each\nconsuming the `quote_id` its matching quote call returned, with\n`confirmed: true` enforced in `web3/store.rs:158`. Plain transfers are\ndocumented as prepare-only — `wallet_prepare_transfer` returns a quote and\nnothing in the agent's surface executes it, so the prompt now says to hand off\nto the wallet UI rather than describing a broadcast it cannot perform.\n\nRule 4 is not weakened. It gains a line: `confirmed: true` is a machine gate,\nnot a substitute for asking, and setting it without having asked is what the\nrule forbids. Worth stating because that gate runs on\n`ask_user_clarification`, which only began working on the top-level chat path\nthis morning (#6213) — so confirm-before-execute has never actually run as\ndesigned.\n\nDeliberately NOT done: adding a `wallet_execute_prepared` Tool wrapper. It\nsigns and broadcasts. Exposing it to an agent is a money-path decision that\nbelongs in a change arguing for it, not in an allowlist entry. The toml now\nrecords the five RPC-only names and why they are absent.\n\nAlso removes the five from the `crypto` pack (20 -> 15 tools) and corrects its\nsummary, which still advertised "balances". `render_pack_filtered` skips an\nunresolvable name silently, so the rendered menu had been quietly short.\n\nNew guard: `every_packed_tool_name_resolves_to_a_registered_tool` fails if any\npack names a tool that is neither registered nor a delegate name. The `composio`\npack is exempt — its tools register only once the user is signed in to Composio\n(`integrations/composio/tools_part_03.rs:320-323`), runtime auth state a unit\ntest cannot satisfy, so their absence says nothing about whether the names are\nreal.\n\nVerified: 1904 passed / 0 failed across `tools::` + `agent::registry`.\nRevert-check: with the fix reverted and the guard kept, it fails naming exactly\nthe five — `["crypto::wallet_balances", "crypto::wallet_network_defaults",\n"crypto::wallet_supported_assets", "crypto::wallet_encode_erc20_transfer",\n"crypto::wallet_execute_prepared"]` — and nothing else.\n
M3gA-Mind739764c6fdc9
diff --git a/src/openhuman/agent/registry/agents/crypto_agent/agent.toml b/src/openhuman/agent/registry/agents/crypto_agent/agent.tomlindex cdb6b227db..3a3d5d7304 100644--- a/src/openhuman/agent/registry/agents/crypto_agent/agent.toml+++ b/src/openhuman/agent/registry/agents/crypto_agent/agent.toml@@ -25,31 +25,38 @@ hint = "burst"# file_write, no broad HTTP, no integration delegation. Wallet names line up# with the wallet RPC controllers in `src/openhuman/web3/wallet/schemas.rs`# (read: status/balances/supported_assets/chain_status + tx_status/tx_receipt/-# lookup_tx; quote/prepare: prepare_transfer; execute: execute_prepared). The-# higher-level swap/bridge/dapp surface lives in the `web3_*` tools, which-# build on the wallet's signing primitives. Tools that aren't yet registered-# are silently dropped by the tool filter at spawn time, so this list also-# describes the agent's *intended* tool surface as wallet + exchange tools land.+# lookup_tx; quote/prepare: prepare_transfer). The higher-level swap/bridge/dapp+# surface lives in the `web3_*` tools, which build on the wallet's signing+# primitives.+#+# This list holds ONLY names that resolve to a registered tool. An unregistered+# name is silently dropped by the tool filter at spawn time+# (`ToolScope::Named`, `harness/subagent_runner/tool_prep.rs`), so it never+# reaches the model and an aspirational entry buys nothing — it only misleads+# the next reader, and the prompt that was written against it described calls+# that could never resolve.+#+# NOT LISTED, deliberately — these exist as `wallet.*` RPC methods+# (`web3/wallet/schemas.rs`) with working backing functions, but have no agent+# Tool wrapper, so the agent cannot call them:+# wallet_balances, wallet_network_defaults, wallet_supported_assets,+# wallet_encode_erc20_transfer, wallet_execute_prepared+# Exposing `wallet_execute_prepared` in particular is a money-path decision+# (it signs and broadcasts): it belongs in a change that argues for it, not in+# an allowlist entry. Until then the agent prepares transfers and the user+# completes them in the wallet UI — see hard rule 3 in `prompt.md`.named = [# Read-only wallet inspection."wallet_status",- "wallet_balances",- "wallet_network_defaults",- "wallet_supported_assets","wallet_chain_status",- "wallet_encode_erc20_transfer",# Transaction inspection — status / receipt / raw lookup by hash."wallet_tx_status","wallet_tx_receipt","wallet_lookup_tx",- # Quote / prepare a native or token transfer. MUST be called before- # wallet_execute_prepared — returns a deterministic transaction blob- # plus fee estimate the agent shows the user for confirmation.+ # Quote / prepare a native or token transfer. Returns a deterministic+ # transaction blob plus a fee estimate the agent shows the user. NOTE:+ # nothing in this surface executes it — see the block above."wallet_prepare_transfer",- # Sign + broadcast a previously-prepared blob. Refuses to fabricate- # parameters — only consumes a `quoteId` returned by the matching- # wallet_prepare_* call earlier in this turn.- "wallet_execute_prepared",# High-level web3: swaps (same-chain), bridges (cross-chain), and# generic EVM dapp calls. Each quote/call returns a quoteId that MUST# be confirmed via the matching web3_*_execute before broadcast.@@ -66,7 +73,7 @@ named = ["stock_exchange_rate","stock_crypto_series",# Confirmation gate — the agent MUST call this before any- # wallet_execute_prepared / write-side exchange order. The runtime+ # web3_*_execute / write-side exchange order. The runtime# routes the prompt to the user and blocks until they reply."ask_user_clarification",# Time grounding for "as of <when>" framing and freshness checks ondiff --git a/src/openhuman/agent/registry/agents/crypto_agent/prompt.md b/src/openhuman/agent/registry/agents/crypto_agent/prompt.mdindex 80a00f9f97..2c82bfaf3d 100644--- a/src/openhuman/agent/registry/agents/crypto_agent/prompt.md+++ b/src/openhuman/agent/registry/agents/crypto_agent/prompt.md@@ -21,9 +21,11 @@ You are the **Crypto Agent** — OpenHuman's specialist for wallet and market op## Hard rules1. **No fabrication.** Every chain id, token contract address, market symbol, fee, slippage number, and exchange order id you act on must come from a tool result or the user, never a guess. If you don't have it, ask. (The shared grounding rules already forbid inventing tool names or claiming a tool you cannot see.)-2. **Read before write.** Before any `wallet_prepare_*` call, confirm the relevant balance / chain status with `wallet_balances` / `wallet_chain_status` (or a recent earlier-in-turn result). Use `wallet_network_defaults` when you need the default RPC / explorer / asset catalog for a chain. Before any `wallet_execute_prepared`, confirm the freshness of the prepared blob with `current_time` — re-prepare if the quote is older than ~60s.-3. **Quote before execute.** A `wallet_execute_prepared` call MUST be preceded by a matching `wallet_prepare_*` call **in this same turn**, and the `prepared_id` you pass MUST be the one that call returned. No exceptions. For ERC-20 transfers, `wallet_encode_erc20_transfer` exists if you need ABI calldata inspection, but prefer `wallet_prepare_transfer` for the actual execution flow.-4. **Confirm before execute.** Before calling `wallet_execute_prepared` (or any write-side exchange order), call `ask_user_clarification` with a tight summary: `from → to`, asset + amount, chain, fee, slippage, and any non-obvious detail (bridging, approval first, etc.). Only proceed on an explicit yes.+2. **Read before write.** Before any `wallet_prepare_*` or `web3_*_quote` call, confirm the chain is reachable with `wallet_chain_status`, and the account exists with `wallet_status` (or a recent earlier-in-turn result). **You have no balance-reading tool** — `wallet_status` reports configuration and accounts, not holdings. Do not claim a balance you were not told: either ask the user, or let the quote step surface an insufficiency and report that verbatim (rule 6). Before any `web3_*_execute`, confirm the freshness of the quote with `current_time` — re-quote if it is older than ~60s.+3. **Quote before execute.** A `web3_swap_execute` / `web3_bridge_execute` / `web3_dapp_execute` call MUST be preceded by its matching `web3_swap_quote` / `web3_bridge_quote` / `web3_dapp_call` **in this same turn**, and the `quote_id` you pass MUST be the one that call returned. No exceptions — the quote is consumed on execute and the engine rejects a call without `confirmed: true`.++ **Plain transfers are prepare-only.** `wallet_prepare_transfer` returns a quote, but **no tool in your surface executes it** — the execute step is a `wallet.*` RPC the app calls, not something you can invoke. Prepare the transfer, present it, and tell the user to complete it in the wallet UI. Never imply you have broadcast a plain transfer, and never claim a transaction hash you did not receive from a tool.+4. **Confirm before execute.** Before any `web3_*_execute` (or any write-side exchange order), call `ask_user_clarification` with a tight summary: `from → to`, asset + amount, chain, fee, slippage, and any non-obvious detail (bridging, approval first, etc.). Only proceed on an explicit yes. `confirmed: true` is a machine gate, not a substitute for this — setting it without having asked is the thing this rule forbids.5. **Stop cleanly on missing setup.** If a wallet identity, chain, exchange connection, or required auth is missing, do not retry, do not guess. Say which thing is missing, point to **Connections** (or **Settings → Recovery Phrase** for wallet identities), and stop.6. **Stop cleanly on insufficient liquidity / balance.** If a quote fails for liquidity, slippage, or balance reasons, surface the reason verbatim, suggest the smallest viable adjustment (lower amount, different route), and wait for the user.7. **Never log secrets.** Do not echo private keys, seed phrases, mnemonics, exchange API secrets, or signed transaction payloads in your replies. Quote the public address and the prepared id, nothing more.@@ -31,10 +33,10 @@ You are the **Crypto Agent** — OpenHuman's specialist for wallet and market op## Standard flow1. **Frame the intent.** Restate the request in one short sentence: who pays, what asset, on which chain, to whom, why. If anything is ambiguous (chain, asset, recipient), ask once with `ask_user_clarification`.-2. **Inspect.** `wallet_status` + `wallet_balances` (and `wallet_chain_status` for the target chain) to confirm the account exists, has the asset, and the chain is reachable. For market questions, `stock_crypto_series` / `stock_exchange_rate` to ground the answer.-3. **Quote.** Call the right `wallet_prepare_*` once. Inspect fees, slippage, route. If anything is wildly off (slippage > a sensible bound, fee > a sensible fraction of the transfer, route involves unexpected hops), surface it as a concern, not a fait accompli.+2. **Inspect.** `wallet_status` (account exists, chains configured) + `wallet_chain_status` (target chain reachable). You cannot read holdings — if the request depends on a balance, ask. For market questions, `stock_crypto_series` / `stock_exchange_rate` to ground the answer.+3. **Quote.** Call the right `wallet_prepare_*` (transfers) or `web3_*_quote` / `web3_dapp_call` (swaps, bridges, contract calls) once. Inspect fees, slippage, route. If anything is wildly off (slippage > a sensible bound, fee > a sensible fraction of the transfer, route involves unexpected hops), surface it as a concern, not a fait accompli.4. **Confirm.** Summarise the prepared transaction and call `ask_user_clarification`. Show: source identity (truncated address), destination (full address + label if known), asset + amount, native fee, slippage, est. landing time, prepared id.-5. **Execute.** On explicit confirmation, call `wallet_execute_prepared` with the exact `prepared_id`. Report back the broadcast result (tx hash / order id), and the chain explorer URL only if the tool returned one — do not synthesise explorer links from the hash.+5. **Execute — swaps, bridges and contract calls only.** On explicit confirmation, call the matching `web3_*_execute` with the exact `quote_id` and `confirmed: true`. Report the broadcast result (tx hash / order id), and the chain explorer URL only if the tool returned one — do not synthesise explorer links from the hash. **For a plain transfer there is no step 5**: stop after step 4 and hand off to the wallet UI.6. **On failure.** Show a **sanitized** summary of the tool's error — never echo raw payloads, signed transaction blobs, full RPC responses, stack traces, request ids, or any field that could embed a secret. Redact long opaque tokens to a short prefix (e.g. `0xfee…dead`). Then name the likely cause in one line (e.g. "RPC rejected — nonce gap", "insufficient gas"), and stop. Do not auto-retry write operations.## Output shapediff --git a/src/openhuman/agent/registry/agents/crypto_agent/prompt_tests.rs b/src/openhuman/agent/registry/agents/crypto_agent/prompt_tests.rsindex 097fa5b5ba..2ab5fbfe0f 100644--- a/src/openhuman/agent/registry/agents/crypto_agent/prompt_tests.rs+++ b/src/openhuman/agent/registry/agents/crypto_agent/prompt_tests.rs@@ -50,9 +50,19 @@ fn build_enforces_read_simulate_confirm_execute() {body.contains("ask_user_clarification"),"prompt must require explicit user confirmation before execute");+ // The executable surface is the web3 quote/execute family, which consumes+ // the `quote_id` its matching quote call returned (`web3/store.rs`+ // `execute_quote` -> `take_quote_for`). It was `prepared_id` when the prompt+ // was written against `wallet_execute_prepared` — a `wallet.*` RPC method+ // that has no agent Tool wrapper, so that call could never resolve.assert!(- body.contains("prepared_id"),- "execute step must consume a prepared_id, not fabricated parameters"+ body.contains("quote_id"),+ "execute step must consume a quote_id returned by the matching quote call, \+ not fabricated parameters"+ );+ assert!(+ body.contains("prepare-only") || body.contains("no tool in your surface executes it"),+ "prompt must state plainly that a plain transfer cannot be executed by this agent");}diff --git a/src/openhuman/agent/registry/agents/loader_tests_part_03_tests.rs b/src/openhuman/agent/registry/agents/loader_tests_part_03_tests.rsindex 667d00618f..3681caa4e0 100644--- a/src/openhuman/agent/registry/agents/loader_tests_part_03_tests.rs+++ b/src/openhuman/agent/registry/agents/loader_tests_part_03_tests.rs@@ -20,14 +20,13 @@ fn crypto_agent_has_narrow_wallet_market_tools_and_safety_on() {match &def.tools {ToolScope::Named(tools) => {// Wallet read surface.- for required in [- "wallet_status",- "wallet_balances",- "wallet_network_defaults",- "wallet_supported_assets",- "wallet_chain_status",- "wallet_encode_erc20_transfer",- ] {+ // Only names with a registered agent Tool. `wallet_balances`,+ // `wallet_network_defaults`, `wallet_supported_assets` and+ // `wallet_encode_erc20_transfer` are `wallet.*` RPC methods with no+ // Tool wrapper — asserting them here pinned an allowlist entry the+ // spawn filter drops, so the assertion passed while the capability+ // did not exist.+ for required in ["wallet_status", "wallet_chain_status"] {assert!(tools.iter().any(|t| t == required),"crypto_agent needs read tool `{required}`"@@ -53,12 +52,26 @@ fn crypto_agent_has_narrow_wallet_market_tools_and_safety_on() {"crypto_agent needs tx-read tool `{required}`");}- // Execute surface — gated by the prepared blob from a- // matching prepare_* call in the same turn.+ // Execute surface. There is no `wallet_execute_prepared` TOOL —+ // it is a `wallet.*` RPC only — so a plain transfer is prepare-only+ // for this agent. The executable surface is the web3 quote/execute+ // family, and THAT is what the prompt's confirm-before-execute rule+ // now gates on.assert!(- tools.iter().any(|t| t == "wallet_execute_prepared"),- "crypto_agent needs wallet_execute_prepared"+ !tools.iter().any(|t| t == "wallet_execute_prepared"),+ "wallet_execute_prepared has no Tool wrapper; listing it puts a \+ call in the prompt that can never resolve");+ for required in [+ "web3_swap_execute",+ "web3_bridge_execute",+ "web3_dapp_execute",+ ] {+ assert!(+ tools.iter().any(|t| t == required),+ "crypto_agent needs {required} for the confirm-before-execute flow"+ );+ }// Confirmation gate — MUST be present so the prompt's// "confirm before execute" rule is mechanically enforceable.assert!(diff --git a/src/openhuman/tools/ops_tests_part_01_tests.rs b/src/openhuman/tools/ops_tests_part_01_tests.rsindex a54ed8dba0..9f671c3a8e 100644--- a/src/openhuman/tools/ops_tests_part_01_tests.rs+++ b/src/openhuman/tools/ops_tests_part_01_tests.rs@@ -159,6 +159,79 @@ fn all_tools_includes_spawn_parallel_agents() {);}+#[test]+fn every_packed_tool_name_resolves_to_a_registered_tool() {+ // A pack advertises a menu. `render_pack_filtered` skips a name it cannot+ // resolve (tools.rs "a pack may name a tool this build compiled out"), so a+ // stale entry does not error — the listing is just quietly short, and any+ // prompt that instructs the agent to call it describes a tool that will+ // never appear in its schema. The `crypto` pack carried five such names+ // (`wallet_balances`, `wallet_network_defaults`, `wallet_supported_assets`,+ // `wallet_encode_erc20_transfer`, `wallet_execute_prepared`) whose backing+ // functions exist only as `wallet.*` RPC methods, never as agent tools.+ //+ // Scoped to the default feature set this test binary is built with: a name+ // compiled out by a disabled feature is a legitimate skip, so the assertion+ // fires only for names no build registers.+ let tmp = TempDir::new().unwrap();+ let security = Arc::new(SecurityPolicy::default());+ let browser = BrowserConfig {+ enabled: false,+ allowed_domains: vec![],+ session_name: None,+ ..BrowserConfig::default()+ };+ let http = crate::openhuman::config::HttpRequestConfig::default();+ let cfg = test_config(&tmp);++ let tools = all_tools(+ Arc::new(Config::default()),+ &security,+ AuditLogger::disabled(),+ &browser,+ &http,+ tmp.path(),+ &HashMap::new(),+ &cfg,+ );+ let registered: std::collections::HashSet<&str> = tools.iter().map(|t| t.name()).collect();++ // Delegation tools are synthesised per-session from each agent's+ // `delegate_name`, not built by `all_tools`, so they are legitimately+ // absent here. `owners` holds agent ids (`crypto_agent`); the names that+ // appear in `tools` are delegate names (`do_crypto`), so resolve them from+ // the agent registry rather than from `owners`.+ let delegates: std::collections::HashSet<String> =+ crate::openhuman::agent::registry::agents::load_builtins()+ .unwrap_or_default()+ .into_iter()+ .filter_map(|d| d.delegate_name)+ .collect();++ let mut missing: Vec<String> = Vec::new();+ for pack in crate::openhuman::tools::toolpacks::PACKS {+ // `composio`'s tools are registered only once the user is signed in to+ // Composio (`all_composio_agent_tools` returns an empty vec otherwise,+ // `integrations/composio/tools_part_03.rs:320-323`), which is runtime+ // auth state a unit test cannot satisfy. Their absence here says+ // nothing about whether the names are real, so the pack is exempt.+ if pack.id == "composio" {+ continue;+ }+ for name in pack.tools {+ if registered.contains(name) || delegates.contains(*name) {+ continue;+ }+ missing.push(format!("{}::{}", pack.id, name));+ }+ }+ assert!(+ missing.is_empty(),+ "every tool named in a pack must resolve to a registered tool (or be a \+ delegate name); these do not: {missing:?}"+ );+}+#[test]fn all_tools_always_registers_curl() {// Regression guard: `curl` is always registered (gated only bydiff --git a/src/openhuman/tools/toolpacks/registry.rs b/src/openhuman/tools/toolpacks/registry.rsindex 54d2c45d14..e0ab40c41b 100644--- a/src/openhuman/tools/toolpacks/registry.rs+++ b/src/openhuman/tools/toolpacks/registry.rs@@ -61,17 +61,17 @@ pub const PACKS: &[ToolPack] = &[},ToolPack {id: "crypto",- summary: "Crypto wallet and market actions: balances, transfers, swaps, bridges, contract calls and x402 paid requests.",+ summary: "Crypto wallet and market actions: transfer quotes, swaps, bridges, contract calls and x402 paid requests.",+ // `wallet_balances`, `wallet_network_defaults`, `wallet_supported_assets`,+ // `wallet_encode_erc20_transfer` and `wallet_execute_prepared` are NOT+ // listed: they exist as `wallet.*` RPC methods but have no agent Tool+ // wrapper, and `render_pack_filtered` skips an unresolvable name+ // silently — so listing them only made the rendered menu quietly short.tools: &["do_crypto","wallet_status",- "wallet_balances",- "wallet_network_defaults",- "wallet_supported_assets","wallet_chain_status",- "wallet_encode_erc20_transfer","wallet_prepare_transfer",- "wallet_execute_prepared","wallet_tx_status","wallet_tx_receipt","wallet_lookup_tx",diff --git a/src/openhuman/tools/toolpacks/toolpacks_tests.rs b/src/openhuman/tools/toolpacks/toolpacks_tests.rsindex cd5ca13c7c..e867aa4c77 100644--- a/src/openhuman/tools/toolpacks/toolpacks_tests.rs+++ b/src/openhuman/tools/toolpacks/toolpacks_tests.rs@@ -295,13 +295,8 @@ fn every_pack_declares_the_tools_it_is_named_for() {&["do_crypto","wallet_status",- "wallet_balances",- "wallet_network_defaults",- "wallet_supported_assets","wallet_chain_status",- "wallet_encode_erc20_transfer","wallet_prepare_transfer",- "wallet_execute_prepared","wallet_tx_status","wallet_tx_receipt","wallet_lookup_tx",