# onchain-incident-forensics

> EVM exploit response: contain, trace with cast/anvil, reproduce, follow funds, blameless postmortem.

onchain-incident-forensics is a paid 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: $3.15 (one-time purchase)
- 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/onchain-incident-forensics
- Tags: security, web3-crypto, testing-debugging

## About this skill

Order of operations: **contain → understand → recover → learn.** Evidence is on-chain and permanent; act on it quickly but record every step with tx hashes and block numbers.

- Confirm it is real: compare balances/TVL, check explorer for the drain pattern, check price/oracle anomalies.
- Use pre-planned levers: **pause** (guardian multisig), disable markets/new positions, lower caps, revoke/upgrade, pause bridge routes (per chain). Know who holds keys *before* an incident; if the pause path is slow or contested, that is a postmortem finding.
- Tell users to **revoke approvals** if a token-approval drain is possible.
- Engage help early: the Security Alliance (SEAL 911) and your auditors; contact exchanges/stablecoin issuers/bridges to flag attacker addresses; consider a whitehat bounty offer (typically a negotiated percentage with a deadline) via an on-chain message.
- Open a private incident channel, assign lead + scribe + comms; UTC timeline from the first moment.

1. **Find the transactions:** explorer address pages, token transfer logs, internal txs, `cast logs`, or a subgraph query over the affected contract's events around the first anomalous block.
2. **Trace execution:** `cast run <txhash> --rpc-url <archive node>` (replays and prints the call trace), or Tenderly/Phalcon/Dedaub tools for visual traces and state diffs. Identify: entry point, flash loan (Aave/Balancer/Uniswap) source, callback re-entry, swaps/price moves, the vulnerable call, and profit extraction/exit path.
3. **Reproduce on a fork:** `anvil --fork-url <archive> --fork-block-number <block-1>`, then write a Foundry PoC that replays the exploit. A passing PoC proves the root cause and lets you test the patch against the same state.
4. **Classify the root cause:** access control / reentrancy (incl. read-only) / oracle manipulation / rounding or share-inflation / signature replay / bridge verification / upgrade or init error / compromised key (off-chain: phishing, leaked secrets, supply-chain). Distinguish *vulnerability* from *key/ops compromise*: the response differs.
5. **Quantify:** funds lost per asset at the time and USD value (state methodology/prices), affected users, attacker profit net of costs, remaining at-risk funds in sibling contracts/chains (check every deployment with the same code).

Label attacker EOAs/contracts; watch movements via alerts; common exits: swap to ETH/stables, bridges, mixers/privacy tools, CEX deposits. Share addresses with exchanges and analytics firms quickly. Attribute only with evidence; use "consistent with" language.

## Requires

- Foundry (cast, anvil)
- Optional: Archive 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 onchain-incident-forensics skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

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

EVM exploit response: contain, trace with cast/anvil, reproduce, follow funds, blameless postmortem.

### Which AI agents support onchain-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 onchain-incident-forensics?

Connect your AI agent to Agensi through MCP, then ask it to use onchain-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.
