everclaw
Skill1 starsChanged 12 days agoMITView on GitHub
AI inference you own, forever powering your OpenClaw agents via the Morpheus decentralized network. Stake MOR tokens, access Kimi K2.5 and 30+ models, and maintain persistent inference by recycling staked MOR. Includes Morpheus API Gateway bootstrap for zero-config startup, OpenAI-compatible proxy with auto-session management, automatic retry with fresh sessions, OpenAI-compatible error classification to prevent cooldown cascades, multi-key auth profile rotation for Venice API keys, Gateway Guardian v2 with inference probes and nuclear self-healing restart, bundled security skills, zero-dependency wallet management via macOS Keychain, x402 payment client for agent-to-agent USDC payments, and ERC-8004 agent registry reader for discovering trustless agents on Base.
- Pipes a download into a shell
- Reads credentials
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- profbernardoj/everclawedited, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- profbernardoj/everclaw★ 11238% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository199 other files it gives its agents.
- activecampaignSkill
- adcp-advertisingSkill
- admapixSkill
- aegis-auditSkill
- afrexai-compliance-auditSkill
- afrexai-seo-content-engineSkill
- agent-browserSkill
- agentic-codingSkill
- agent-overflowSkill
- agent-skills-toolsSkill
- ai-ppt-generatorSkill
- airdrop-hunterSkill
- ai-web-automationSkill
- alicloud-ai-video-wan-r2vSkill
- alpha-finderSkill
- amap-trafficSkill
- amazon-product-apiSkill
- apertureSkill
- api-developmentSkill
- api-gatewaySkill
- asterSkill
- auto-replySkill
- auto-updaterSkill
- aviation-weatherSkill
- awwwards-designSkill
- base-8004Skill
- bioskillsSkill
- brainrepoSkill
- browserless-agentSkill
- browser-secureSkill
- btc15-autonomous-marketSkill
- buy-anythingSkill
- byteroverSkill
- cal-com-automationSkill
- capability-evolverSkill
- catalogSkill
- chargebeeSkill
- clawcostSkill
- clawdbot-documentation-expertSkill
- clawdbot-for-vcsSkill
- clawddocsSkill
- claw-syncSkill
- claw-trader-liteSkill
- clean-codeSkill
- cloudphoneSkill
- cls-certifySkill
- codebergSkill
- code-mentorSkill
- commit-analyzerSkill
- competitor-analysis-reportSkill
- content-ideas-generatorSkill
- content-ideasSkill
- contract-generatorSkill
- conventional-commitsSkill
- copywritingSkill
- crypto-payments-ecommerceSkill
- custom-smtp-senderSkill
- dashboard-manager2Skill
- data-analystSkill
- docker-sandboxSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. About 0 are common, 17 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
When the session ends, your MOR is returned (minus tiny usage fees)
- Very specific: line 44
Don't have anything on Base yet?
- Distinctive: line 96
After cloning, install the proxy-router:
- Very specific: line 113
After installation, ~/morpheus/ should contain:
- Distinctive: line 222
Wait a few seconds, then verify:
- Distinctive: line 243
Before opening sessions, approve the Diamond contract to transfer MOR on your behalf:
- Distinctive: line 276
When the session closes, MOR is returned to your wallet
- Distinctive: line 385
After restarting the router:
- Very specific: line 629
Key distinction: All Morpheus infrastructure errors are typed as "server_error" — never "billing" or "rate_limit_error".
- Distinctive: line 643
When the proxy-router returns a session-related error (expired, invalid, not found, closed), the proxy now:
- Very specific: line 687
Add to your openclaw.json via config patch or manual edit:
- Distinctive: line 787
If you have multiple Venice API keys (e.g., from different accounts or plans), add them all as separate profiles.
- Distinctive: line 844
Billing disable: When a key returns a billing/credit error, that *profile* is disabled with exponential backoff (starts at 5 hours).
- Very specific: line 845
Rotation on failure: After disabling a profile, OpenClaw immediately tries the next key in auth.order.
- Distinctive: line 846
Model fallback: Only after ALL profiles for Venice are disabled does OpenClaw move to the next model in the fallback chain (e.g., Morpheus).
- Distinctive: line 899
If any one responds, inference is available
- Distinctive: line 906
Signal notification: before nuclear restart (via signal-cli if available)
- Very specific: line 1243
When to use: Before installing any skill from ClawHub or untrusted sources.
- Very specific: line 1266
When to use: After initial setup, after installing new skills, and periodically (weekly recommended).
- Distinctive: line 1320
Before installing any new skill: Run SkillGuard scan
- Distinctive: line 1321
After setup and periodically: Run ClawdStrike audit
- Distinctive: line 1323
Always: Follow Bagman patterns for key management (1Password, session keys, no keys on disk)
- Distinctive: line 1339
All LIGHT and STANDARD tier models run through Morpheus (free via staked MOR).
- Very specific: line 1465
Run node scripts/bootstrap-gateway.mjs — agent gets free inference immediately
- Very specific: line 1521
All models also have :web variants with web search capability.
- Very specific: line 1544
Important: All gateway models must have "reasoning": false — the upstream litellm rejects the reasoning_effort parameter.
- Distinctive: line 1552
Create an account and sign in
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
迁移说明:本技能原为 OpenClaw / ClawHub 生态技能,现已转为 WorkBuddy 技能规范。正文如出现
openclaw/clawhub/claw命令或~/.openclaw路径,请忽略该命令形式,改用 WorkBuddy 等价操作:技能目录 =~/.workbuddy/skills/<name>/;装包用 pip / npm;联网用 WebSearch / WebFetch;读写文件用 Read / Write / Edit;执行命令用 Bash(Windows 走 PowerShell 工具)。
运行依赖:需要本机已安装命令
curl、node;缺失时先安装 / 配置,再执行正文步骤。
♾️ Everclaw — AI Inference You Own, Forever Powering Your OpenClaw Agents
Powered by Morpheus AI
Access Kimi K2.5, Qwen3, GLM-4, Llama 3.3, and 10+ models with inference you own. Everclaw connects your OpenClaw agent to the Morpheus P2P network — stake MOR tokens, open sessions, and recycle your stake for persistent, self-sovereign access to AI.
⚠️ ClawHub Name Collision: A different product ("Everclaw Vault" — encrypted cloud memory) uses the
everclawslug on ClawHub. DO NOT runclawhub update everclaw— it will overwrite this skill with an unrelated product. Updates for this skill come from GitHub:cd skills/everclaw && git pull. SeeCLAWHUB_WARNING.mdfor details and recovery steps.
How It Works
- Get MOR tokens on Base — swap from ETH/USDC via Uniswap or Aerodrome (see below)
- You run a proxy-router (Morpheus Lumerin Node) locally as a consumer
- The router connects to Base mainnet and discovers model providers
- You stake MOR tokens to open a session with a provider (MOR is locked, not spent)
- You send inference requests to
http://localhost:8082/v1/chat/completions - When the session ends, your MOR is returned (minus tiny usage fees)
- Re-stake the returned MOR into new sessions → persistent inference you own
Getting MOR Tokens
You need MOR on Base to stake for inference. If you already have ETH, USDC, or USDT on Base:
# Swap ETH for MOR
bash skills/everclaw/scripts/swap.sh eth 0.01
# Swap USDC for MOR
bash skills/everclaw/scripts/swap.sh usdc 50Or swap manually on a DEX:
- Uniswap: MOR/ETH on Base
- Aerodrome: MOR swap on Base
Don't have anything on Base yet? Buy ETH on Coinbase, withdraw to Base, then swap to MOR. See references/acquiring-mor.md for the full guide.
How much do you need? MOR is staked, not spent — you get it back. 50-100 MOR is enough for daily use. 0.005 ETH covers months of Base gas fees.
Architecture
Agent → proxy-router (localhost:8082) → Morpheus P2P Network → Provider → Model
↓
Base Mainnet (MOR staking, session management)1. Installation
Recommended: One-Command Installer (v0.9.2)
The safe installer handles fresh installs, updates, and ClawHub collision detection:
# Fresh install
curl -fsSL https://raw.githubusercontent.com/profbernardoj/everclaw/main/scripts/install-everclaw.sh | bash
# Or if you already have the skill:
bash skills/everclaw/scripts/install-everclaw.sh
# Check for updates
bash skills/everclaw/scripts/install-everclaw.sh --checkThe installer will:
- Detect and warn about the ClawHub "Everclaw Vault" name collision
- Clone from GitHub (fresh install) or
git pull(update) - Show next steps for router, proxy, and wallet setup
Alternative: Manual Git Clone
git clone https://github.com/profbernardoj/everclaw.git ~/.workbuddy/skills/everclawUpdating
⚠️ DO NOT use clawhub update everclaw — a different product uses that slug on ClawHub. Always update via git:
cd ~/.workbuddy/skills/everclaw && git pullInstall the Morpheus Router
After cloning, install the proxy-router:
bash skills/everclaw/scripts/install.shThis downloads the latest proxy-router release for your OS/arch, extracts it to ~/morpheus/, and creates initial config files.
Manual Installation
- Go to Morpheus-Lumerin-Node releases
- Download the release for your platform (e.g.,
mor-launch-darwin-arm64.zip) - Extract to
~/morpheus/ - On macOS:
xattr -cr ~/morpheus/
Required Files
After installation, ~/morpheus/ should contain:
| File | Purpose |
proxy-router | The main binary |
.env | Configuration (RPC, contracts, ports) |
models-config.json | Maps blockchain model IDs to API types |
.cookie | Auto-generated auth credentials |
2. Configuration
.env File
The .env file configures the proxy-router for consumer mode on Base mainnet. Critical variables:
# RPC endpoint — MUST be set or router silently fails
ETH_NODE_ADDRESS=https://base-mainnet.public.blastapi.io
ETH_NODE_CHAIN_ID=8453
# Contract addresses (Base mainnet)
DIAMOND_CONTRACT_ADDRESS=0x6aBE1d282f72B474E54527D93b979A4f64d3030a
MOR_TOKEN_ADDRESS=0x7431aDa8a591C955a994a21710752EF9b882b8e3
# Wallet key — leave blank, inject at runtime via 1Password
WALLET_PRIVATE_KEY=
# Proxy settings
PROXY_ADDRESS=0.0.0.0:3333
PROXY_STORAGE_PATH=./data/badger/
PROXY_STORE_CHAT_CONTEXT=true
PROXY_FORWARD_CHAT_CONTEXT=true
MODELS_CONFIG_PATH=./models-config.json
# Web API
WEB_ADDRESS=0.0.0.0:8082
WEB_PUBLIC_URL=http://localhost:8082
# Auth
AUTH_CONFIG_FILE_PATH=./proxy.conf
COOKIE_FILE_PATH=./.cookie
# Logging
LOG_COLOR=true
LOG_LEVEL_APP=info
LOG_FOLDER_PATH=./data/logs
ENVIRONMENT=production⚠️ ETH_NODE_ADDRESS MUST be set. The router silently connects to an empty string without it and all blockchain operations fail. Also MODELS_CONFIG_PATH must point to your models-config.json.
models-config.json
⚠️ This file is required. Without it, chat completions fail with "api adapter not found".
{
"$schema": "./internal/config/models-config-schema.json",
"models": [
{
"modelId": "0xb487ee62516981f533d9164a0a3dcca836b06144506ad47a5c024a7a2a33fc58",
"modelName": "kimi-k2.5:web",
"apiType": "openai",
"apiUrl": ""
},
{
"modelId": "0xbb9e920d94ad3fa2861e1e209d0a969dbe9e1af1cf1ad95c49f76d7b63d32d93",
"modelName": "kimi-k2.5",
"apiType": "openai",
"apiUrl": ""
}
]
}⚠️ Note the format: The JSON uses a "models" array with "modelId" / "modelName" / "apiType" / "apiUrl" fields. The apiUrl is left empty — the router resolves provider endpoints from the blockchain. Add entries for every model you want to use. See references/models.md for the full list.
3. Starting the Router
Secure Launch (1Password)
The proxy-router needs your wallet private key. Never store it on disk. Inject it at runtime from 1Password:
bash skills/everclaw/scripts/start.shOr manually:
cd ~/morpheus
source .env
# Retrieve private key from 1Password (never touches disk)
export WALLET_PRIVATE_KEY=$(
OP_SERVICE_ACCOUNT_TOKEN=$(security find-generic-password -a "YOUR_KEYCHAIN_ACCOUNT" -s "op-service-account-token" -w) \
op item get "YOUR_ITEM_NAME" --vault "YOUR_VAULT_NAME" --fields "Private Key" --reveal
)
export ETH_NODE_ADDRESS
nohup ./proxy-router > ./data/logs/router-stdout.log 2>&1 &Health Check
Wait a few seconds, then verify:
COOKIE_PASS=$(cat ~/morpheus/.cookie | cut -d: -f2)
curl -s -u "admin:$COOKIE_PASS" http://localhost:8082/healthcheckExpected: HTTP 200.
Stopping
bash skills/everclaw/scripts/stop.shOr: pkill -f proxy-router
4. MOR Allowance
Before opening sessions, approve the Diamond contract to transfer MOR on your behalf:
COOKIE_PASS=$(cat ~/morpheus/.cookie | cut -d: -f2)
curl -s -u "admin:$COOKIE_PASS" -X POST \
"http://localhost:8082/blockchain/approve?spender=0x6aBE1d282f72B474E54527D93b979A4f64d3030a&amount=1000000000000000000000"⚠️ The /blockchain/approve endpoint uses query parameters, not a JSON body. The amount is in wei (1000000000000000000 = 1 MOR). Approve a large amount so you don't need to re-approve frequently.
5. Opening Sessions
Open a session by model ID (not bid ID):
MODEL_ID="0xb487ee62516981f533d9164a0a3dcca836b06144506ad47a5c024a7a2a33fc58"
curl -s -u "admin:$COOKIE_PASS" -X POST \
"http://localhost:8082/blockchain/models/${MODEL_ID}/session" \
-H "Content-Type: application/json" \
-d '{"sessionDuration": 3600}'⚠️ Always use the model ID endpoint, not the bid ID. Using a bid ID results in "dial tcp: missing address".
Session Duration
- Duration is in seconds: 3600 = 1 hour, 86400 = 1 day
- Two blockchain transactions occur: approve transfer + open session
- MOR is staked (locked) for the session duration
- When the session closes, MOR is returned to your wallet
Response
The response includes a sessionId (hex string). Save this — you need it for inference.
Using the Script
# Open a 1-hour session for kimi-k2.5:web
bash skills/everclaw/scripts/session.sh open kimi-k2.5:web 3600
# List active sessions
bash skills/everclaw/scripts/session.sh list
# Close a session
bash skills/everclaw/scripts/session.sh close 0xSESSION_ID_HERE6. Sending Inference
⚠️ THE #1 GOTCHA: Headers, Not Body
session_id and model_id are HTTP headers, not JSON body fields. This is the single most common mistake.
CORRECT:
curl -s -u "admin:$COOKIE_PASS" "http://localhost:8082/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "session_id: 0xYOUR_SESSION_ID" \
-H "model_id: 0xYOUR_MODEL_ID" \
-d '{
"model": "kimi-k2.5:web",
"messages": [{"role": "user", "content": "Hello, world!"}],
"stream": false
}'WRONG (will fail with "session not found"):
# DON'T DO THIS
curl -s ... -d '{
"model": "kimi-k2.5:web",
"session_id": "0x...", # WRONG — not a body field
"model_id": "0x...", # WRONG — not a body field
"messages": [...]
}'Using the Chat Script
bash skills/everclaw/scripts/chat.sh kimi-k2.5:web "What is the meaning of life?"Streaming
Set "stream": true in the request body. The response will be Server-Sent Events (SSE).
7. Closing Sessions
Close a session to reclaim your staked MOR:
curl -s -u "admin:$COOKIE_PASS" -X POST \
"http://localhost:8082/blockchain/sessions/0xSESSION_ID/close"Or use the script:
bash skills/everclaw/scripts/session.sh close 0xSESSION_ID⚠️ MOR staked in a session is returned when the session closes. Close sessions you're not using to free up MOR for new sessions.
8. Session Management
Sessions Are Ephemeral
⚠️ Sessions are NOT persisted across router restarts. If you restart the proxy-router, you must re-open sessions. The blockchain still has the session, but the router's in-memory state is lost.
Monitoring
# Check balance (MOR + ETH)
bash skills/everclaw/scripts/balance.sh
# List sessions
bash skills/everclaw/scripts/session.sh listSession Lifecycle
- Open → MOR is staked, session is active
- Active → Send inference requests using session_id header
- Expired → Session duration elapsed; MOR returned automatically
- Closed → Manually closed; MOR returned immediately
Re-opening After Restart
After restarting the router:
# Wait for health check
sleep 5
# Re-open sessions for models you need
bash skills/everclaw/scripts/session.sh open kimi-k2.5:web 36009. Checking Balances
COOKIE_PASS=$(cat ~/morpheus/.cookie | cut -d: -f2)
# MOR and ETH balance
curl -s -u "admin:$COOKIE_PASS" http://localhost:8082/blockchain/balance | jq .
# Active sessions
curl -s -u "admin:$COOKIE_PASS" http://localhost:8082/blockchain/sessions | jq .
# Available models
curl -s -u "admin:$COOKIE_PASS" http://localhost:8082/blockchain/models | jq .10. Troubleshooting
See references/troubleshooting.md for a complete guide. Quick hits:
| Error | Fix |
session not found | Use session_id/model_id as HTTP headers, not body fields |
dial tcp: missing address | Open session by model ID, not bid ID |
api adapter not found | Add the model to models-config.json |
ERC20: transfer amount exceeds balance | Close old sessions to free staked MOR |
| Sessions gone after restart | Normal — re-open sessions after restart |
| MorpheusUI conflicts | Don't run MorpheusUI and headless router simultaneously |
Key Contract Addresses (Base Mainnet)
| Contract | Address |
| Diamond | 0x6aBE1d282f72B474E54527D93b979A4f64d3030a |
| MOR Token | 0x7431aDa8a591C955a994a21710752EF9b882b8e3 |
Quick Reference
| Action | Command |
| Install | bash skills/everclaw/scripts/install.sh |
| Start | bash skills/everclaw/scripts/start.sh |
| Stop | bash skills/everclaw/scripts/stop.sh |
| Swap ETH→MOR | bash skills/everclaw/scripts/swap.sh eth 0.01 |
| Swap USDC→MOR | bash skills/everclaw/scripts/swap.sh usdc 50 |
| Open session | bash skills/everclaw/scripts/session.sh open <model> [duration] |
| Close session | bash skills/everclaw/scripts/session.sh close <session_id> |
| List sessions | bash skills/everclaw/scripts/session.sh list |
| Send prompt | bash skills/everclaw/scripts/chat.sh <model> "prompt" |
| Check balance | bash skills/everclaw/scripts/balance.sh |
11. Wallet Management (v0.4)
Everclaw v0.4 includes a self-contained wallet manager that eliminates all external account dependencies. No 1Password, no Foundry, no Safe Wallet — just macOS Keychain and Node.js (already bundled with OpenClaw).
Setup (One Command)
node skills/everclaw/scripts/everclaw-wallet.mjs setupThis generates a new Ethereum wallet and stores the private key in your macOS Keychain (encrypted at rest, protected by your login password / Touch ID).
Import Existing Key
node skills/everclaw/scripts/everclaw-wallet.mjs import-key 0xYOUR_PRIVATE_KEYCheck Balances
node skills/everclaw/scripts/everclaw-wallet.mjs balanceShows ETH, MOR, USDC balances and MOR allowance for the Diamond contract.
Swap ETH/USDC for MOR
# Swap 0.05 ETH for MOR
node skills/everclaw/scripts/everclaw-wallet.mjs swap eth 0.05
# Swap 50 USDC for MOR
node skills/everclaw/scripts/everclaw-wallet.mjs swap usdc 50Executes onchain swaps via Uniswap V3 on Base. No external tools required — uses viem (bundled with OpenClaw).
Approve MOR for Staking
node skills/everclaw/scripts/everclaw-wallet.mjs approveApproves the Morpheus Diamond contract to use your MOR for session staking.
Security Model
- Private key stored in macOS Keychain (encrypted at rest)
- Protected by your login password / Touch ID
- Key is injected at runtime and immediately unset from environment
- Key is never written to disk as a plaintext file
- For advanced users: 1Password is supported as a fallback (backward compatible)
Full Command Reference
| Command | Description |
setup | Generate wallet, store in Keychain |
address | Show wallet address |
balance | Show ETH, MOR, USDC balances |
swap eth <amount> | Swap ETH → MOR via Uniswap V3 |
swap usdc <amount> | Swap USDC → MOR via Uniswap V3 |
approve [amount] | Approve MOR for Morpheus staking |
export-key | Print private key (use with caution) |
import-key <0xkey> | Import existing private key |
12. OpenAI-Compatible Proxy (v0.2)
The Morpheus proxy-router requires custom auth (Basic auth via .cookie) and custom HTTP headers (session_id, model_id) that standard OpenAI clients don't support. Everclaw includes a lightweight proxy that bridges this gap.
What It Does
OpenClaw/any client → morpheus-proxy (port 8083) → proxy-router (port 8082) → Morpheus P2P → Provider- Accepts standard OpenAI
/v1/chat/completionsrequests - Auto-opens blockchain sessions on demand (no manual session management)
- Auto-renews sessions before expiry (default: 1 hour before)
- Injects Basic auth +
session_id/model_idheaders automatically - Exposes
/health,/v1/models,/v1/chat/completions
Installation
bash skills/everclaw/scripts/install-proxy.shThis installs:
morpheus-proxy.mjs→~/morpheus/proxy/gateway-guardian.sh→~/.workbuddy/workspace/scripts/- launchd plists for both (macOS, auto-start on boot)
Configuration
Environment variables (all optional, sane defaults):
| Variable | Default | Description |
MORPHEUS_PROXY_PORT | 8083 | Port the proxy listens on |
MORPHEUS_ROUTER_URL | http://localhost:8082 | Proxy-router URL |
MORPHEUS_COOKIE_PATH | ~/morpheus/.cookie | Path to auth cookie |
MORPHEUS_SESSION_DURATION | 604800 (7 days) | Session duration in seconds |
MORPHEUS_RENEW_BEFORE | 3600 (1 hour) | Renew session this many seconds before expiry |
MORPHEUS_PROXY_API_KEY | morpheus-local | Bearer token for proxy auth |
Session Duration
Sessions stake MOR tokens for their duration. Longer sessions = more MOR locked but fewer blockchain transactions:
| Duration | MOR Staked (approx) | Transactions |
| 1 hour | ~11 MOR | Every hour |
| 1 day | ~274 MOR | Daily |
| 7 days | ~1,915 MOR | Weekly |
MOR is returned when the session closes or expires. The proxy auto-renews before expiry, so you get continuous inference with minimal staking overhead.
Health Check
curl http://127.0.0.1:8083/healthAvailable Models
curl http://127.0.0.1:8083/v1/modelsDirect Usage (without OpenClaw)
curl http://127.0.0.1:8083/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer morpheus-local" \
-d '{
"model": "kimi-k2.5",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": false
}'Reliability Notes
kimi-k2.5(non-web) is the most reliable model — recommended as primary fallbackkimi-k2.5:web(web search variant) tends to timeout on P2P routing — avoid for fallback use- Provider connection resets are transient — retries usually succeed
- The proxy itself runs as a KeepAlive launchd service — auto-restarts if it crashes
Proxy Resilience (v0.5)
v0.5 adds three critical improvements to the proxy that prevent prolonged outages caused by cooldown cascades — where both primary and fallback providers become unavailable simultaneously.
Problem: Cooldown Cascades
When a primary provider (e.g., Venice) returns a billing error, OpenClaw's failover engine marks that provider as "in cooldown." If the Morpheus proxy also returns errors that OpenClaw misclassifies as billing errors, both providers enter cooldown and the agent goes completely offline — sometimes for 6+ hours.
Fix 1: OpenAI-Compatible Error Classification
The proxy now returns errors in the exact format OpenAI uses, with proper type and code fields:
{
"error": {
"message": "Morpheus session unavailable: ...",
"type": "server_error",
"code": "morpheus_session_error",
"param": null
}
}Key distinction: All Morpheus infrastructure errors are typed as "server_error" — never "billing" or "rate_limit_error". This ensures OpenClaw treats them as transient failures and retries appropriately, instead of putting the provider into extended cooldown.
Error codes returned by the proxy:
| Code | Meaning |
morpheus_session_error | Failed to open or refresh a blockchain session |
morpheus_inference_error | Provider returned an error during inference |
morpheus_upstream_error | Connection error to the proxy-router |
timeout | Inference request exceeded the time limit |
model_not_found | Requested model not in MODEL_MAP |
Fix 2: Automatic Session Retry
When the proxy-router returns a session-related error (expired, invalid, not found, closed), the proxy now:
- Invalidates the cached session
- Opens a fresh blockchain session
- Retries the inference request once
This handles the common case where the proxy-router restarts and loses its in-memory session state, or when a long-running session expires mid-request.
Fix 3: Multi-Tier Fallback Chain
Configure OpenClaw with multiple fallback models across providers:
{
"agents": {
"defaults": {
"model": {
"primary": "venice/claude-opus-4-6",
"fallbacks": [
"venice/claude-opus-45", // Try different Venice model first
"venice/kimi-k2-5", // Try yet another Venice model
"morpheus/kimi-k2.5" // Last resort: decentralized inference
]
}
}
}
}This way, if the primary model has billing issues, OpenClaw tries other models on the same provider (which may have separate rate limits) before falling back to Morpheus. The cascade is:
- venice/claude-opus-4-6 (primary) → billing error
- venice/claude-opus-45 (fallback 1) → tries a different model on Venice
- venice/kimi-k2-5 (fallback 2) → tries open-source model on Venice
- morpheus/kimi-k2.5 (fallback 3) → decentralized inference, always available if MOR is staked
13. OpenClaw Integration (v0.2)
Configure OpenClaw to use Morpheus as a fallback provider so your agent keeps running when primary API credits run out.
Step 1: Add Morpheus Provider
Add to your openclaw.json via config patch or manual edit:
{
"models": {
"providers": {
"morpheus": {
"baseUrl": "http://127.0.0.1:8083/v1",
"apiKey": "morpheus-local",
"api": "openai-completions",
"models": [
{
"id": "kimi-k2.5",
"name": "Kimi K2.5 (via Morpheus)",
"reasoning": true,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 131072,
"maxTokens": 8192
},
{
"id": "kimi-k2-thinking",
"name": "Kimi K2 Thinking (via Morpheus)",
"reasoning": true,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 131072,
"maxTokens": 8192
},
{
"id": "glm-4.7-flash",
"name": "GLM 4.7 Flash (via Morpheus)",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 131072,
"maxTokens": 8192
}
]
}
}
}
}Step 2: Set as Fallback
Configure a multi-tier fallback chain (recommended since v0.5):
{
"agents": {
"defaults": {
"model": {
"primary": "venice/claude-opus-4-6",
"fallbacks": [
"venice/claude-opus-45", // Different model, same provider
"venice/kimi-k2-5", // Open-source model, same provider
"morpheus/kimi-k2.5" // Decentralized fallback
]
},
"models": {
"venice/claude-opus-45": { "alias": "Claude Opus 4.5" },
"venice/kimi-k2-5": { "alias": "Kimi K2.5" },
"morpheus/kimi-k2.5": { "alias": "Kimi K2.5 (Morpheus)" },
"morpheus/kimi-k2-thinking": { "alias": "Kimi K2 Thinking (Morpheus)" },
"morpheus/glm-4.7-flash": { "alias": "GLM 4.7 Flash (Morpheus)" }
}
}
}
}⚠️ Why multi-tier? A single fallback creates a single point of failure. If both the primary provider and the single fallback enter cooldown simultaneously (e.g., billing error triggers cooldown on both), your agent goes offline. Multiple fallback tiers across different models and providers ensure at least one path remains available.
Step 3: Add Auth Profiles
OpenClaw supports multiple API keys per provider with automatic rotation. When one key's credits run out (billing error), OpenClaw disables that key only and rotates to the next one — same model, fresh credits. This is the single most effective way to prevent downtime.
Single Key (Minimum Setup)
Add to ~/.workbuddy/agents/main/agent/auth-profiles.json:
{
"venice:default": {
"type": "api_key",
"provider": "venice",
"key": "VENICE-INFERENCE-KEY-YOUR_KEY_HERE"
},
"morpheus:default": {
"type": "api_key",
"provider": "morpheus",
"key": "morpheus-local"
}
}Multiple Keys (Recommended — v0.9.1)
If you have multiple Venice API keys (e.g., from different accounts or plans), add them all as separate profiles. Order them from most credits to least:
auth-profiles.json:
{
"version": 1,
"profiles": {
"venice:key1": {
"type": "api_key",
"provider": "venice",
"key": "VENICE-INFERENCE-KEY-YOUR_PRIMARY_KEY"
},
"venice:key2": {
"type": "api_key",
"provider": "venice",
"key": "VENICE-INFERENCE-KEY-YOUR_SECOND_KEY"
},
"venice:key3": {
"type": "api_key",
"provider": "venice",
"key": "VENICE-INFERENCE-KEY-YOUR_THIRD_KEY"
},
"morpheus:default": {
"type": "api_key",
"provider": "morpheus",
"key": "morpheus-local"
}
}
}openclaw.json — register the profiles and set explicit rotation order:
{
"auth": {
"profiles": {
"venice:key1": { "provider": "venice", "mode": "api_key" },
"venice:key2": { "provider": "venice", "mode": "api_key" },
"venice:key3": { "provider": "venice", "mode": "api_key" },
"morpheus:default": { "provider": "morpheus", "mode": "api_key" }
},
"order": {
"venice": ["venice:key1", "venice:key2", "venice:key3"]
}
}
}⚠️ auth.order is critical. Without it, OpenClaw uses round-robin (oldest-used first), which may not match your credit balances. With an explicit order, keys are tried in the exact sequence you specify — highest credits first.
How Multi-Key Rotation Works
OpenClaw's auth engine handles rotation automatically:
- Session stickiness: A key is pinned per session to keep provider caches warm. It won't flip-flop mid-conversation.
- Billing disable: When a key returns a billing/credit error, that profile is disabled with exponential backoff (starts at 5 hours). Other profiles for the same provider remain active.
- Rotation on failure: After disabling a profile, OpenClaw immediately tries the next key in
auth.order. Same model, same provider — just fresh credits. - Model fallback: Only after ALL profiles for Venice are disabled does OpenClaw move to the next model in the fallback chain (e.g., Morpheus).
- Auto-recovery: Disabled profiles auto-recover after backoff expires. If credits refill (e.g., daily reset), the profile becomes available again.
Venice DIEM Credits
Venice uses "DIEM" as its internal credit unit (1 DIEM ≈ $1 USD). Each API key has its own DIEM balance. Credits appear to reset daily. Expensive models drain credits faster:
| Model | Input Cost | Output Cost | ~Messages per 10 DIEM |
| Claude Opus 4.6 | 6 DIEM/M tokens | 30 DIEM/M tokens | ~5-10 |
| Claude Opus 4.5 | 6 DIEM/M tokens | 30 DIEM/M tokens | ~5-10 |
| Kimi K2.5 | 0.75 DIEM/M tokens | 3.75 DIEM/M tokens | ~50-100 |
| GLM 4.7 Flash | 0.125 DIEM/M tokens | 0.5 DIEM/M tokens | ~500+ |
Tip: With multiple keys, the agent can stay on Claude Opus across key rotations. Without multi-key, it would fall to cheaper models or Morpheus after one key's credits run out.
Failover Behavior (v0.9.1)
The complete failover chain with multi-key rotation:
- Key rotation within Venice — Key 1 credits exhausted → billing disable on that profile only → immediately rotates to Key 2 → Key 3 → etc. Same model, fresh credits.
- Model fallback — Only after ALL Venice keys are disabled → tries
venice/claude-opus-45(all keys again) →venice/kimi-k2-5(all keys) →morpheus/kimi-k2.5 - Morpheus fallback — The proxy auto-opens a 7-day Morpheus session (if none exists). Inference routes through the Morpheus P2P network.
- Gateway Guardian v2 — If all providers enter cooldown despite multi-key rotation → detects brain-dead state → restarts gateway (clears cooldowns) → nuclear reinstall if needed.
- Auto-recovery — When credits refill (daily reset) or backoff expires, OpenClaw switches back to Venice automatically.
Example with 6 keys (246 DIEM total):
venice:key1 (98 DIEM) → venice:key2 (50 DIEM) → venice:key3 (40 DIEM) →
venice:key4 (26 DIEM) → venice:key5 (20 DIEM) → venice:key6 (12 DIEM) →
morpheus/kimi-k2.5 (free, staked MOR) → mor-gateway/kimi-k2.5 (free beta)v0.5 improvement: The Morpheus proxy returns "server_error" type errors (not billing errors), so OpenClaw won't put the Morpheus provider into extended cooldown due to transient infrastructure issues. If a Morpheus session expires mid-request, the proxy automatically opens a fresh session and retries once.
14. Gateway Guardian v2 (v0.9)
A self-healing watchdog that monitors the OpenClaw gateway and its ability to actually run inference. Runs every 2 minutes via launchd.
The Problem v2 Solves
v1 only checked if the gateway process was alive (HTTP 200 on dashboard). But the real failure mode is when the gateway is alive but all model providers are in cooldown — credits exhausted, billing errors cascading across providers. The gateway returns 200 while the agent is effectively brain-dead. v2 adds inference-level health checks and a nuclear self-healing option.
How It Works
- HTTP probe — Is the gateway process running? (
http://127.0.0.1:18789/) - Inference probe — Can any model provider actually respond?
- Checks Venice API (
/api/v1/models) - Checks Morpheus local proxy (
/health) - Checks Morpheus API Gateway (
/api/v1/models) - If any one responds, inference is available
- Checks Venice API (
- Separate failure counters — HTTP failures (2 threshold) and inference failures (3 threshold, ~6 min) tracked independently
- Four-stage restart escalation:
openclaw gateway restart(graceful — resets in-memory cooldown state)- Hard kill (
kill -9) → launchd KeepAlive restarts launchctl kickstart -k(force restart)- 🔴 NUCLEAR:
curl -fsSL https://clawd.bot/install.sh | bash(full reinstall — guaranteed clean start)
- Signal notification before nuclear restart (via signal-cli if available)
- Logs everything to
~/.workbuddy/logs/guardian.log
Why Restart Fixes Cooldown
OpenClaw's provider cooldown state is in-memory. When all providers enter cooldown (e.g., Venice credits exhausted + Morpheus errors misclassified), the agent stays offline until cooldowns expire naturally — which can take hours. Restarting the gateway process clears all cooldown state immediately, allowing the fallback chain to work again.
Installation
Included in install-proxy.sh, or manually:
cp skills/everclaw/scripts/gateway-guardian.sh ~/.workbuddy/workspace/scripts/
chmod +x ~/.workbuddy/workspace/scripts/gateway-guardian.sh
# Install launchd plist (macOS)
# See templates/ai.openclaw.guardian.plist⚠️ Important: The launchd plist should include OPENCLAW_GATEWAY_TOKEN in its environment variables so the guardian can authenticate with the gateway for inference probes. Extract this from your gateway plist:
/usr/libexec/PlistBuddy -c "Print :EnvironmentVariables:OPENCLAW_GATEWAY_TOKEN" \
~/Library/LaunchAgents/ai.openclaw.gateway.plistManual Test
bash ~/.workbuddy/workspace/scripts/gateway-guardian.sh --verboseLogs
tail -f ~/.workbuddy/logs/guardian.logConfiguration
Edit variables at the top of gateway-guardian.sh:
| Variable | Default | Description |
GATEWAY_PORT | 18789 | Gateway port to probe |
PROBE_TIMEOUT | 8 | HTTP timeout in seconds |
INFERENCE_TIMEOUT | 15 | Provider probe timeout in seconds |
FAIL_THRESHOLD | 2 | Consecutive HTTP failures before restart |
INFERENCE_FAIL_THRESHOLD | 3 | Consecutive inference failures before escalation (~6 min) |
MAX_LOG_LINES | 1000 | Log file rotation threshold |
OWNER_SIGNAL | "" | Signal number for nuclear restart notifications |
INSTALL_URL | https://clawd.bot/install.sh | URL for nuclear reinstall script |
State Files
| File | Purpose |
~/.workbuddy/logs/guardian.state | HTTP failure counter |
~/.workbuddy/logs/guardian-inference.state | Inference failure counter |
~/.workbuddy/logs/guardian.log | Guardian activity log |
17. x402 Payment Client (v0.7)
Everclaw v0.7 includes an x402 payment client that lets your agent make USDC payments to any x402-enabled endpoint. The x402 protocol is an HTTP-native payment standard: when a server returns HTTP 402, your agent automatically signs a USDC payment and retries.
How x402 Works
Agent → request → Server returns 402 + PAYMENT-REQUIRED header
Agent → parse requirements → sign EIP-712 payment → retry with PAYMENT-SIGNATURE header
Server → verify signature via facilitator → settle USDC → return resourceCLI Usage
# Make a request to an x402-protected endpoint
node scripts/x402-client.mjs GET https://api.example.com/data
# Dry-run: see what would be paid without signing
node scripts/x402-client.mjs --dry-run GET https://api.example.com/data
# Set max payment per request
node scripts/x402-client.mjs --max-amount 0.50 GET https://api.example.com/data
# POST with body
node scripts/x402-client.mjs POST https://api.example.com/task '{"prompt":"hello"}'
# Check daily spending
node scripts/x402-client.mjs --budgetProgrammatic Usage
import { makePayableRequest, createX402Client } from './scripts/x402-client.mjs';
// One-shot request
const result = await makePayableRequest("https://api.example.com/data");
// result.paid → true if 402 was handled
// result.amount → "$0.010000" (USDC)
// result.body → response content
// Reusable client with budget limits
const client = createX402Client({
maxPerRequest: 0.50, // $0.50 USDC max per request
dailyLimit: 5.00, // $5.00 USDC per day
dryRun: false,
});
const res = await client.get("https://agent-api.example.com/query?q=weather");
const data = await client.post("https://agent-api.example.com/task", { prompt: "hello" });
// Check spending
console.log(client.budget());
// { date: "2026-02-11", spent: "$0.520000", remaining: "$4.480000", limit: "$5.000000", transactions: 3 }Payment Flow Details
- Request — Standard HTTP request to any URL
- 402 Detection — Server returns
HTTP 402withPAYMENT-REQUIREDheader containing JSON payment requirements - Budget Check — Verifies amount against per-request max ($1.00 default) and daily limit ($10.00 default)
- EIP-712 Signing — Signs a
TransferWithAuthorization(EIP-3009) for USDC on Base using the agent's wallet - Retry — Resends the request with
PAYMENT-SIGNATUREheader containing the signed payment payload - Settlement — The Coinbase facilitator verifies the signature and settles the USDC transfer
- Response — Server returns the requested resource
Security
- Private key from 1Password at runtime (never on disk) — follows Bagman patterns
- Budget controls prevent runaway spending: $1/request max, $10/day by default
- Dry-run mode for testing without signing or spending
- USDC on Base only — no other chains or tokens (EIP-3009 TransferWithAuthorization)
- Daily budget tracking persisted to
.x402-budget.json(amounts only, no keys)
Key Addresses
| Item | Address |
| USDC (Base) | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Coinbase Facilitator | https://api.cdp.coinbase.com/platform/v2/x402 |
| Base Chain ID | 8453 (CAIP-2: eip155:8453) |
18. ERC-8004 Agent Registry (v0.7)
The ERC-8004 protocol provides on-chain registries for agent discovery and trust. Everclaw v0.7 includes a reader that queries the Identity and Reputation registries on Base mainnet.
What Is ERC-8004?
ERC-8004 defines three registries:
- Identity Registry (ERC-721): Each agent is an NFT with a
tokenURIpointing to a registration file containing name, description, services/endpoints, x402 support, and trust signals - Reputation Registry: Clients give structured feedback (value + tags) to agents. Summary scores aggregate across all clients
- Validation Registry: Stake-secured re-execution and zkML verification (read-only in Everclaw)
Agents are discoverable, portable (transferable NFTs), and verifiable across organizational boundaries.
CLI Usage
# Look up an agent by ID
node scripts/agent-registry.mjs lookup 1
# Get reputation data
node scripts/agent-registry.mjs reputation 1
# Full discovery (identity + registration file + reputation)
node scripts/agent-registry.mjs discover 1
# List agents in a range
node scripts/agent-registry.mjs list 1 10
# Get total registered agents
node scripts/agent-registry.mjs totalProgrammatic Usage
import { lookupAgent, getReputation, discoverAgent, totalAgents, listAgents } from './scripts/agent-registry.mjs';
// Look up identity
const agent = await lookupAgent(1);
// {
// agentId: 1,
// owner: "0x89E9...",
// uri: "data:application/json;base64,...",
// wallet: "0x89E9...",
// registration: {
// name: "ClawNews",
// description: "Hacker News for AI agents...",
// services: [{ name: "web", endpoint: "https://clawnews.io" }, ...],
// x402Support: false,
// active: true,
// supportedTrust: ["reputation"]
// }
// }
// Get reputation
const rep = await getReputation(1);
// {
// agentId: 1,
// clients: ["0x3975...", "0x718B..."],
// feedbackCount: 2,
// summary: { count: 2, value: "100", decimals: 0 },
// feedback: [{ client: "0x3975...", value: "100", tag1: "tip", tag2: "agent" }, ...]
// }
// Full discovery
const full = await discoverAgent(1);
// Combines identity, registration file, services, and reputation into one objectRegistration File Format
Agent registration files (resolved from tokenURI) follow the ERC-8004 standard:
{
"type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
"name": "MyAgent",
"description": "What the agent does",
"image": "https://example.com/logo.png",
"services": [
{ "name": "web", "endpoint": "https://myagent.com" },
{ "name": "A2A", "endpoint": "https://agent.example/.well-known/agent-card.json", "version": "0.3.0" },
{ "name": "MCP", "endpoint": "https://mcp.agent.eth/", "version": "2025-06-18" }
],
"x402Support": true,
"active": true,
"supportedTrust": ["reputation", "crypto-economic"]
}The reader handles all URI types: data: URIs (base64-encoded JSON stored on-chain), ipfs:// URIs (via public IPFS gateway), and https:// URIs.
Contract Addresses (Base Mainnet)
| Registry | Address |
| Identity | 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 |
| Reputation | 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63 |
⚠️ Same addresses on all EVM chains — Ethereum, Base, Arbitrum, Polygon, Optimism, Linea, Avalanche, etc. The Identity Registry does NOT implement totalSupply(), so totalAgents() uses a binary search via ownerOf().
Combining x402 + Agent Registry
The x402 client and agent registry work together for agent-to-agent payments:
import { discoverAgent } from './scripts/agent-registry.mjs';
import { makePayableRequest } from './scripts/x402-client.mjs';
// 1. Discover an agent and find its x402-enabled endpoint
const agent = await discoverAgent(42);
const apiEndpoint = agent.services.find(s => s.name === "A2A")?.endpoint;
// 2. Make a paid request — x402 handling is automatic
if (agent.x402Support && apiEndpoint) {
const result = await makePayableRequest(apiEndpoint, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ task: "Analyze this data..." }),
maxAmount: 500000n, // $0.50 USDC
});
console.log(result.body); // Agent's response
}Quick Reference (v0.9.2)
| Action | Command |
| Install Everclaw | bash skills/everclaw/scripts/install-everclaw.sh |
| Check for updates | bash skills/everclaw/scripts/install-everclaw.sh --check |
| Update (git pull) | cd skills/everclaw && git pull |
| Install router | bash skills/everclaw/scripts/install.sh |
| Install proxy + guardian | bash skills/everclaw/scripts/install-proxy.sh |
| Start router | bash skills/everclaw/scripts/start.sh |
| Stop router | bash skills/everclaw/scripts/stop.sh |
| Swap ETH→MOR | bash skills/everclaw/scripts/swap.sh eth 0.01 |
| Swap USDC→MOR | bash skills/everclaw/scripts/swap.sh usdc 50 |
| Open session | bash skills/everclaw/scripts/session.sh open <model> [duration] |
| Close session | bash skills/everclaw/scripts/session.sh close <session_id> |
| List sessions | bash skills/everclaw/scripts/session.sh list |
| Send prompt | bash skills/everclaw/scripts/chat.sh <model> "prompt" |
| Check balance | bash skills/everclaw/scripts/balance.sh |
| Proxy health | curl http://127.0.0.1:8083/health |
| Guardian test | bash scripts/gateway-guardian.sh --verbose |
| Guardian logs | tail -f ~/.workbuddy/logs/guardian.log |
| x402 request | node scripts/x402-client.mjs GET <url> |
| x402 dry-run | node scripts/x402-client.mjs --dry-run GET <url> |
| x402 budget | node scripts/x402-client.mjs --budget |
| Lookup agent | node scripts/agent-registry.mjs lookup <id> |
| Agent reputation | node scripts/agent-registry.mjs reputation <id> |
| Discover agent | node scripts/agent-registry.mjs discover <id> |
| List agents | node scripts/agent-registry.mjs list <start> [count] |
| Total agents | node scripts/agent-registry.mjs total |
| Scan a skill | node security/skillguard/src/cli.js scan <path> |
| Batch scan | node security/skillguard/src/cli.js batch <dir> |
| Security audit | bash security/clawdstrike/scripts/collect_verified.sh |
| Detect injection | python3 security/prompt-guard/scripts/detect.py "text" |
15. Security Skills (v0.3)
Everclaw agents handle MOR tokens and private keys — making them high-value targets. v0.3 bundles four security skills to defend against supply chain attacks, prompt injection, credential theft, and configuration exposure.
🔍 SkillGuard — Pre-Install Skill Scanner
Scans AgentSkill packages for malicious patterns before you install them. Detects credential theft, code injection, prompt manipulation, data exfiltration, and evasion techniques.
# Scan a skill directory
node security/skillguard/src/cli.js scan <path>
# Batch scan all installed skills
node security/skillguard/src/cli.js batch <directory>
# Scan a ClawHub skill by slug
node security/skillguard/src/cli.js scan-hub <slug>Score interpretation:
- 80-100 ✅ LOW risk — safe to install
- 50-79 ⚠️ MEDIUM — review before installing
- 20-49 🟠 HIGH — significant concerns
- 0-19 🔴 CRITICAL — do NOT install
When to use: Before installing any skill from ClawHub or untrusted sources. Run batch scans periodically to audit all installed skills.
Full docs: security/skillguard/SKILL.md
🔒 ClawdStrike — Config & Exposure Audits
Security audit and threat model for OpenClaw gateway hosts. Verifies configuration, network exposure, installed skills/plugins, and filesystem hygiene. Produces an OK/VULNERABLE report with evidence and remediation steps.
# Run a full audit
cd security/clawdstrike && \
OPENCLAW_WORKSPACE_DIR=$HOME/.openclaw/workspace \
bash scripts/collect_verified.shWhat it checks:
- Gateway bind address and auth configuration
- Channel exposure (Signal, Telegram, Discord, etc.)
- Installed skills and plugins for known vulnerabilities
- Filesystem permissions and sensitive file access
- Network exposure and firewall rules
- OpenClaw version and known CVEs
When to use: After initial setup, after installing new skills, and periodically (weekly recommended).
Full docs: security/clawdstrike/SKILL.md
🧱 PromptGuard — Prompt Injection Defense
Advanced prompt injection defense system with multi-language detection (EN/KO/JA/ZH), severity scoring, automatic logging, and configurable security policies. Connects to the HiveFence distributed threat intelligence network.
# Analyze a message for injection attempts
python3 security/prompt-guard/scripts/detect.py "suspicious message here"
# Run audit on prompt injection logs
python3 security/prompt-guard/scripts/audit.py
# Analyze historical logs
python3 security/prompt-guard/scripts/analyze_log.pyDetection categories:
- Direct injection (instruction overrides, role manipulation)
- Indirect injection (data exfiltration, hidden instructions)
- Jailbreak attempts (DAN mode, filter bypasses)
- Multi-language attacks (cross-language injection)
When to use: In group chats, when processing untrusted input, when agents interact with external data sources.
Full docs: security/prompt-guard/SKILL.md
💰 Bagman — Secure Key Management
Secure key management for AI agents handling private keys, API secrets, and wallet credentials. Covers secure storage patterns, session keys, leak prevention, prompt injection defense specific to financial operations, and MetaMask Delegation Framework (EIP-7710) integration.
Key principles:
- Never store keys on disk — use 1Password
op runfor runtime injection - Session keys — generate ephemeral keys with limited permissions
- Delegation Framework — grant agents scoped authority without exposing master keys
- Leak prevention — patterns to detect and block secret exposure
Reference docs:
security/bagman/references/secure-storage.md— Storage patternssecurity/bagman/references/session-keys.md— Session key architecturesecurity/bagman/references/delegation-framework.md— EIP-7710 integrationsecurity/bagman/references/leak-prevention.md— Leak detection rulessecurity/bagman/references/prompt-injection-defense.md— Financial-specific injection defense
When to use: Whenever an agent handles private keys, wallet credentials, or API secrets — which Everclaw agents always do.
Full docs: security/bagman/SKILL.md
Security Recommendations
For Everclaw agents handling MOR tokens:
- Before installing any new skill: Run SkillGuard scan
- After setup and periodically: Run ClawdStrike audit
- In group chats or with untrusted input: Enable PromptGuard detection
- Always: Follow Bagman patterns for key management (1Password, session keys, no keys on disk)
16. Model Router (v0.6)
A lightweight, local prompt classifier that routes requests to the cheapest capable model. Runs in <1ms with zero external API calls.
Tiers
| Tier | Primary Model | Fallback | Use Case |
| LIGHT | morpheus/glm-4.7-flash | morpheus/kimi-k2.5 | Cron jobs, heartbeats, simple Q&A, status checks |
| STANDARD | morpheus/kimi-k2.5 | venice/kimi-k2-5 | Research, drafting, summaries, most sub-agent tasks |
| HEAVY | venice/claude-opus-4-6 | venice/claude-opus-45 | Complex reasoning, architecture, formal proofs, strategy |
All LIGHT and STANDARD tier models run through Morpheus (free via staked MOR). Only HEAVY tier uses Venice (premium).
How Scoring Works
The router scores prompts across 13 weighted dimensions:
| Dimension | Weight | What It Detects |
reasoningMarkers | 0.20 | "prove", "theorem", "step by step", "chain of thought" |
codePresence | 0.14 | function, class, import, backticks, "refactor" |
synthesis | 0.11 | "summarize", "compare", "draft", "analyze", "review" |
technicalTerms | 0.10 | "algorithm", "architecture", "smart contract", "consensus" |
multiStepPatterns | 0.10 | "first...then", "step 1", numbered lists |
simpleIndicators | 0.08 | "what is", "hello", "weather" (negative score → pushes toward LIGHT) |
agenticTask | 0.06 | "edit", "deploy", "install", "debug", "fix" |
creativeMarkers | 0.04 | "story", "poem", "brainstorm" |
questionComplexity | 0.04 | Multiple question marks |
tokenCount | 0.04 | Short prompts skew LIGHT, long prompts skew HEAVY |
constraintCount | 0.04 | "at most", "at least", "maximum", "budget" |
domainSpecificity | 0.04 | "quantum", "zero-knowledge", "genomics" |
outputFormat | 0.03 | "json", "yaml", "table", "csv" |
Special override: 2+ reasoning keywords in the user prompt → force HEAVY at 88%+ confidence. This prevents accidental cheap routing of genuinely hard problems.
Ambiguous prompts (low confidence) default to STANDARD — the safe middle ground.
CLI Usage
# Test routing for a prompt
node scripts/router.mjs "What is 2+2?"
# → LIGHT (morpheus/glm-4.7-flash)
node scripts/router.mjs "Summarize the meeting notes and draft a follow-up"
# → STANDARD (morpheus/kimi-k2.5)
node scripts/router.mjs "Design a distributed consensus algorithm and prove its correctness"
# → HEAVY (venice/claude-opus-4-6)
# JSON output for programmatic use
node scripts/router.mjs --json "Build a React component"
# Pipe from stdin
echo '{"prompt":"hello","system":"You are helpful"}' | node scripts/router.mjs --stdinProgrammatic Usage
import { route, classify } from './scripts/router.mjs';
const decision = route("Check the weather in Austin");
// {
// tier: "LIGHT",
// model: "morpheus/glm-4.7-flash",
// fallback: "morpheus/kimi-k2.5",
// confidence: 0.87,
// score: -0.10,
// signals: ["short (7 tok)", "simple (weather)"],
// reasoning: "score=-0.100 → LIGHT"
// }Applying to Cron Jobs
Set the model field on cron job payloads to route to cheaper models:
{
"payload": {
"kind": "agentTurn",
"model": "morpheus/kimi-k2.5", // STANDARD tier — free via Morpheus
"message": "Compile a morning briefing...",
"timeoutSeconds": 300
}
}For truly simple cron jobs (health checks, pings, status queries):
{
"payload": {
"kind": "agentTurn",
"model": "morpheus/glm-4.7-flash", // LIGHT tier — fastest, free
"message": "Check proxy health and report any issues",
"timeoutSeconds": 60
}
}Applying to Sub-Agent Spawns
// Simple research task → STANDARD
sessions_spawn({ task: "Search for X news", model: "morpheus/kimi-k2.5" });
// Quick lookup → LIGHT
sessions_spawn({ task: "What's the weather?", model: "morpheus/glm-4.7-flash" });
// Complex analysis → let it use the default (HEAVY / Claude 4.6)
sessions_spawn({ task: "Design the x402 payment integration..." });Cost Impact
With the router in place, only complex reasoning tasks in the main session use premium models. All background work (cron jobs, sub-agents, heartbeats) runs on free Morpheus inference:
| Before | After |
| All cron jobs → Claude 4.6 (premium) | Cron jobs → Kimi K2.5 / GLM Flash (free) |
| All sub-agents → Claude 4.6 (premium) | Sub-agents → Kimi K2.5 (free) unless complex |
| Main session → Claude 4.6 | Main session → Claude 4.6 (unchanged) |
19. Morpheus API Gateway Bootstrap (v0.8)
The Morpheus API Gateway (api.mor.org) provides free, OpenAI-compatible inference — no node, no staking, no wallet required. Everclaw v0.8 includes a bootstrap script that configures this as an OpenClaw provider, giving new users instant access to AI from the first launch.
Why This Matters
New OpenClaw users face a cold-start problem: they need an API key (Claude, OpenAI, etc.) before their agent can do anything. Everclaw v0.8 solves this by bundling a community API key for the Morpheus inference marketplace, which is currently in free beta.
The bootstrap flow:
- New user installs OpenClaw + Everclaw
- Run
node scripts/bootstrap-gateway.mjs— agent gets free inference immediately - Agent's first task: guide user to get their own free key at
app.mor.org - User upgrades to their own key → can then progress to full Morpheus node + MOR staking
Quick Start
# One command — tests the gateway and patches OpenClaw config
node skills/everclaw/scripts/bootstrap-gateway.mjs
# Or with your own API key from app.mor.org
node skills/everclaw/scripts/bootstrap-gateway.mjs --key sk-YOUR_KEY_HERE
# Test the gateway connection
node skills/everclaw/scripts/bootstrap-gateway.mjs --test
# Check current gateway status
node skills/everclaw/scripts/bootstrap-gateway.mjs --statusWhat It Does
The bootstrap script:
- Tests the Morpheus API Gateway connection with a live inference call
- Patches
openclaw.jsonto addmor-gatewayas a new provider - Adds
mor-gateway/kimi-k2.5to the fallback chain - Reports available models and next steps
API Gateway Details
| Setting | Value |
| Base URL | https://api.mor.org/api/v1 |
| API format | OpenAI-compatible |
| Auth | Bearer token (sk-...) |
| Free beta | Until March 1, 2026 |
| Models | 34 (LLMs, TTS, STT, embeddings) |
| Provider name | mor-gateway |
Available Models (via Gateway)
The gateway exposes all models on the Morpheus inference marketplace:
| Model | Type | Notes |
kimi-k2.5 | LLM | Primary bootstrap model — strong coding + reasoning |
glm-4.7-flash | LLM | Fast, good for simple tasks |
llama-3.3-70b | LLM | General purpose |
qwen3-235b | LLM | Large, strong reasoning |
gpt-oss-120b | LLM | OpenAI-compatible OSS model |
hermes-4-14b | LLM | Lightweight |
tts-kokoro | TTS | Text-to-speech |
whisper-v3-large-turbo | STT | Speech-to-text |
text-embedding-bge-m3 | Embedding | Text embeddings |
All models also have :web variants with web search capability.
OpenClaw Config (generated by bootstrap)
{
"models": {
"providers": {
"mor-gateway": {
"baseUrl": "https://api.mor.org/api/v1",
"apiKey": "sk-...",
"api": "openai-completions",
"models": [
{ "id": "kimi-k2.5", "name": "Kimi K2.5 (via Morpheus Gateway)", "reasoning": false },
{ "id": "glm-4.7-flash", "name": "GLM 4.7 Flash (via Morpheus Gateway)", "reasoning": false },
{ "id": "llama-3.3-70b", "name": "Llama 3.3 70B (via Morpheus Gateway)", "reasoning": false }
]
}
}
}
}Important: All gateway models must have "reasoning": false — the upstream litellm rejects the reasoning_effort parameter.
Community Bootstrap Key
The bootstrap script includes a community API key (base64-obfuscated) for the SmartAgentProtocol account. This provides free access during the beta period.
Getting your own key (recommended):
- Go to app.mor.org
- Create an account and sign in
- Click "Create API Key"
- Enable "session automation" in account settings (required for API access)
- Run:
node scripts/bootstrap-gateway.mjs --key YOUR_KEY
Gateway vs Local Proxy vs P2P Node
| Feature | API Gateway (v0.8) | Local Proxy (v0.2) | P2P Node (v0.1) |
| Setup | One command | Install proxy + config | Full node install |
| Cost | Free (beta) | Free (MOR staking) | Free (MOR staking) |
| Requires MOR | No | Yes | Yes |
| Requires wallet | No | Yes | Yes |
| Decentralized | Gateway → providers | Direct P2P | Direct P2P |
| Best for | New users, quick start | Daily use, reliability | Full sovereignty |
The recommended progression: Gateway → Local Proxy → P2P Node as users gain confidence with the Morpheus ecosystem.
Fallback Chain with Gateway
With the gateway added, the recommended fallback chain becomes:
venice/claude-opus-4-6 # Primary (premium)
→ venice/claude-opus-45 # Venice fallback
→ venice/kimi-k2-5 # Venice free tier
→ morpheus/kimi-k2.5 # Local proxy (MOR staking)
→ mor-gateway/kimi-k2.5 # API Gateway (free beta)For new users without Venice or a local proxy, the gateway is the first and only provider — making it the critical bootstrap path.
References
references/acquiring-mor.md— How to get MOR tokens (exchanges, bridges, swaps)references/models.md— Available models and their blockchain IDsreferences/api.md— Complete proxy-router API referencereferences/economics.md— How MOR staking economics workreferences/troubleshooting.md— Common errors and solutionssecurity/skillguard/SKILL.md— SkillGuard full documentationsecurity/clawdstrike/SKILL.md— ClawdStrike full documentationsecurity/prompt-guard/SKILL.md— PromptGuard full documentationsecurity/bagman/SKILL.md— Bagman full documentation- x402 Protocol — HTTP-native payment protocol specification
- ERC-8004 — Trustless Agents EIP specification
- 8004scan — Agent registry explorer
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

