agent-spend-guards
БесплатноБез исполняемых скриптовНе проверенCheck a proposed agent trade or spend against per-trade, daily, price-impact, kill-switch and allowlist limits using @three-ws/agent-guards. Use when building…
от nirholas★ 289 звёзд на GitHubОб этом скилле
Agent spend guards
@three-ws/agent-guards (Node 18+, zero dependencies, ESM) has two halves:
- Local pure functions (
policy,guard,check*) that need no network and no token. - A client (
guards(agentId, opts)orcreateGuards(opts)) for the hosted three.ws policy endpoints.
Install: npm install @three-ws/agent-guards
Local check (no token)
import { policy, guard } from '@three-ws/agent-guards';
const p = policy({ per_trade_sol: 0.5, daily_budget_sol: 2, max_concurrent: 3 });
const d = guard({ side: 'buy', amountSol: 0.9, priceImpactPct: 2 }, p);
// d.allow === false, d.reason === 'per_trade_cap', d.message explains the fix
Policy keys: per_trade_sol, daily_budget_sol, max_price_impact_pct, max_slippage_bps,
max_concurrent, kill_switch, daily_usd, per_tx_usd, withdraw_allowlist, frozen.
An unset ceiling means no cap.
Transaction fields (GuardTx): side (buy|sell), category (trade|snipe|x402|withdraw),
amountSol or amountLamports, priceImpactPct, walletLamports, spentLamports (rolling 24h),
openCount, usdValue, spentUsd, destination. A guard whose input is omitted is skipped, so
supply every number you want enforced.
Reason codes: kill_switch, wallet_frozen, per_trade_cap, daily_budget, per_tx_exceeded,
daily_exceeded, max_positions, price_impact, insufficient_sol, destination_not_allowed.
Individual predicates are exported too: checkKillSwitch, checkFrozen, checkConcurrency,
checkPerTradeCap, checkDailyBudgetLamports, checkSolHeadroom, checkPriceImpact,
checkPerTxUsd, checkDailyUsd, checkAllowlist. Each returns null (pass) or {reason, detail}.
Hosted policy (owner token required)
import { guards } from '@three-ws/agent-guards';
const a = guards('agent_abc123', { token: process.env.THREE_WS_TOKEN });
await a.setTradeLimits({ per_trade_sol: 0.5, daily_budget_sol: 2 });
const decision = await a.checkTrade({ side: 'buy', mint, amount: 0.3 }); // simulates, moves no funds
if (decision.allowed) await a.trade({ side: 'buy', mint, amount: 0.3 }); // really executes
await a.setTradeLimits({ kill_switch: true }); // reject every discretionary trade
Other methods: getTradeLimits(), getSpendLimits({network}), setSpendLimits(patch, {network}).
Endpoints used: /api/agents/:id/trade, /trade/quote, /trade/limits, /wallet/limits on
https://three.ws (override with baseUrl). Env: THREE_WS_TOKEN (owner bearer token).
Rules for the agent
- Run
guard()orcheckTrade()before every signing step. Do not calltrade()on a blocked decision. trade()moves real funds. Show the user side, mint and amount, and wait for an explicit yes first.- Never put the token in code or logs.
Установить agent-spend-guards в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл agent-spend-guards?
Check a proposed agent trade or spend against per-trade, daily, price-impact, kill-switch and allowlist limits using @three-ws/agent-guards. Use when building or reviewing an autonomous agent that can move funds and needs hard caps before signing.
Как установить скилл agent-spend-guards?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agent-spend-guards запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic