# solana-incident-forensics

> Solana exploit response: trace inner instructions and balance diffs, reproduce locally, contain, postmortem.

solana-incident-forensics is a free AI agent skill on Agensi by BanditXBT, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [BanditXBT](https://www.agensi.io/creators/banditxbt)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/solana-incident-forensics
- Tags: security, web3-crypto, testing-debugging

## About this skill

Order: **contain → understand → recover → learn.** Everything is on-chain and permanent; record signatures, slots, and addresses for every claim.

- Verify it's real: vault/TVL balance vs. expected, abnormal outflows, oracle/price anomalies, unusual instruction patterns.
- Pull pre-planned levers: **pause** (guardian), disable markets/deposits, cap withdrawals, rotate compromised keys. If the program is upgradeable and the bug is in code, prepare a patched binary via **buffer + multisig** (see `solana-deploy-upgrade-ops`); if a key is compromised, move authorities first.
- Tell users to revoke token delegations if approvals/delegates are involved.
- Escalate: auditors, the Security Alliance (SEAL 911), major RPC/infra partners, exchanges and stablecoin issuers (freeze/flag attacker addresses), and bridge operators if funds are moving cross-chain. Consider a whitehat bounty offer with a deadline via on-chain message.
- Open a private incident channel; lead + scribe + comms; UTC timeline starting now.

1. **Find transactions:** explorer pages for the program/vault accounts (Solscan, SolanaFM, Solana Explorer), or RPC `getSignaturesForAddress` for the program/vault around the first anomalous slot. Regular RPC nodes prune old history: use an archival-capable provider for older data.
2. **Inspect each tx:** `solana confirm -v <SIG>` or `getTransaction(sig, {maxSupportedTransactionVersion: 0, encoding: "jsonParsed"})`. Read: `message.accountKeys` (+ **address lookup table** resolved addresses in `loadedAddresses`), instruction list, **`innerInstructions`** (CPIs: where the value actually moved), `logMessages` (program logs, CU used, errors), and `preBalances/postBalances` plus `preTokenBalances/postTokenBalances` to compute exact per-account deltas.
3. **Identify the pattern:** which accounts were fake/substituted (owner, mint, oracle, sysvar), which instruction lacked a check, whether a flash-loan/bundle (many instructions or Jito-style bundle across txs) funded price moves, and the profit extraction path (swap → SOL/stables → bridge/CEX).
4. **Reproduce locally:** clone the relevant accounts at the pre-exploit slot (`solana-test-validator --clone ...`, or LiteSVM with fetched account data) and the program binary (`solana program dump <ID> prog.so`, checking the on-chain version at that slot). Write a failing test replaying the exploit instructions; apply the patch and show it passes (see `solana-testing-fuzzing`).
5. **Classify root cause:** missing signer/owner/type check · PDA/seed flaw · arbitrary CPI · sysvar spoof · duplicate account · reinit/close revival · arithmetic/rounding · oracle manipulation/staleness · Token-2022 extension abuse · compromised upgrade/admin key (ops, not code) · supply-chain (malicious dependency/npm/crate). Reference classes: Wormhole (Feb 2022, unchecked instructions sysvar), Cashio (Mar 2022, unvalidated collateral account chain), Mango (Oct 2022, oracle-manipulated collateral).
6. **Quantify:** per-asset loss at time of exploit with pricing method stated, affected users/vaults, attacker net profit after fees/tips, and **remaining exposure** in sibling programs or other deployments sharing the flaw.

Label attacker wallets and intermediate accounts; set alerts on them; note exits (DEX swaps, bridges, CEX deposits, mixers/privacy tools). Share addresses with exchanges and analytics firms fast. Attribute only with evidence ("consistent with"). Remember funds can hop cross-chain within minutes.

## Requires

- Solana CLI
- Optional: Archive-capable RPC

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the solana-incident-forensics skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does solana-incident-forensics do?

Solana exploit response: trace inner instructions and balance diffs, reproduce locally, contain, postmortem.

### Which AI agents support solana-incident-forensics?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use solana-incident-forensics?

Connect your AI agent to Agensi through MCP, then ask it to use solana-incident-forensics on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
