cd /news/ai-agents/your-solana-bot-signs-whatever-the-a… · home › topics › ai-agents › article
[ARTICLE · art-170173] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Your Solana bot signs whatever the API sends back. Here's a one-line check (npm + PyPI).

A developer released solana-pulse, a zero-dependency npm and PyPI package that adds a pre-signing check to Solana bots and AI agents with wallets. The checkBeforeSign function sends the unsigned transaction to the Solana Pulse gateway, which decodes each step, dry-runs it on mainnet, and returns OK, REVIEW or BLOCK with per-wallet SOL and token changes, blocking drainer approvals, authority changes and expired blockhashes. An optional expected-action parameter returns MISMATCH when a transaction moves a different amount or token than intended, and the tool fails closed when the service is unreachable; the author reports tx_matches confirmed 80 of 80 transfers and 26 of 27 swaps, with the outlier flagged for paying a bot 1.54%.

by read3 min views2 publishedNov 15, 2026

Over the last few weeks I read the signing code of a lot of open-source Solana bots and agents: trading bots, copy traders, launchpad tools, AI agents with a wallet. The same pattern shows up again and again:

const tx = VersionedTransaction.deserialize(Buffer.from(body.swapTransaction, "base64"));
tx.sign([wallet]);              // signs whatever came back
await connection.sendTransaction(tx);

The transaction is built by someone else (Jupiter's /swap or Ultra /order, PumpPortal, a launchpad API) and the bot signs it without reading it. Most of the time that's fine. But if the response is ever wrong (a bad config, a compromised endpoint, a proxy in between, a decimals slip), the key signs it anyway: an extra transfer out of the wallet, a different output token, a swap that pays someone else. A bot that trades on its own signs without anyone watching.

So I packaged the check I use myself into one line.

npm install solana-pulse
js
import { checkBeforeSign } from "solana-pulse";

await checkBeforeSign(tx);   // throws PulseBlockedError unless Pulse answers OK
tx.sign([wallet]);

No dependencies: it uses fetch (Node 18+, browsers, edge runtimes) and takes base64, bytes, or a @solana/web3.js Transaction / VersionedTransaction.

pip install solana-pulse
python
from solana_pulse import check_before_sign

check_before_sign(swap_tx)   # raises PulseBlocked unless Pulse answers OK
signed = VersionedTransaction(swap_tx.message, [keypair])

Also zero dependencies.

checkBeforeSign sends the unsigned transaction to Solana Pulse, which decodes every step, dry-runs it on live mainnet, and answers OK, REVIEW or BLOCK with each wallet's SOL and token changes. It blocks drainer approvals, authority changes, accounts closed to someone else, transactions that would fail, and expired blockhashes.

For swaps and transfers you can go one step further and say what you meant:

// Jupiter swap: sells exactly 0.5 SOL and pays the bought USDC back to your own wallet, nothing else.
await checkBeforeSign(tx, { expected: { action: "swap", sell: "SOL", amount: "0.5", buy: USDC_MINT } });

// Transfer built from "send 5 USDC to X":
await checkBeforeSign(tx, { expected: { token: USDC_MINT, amount: "5", to: recipient } });

If the transaction moves a different amount, a different token, pays someone else, or does anything extra, you get MISMATCH and the field that's off.

Fail-closed by design: if Pulse can't be reached, checkBeforeSign throws too. "Not checked" is never treated as "safe".

tx_matches confirmed 80 of 80 transfers and 26 of 27 swaps. The 27th paid a bot 1.54%, so it was flagged. It's a small benchmark, not a proof, and "OK" means none of the traps Pulse knows about are present. No check can promise a transaction is safe.

Each tool gives 25 free calls a day per caller, no key needed. After that a check costs $0.02 USDC, paid per request with x402. Calls that fail are never charged.

npm install agentkit-solana-pulse adds check_tx, token_safety and a checked sign-and-send action.npm install elizaos-plugin-solana-pulse. https://solana-pulse-gateway-1021990235790.us-central1.run.app/mcp. If you'd rather not depend on an outside service, the same idea works with plain RPC: call simulateTransaction with your wallet in accounts and compare the balance changes to the quote before signing. Please do something before that .sign().

Questions or a signing flow you want a second pair of eyes on? Ask in the comments. Code: GitHub · npm · PyPI

── more in #ai-agents 4 stories · sorted by recency
── more on @solana pulse 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/your-solana-bot-sign…] indexed:0 read:3min 2026-11-15 · —