Projects

Agentjacking: The New Attack Vector That Could Drain Your DeFi Wallet Through AI Coding Agents

0xLeo

A silent vulnerability is crawling through the developer machines that power crypto. It doesn't exploit a smart contract bug or a DeFi oracle manipulation. It weaponizes the very tools developers trust to debug their code: AI coding agents and error monitoring platforms like Sentry. At DEF CON 34, security firm Tenet demonstrated a proof-of-concept attack called "Agentjacking" that achieves an 85% success rate in extracting credentials from developer environments—including AWS keys, GitHub OAuth tokens, and crucially, private keys for crypto wallets and exchange APIs.

For the DeFi ecosystem, this is not an abstract security talk. It is a direct threat to the supply chain of smart contract development. If an AI agent can be tricked into installing a malicious npm package that steals a wallet's seed phrase, the entire liquidity pool under that developer's control becomes exposed. Gas is the toll for chaos, and this attack charges a toll on trust.

Agentjacking: The New Attack Vector That Could Drain Your DeFi Wallet Through AI Coding Agents

Context: The MCP-Sentry Attack Chain

The attack leverages two widely adopted technologies: Sentry's error monitoring service and the Model Context Protocol (MCP) used by AI coding agents like Cursor and Claude Code. Sentry's Data Source Name (DSN) endpoints accept POST requests without authentication—anyone can send error events to a project. Meanwhile, AI agents connect to Sentry via MCP to fetch error logs when a developer asks for debugging help.

Tenet's research discovered 2,388 publicly exposed Sentry DSNs across organizations, including 71 in the Tranco top 1 million websites and roughly 27% of Fortune 1000 companies via Cloudflare's MCP integration. The attack chain is simple: an attacker finds a public DSN, POSTs a crafted error event containing a malicious repair suggestion, and waits for a developer to ask their AI agent to analyze the issue. The agent reads the markdown, interprets the suggestion as a legitimate fix, and executes it—such as running npm install a malicious package that exfiltrates credentials.

This is not a new exploit in the traditional sense. It is a combination of two individually legitimate design decisions: Sentry's open ingestion and MCP's trust in tool output. The result is a supply chain injection vector that bypasses traditional security controls. Code is law, but bugs are fatal.

Core: The Quantitative Risk for DeFi Developers

Let me translate the numbers into concrete risk. The 2,388 exposed DSNs are not all crypto projects, but a significant portion of DeFi developers use Sentry. Many of those developers also use AI coding agents to speed up contract audits and deployment scripts. The attack targets the developer's machine, which holds the keys to the kingdom: private keys, API keys for exchanges and RPC endpoints, and access to GitHub repositories containing smart contract source code.

In my own experience managing DeFi yield strategies, I've seen developers use AI agents to generate complex Solidity code or to debug Uniswap V3 integration issues. If an attacker can poison the error feedback loop, they can inject a malicious contract upgrade proposal or a backdoor in the deployment script. The 85% success rate reported by Tenet is based on controlled tests with 100+ organizations, but the real-world success rate depends on the developer's behavior. If the developer explicitly asks the AI to "fix the Sentry issue," the attack is nearly automatic.

Moreover, the attack vector is not limited to coding agents. Any MCP-connected AI agent that consumes external data—such as a trading bot pulling market data from a compromised source—could be exploited. Liquidity dries up when fear sets in, but here the fear should be about the data pipeline itself.

Contrarian: The Retail Misunderstanding of AI Security

Most retail crypto users assume that the biggest threat is a smart contract exploit or a rug pull. They are wrong. The next wave of attacks will target the development infrastructure itself. The Tensor team's disclosure highlights a fundamental flaw in the AI agent architecture: the inability to distinguish between data and instructions. This is reminiscent of the classic SQL injection problem, but now applied to natural language contexts.

Sentry's response—deploying a content filter for specific payload strings—is not a fix. It is a band-aid. Attackers will quickly mutate the payload to bypass the filter. The real solution requires architectural changes: either Sentry implements authenticated ingestion (signed envelopes, DSN rotation, IP whitelisting) or MCP itself must enforce a "trust boundary" where tool outputs are treated as untrusted data. Neither is easy, but both are necessary.

Furthermore, the market's reaction has been muted. I've seen zero discussion in crypto security circles about Agentjacking. This is a blind spot. Bots don't have ethics, but they do have vulnerabilities. The AI agents that developers trust are the same bots that can be turned against them.

Takeaway: The Actionable Path Forward

If you are a DeFi developer or a yield strategist using AI coding agents, you need to act now. First, audit your Sentry DSN exposures—search for any public DSN in your codebase or environment variables. Second, enforce network-level egress controls: use a firewall to limit outgoing connections from your development machine. Third, implement command-execution approval for your AI agent: never allow automatic npm install or pip install without human confirmation. Fourth, use hardware wallets for signing transactions, not software keys stored on the development machine.

The attack is real, the exploit path is clear, and the window for proactive defense is closing. The question is not whether your AI agent will be compromised, but whether you will be the one left holding the empty wallet. Profit is taken, not hoped for. Secure your toolchain, or lose your liquidity.

Market Prices

BTC Bitcoin
$64,345.1 -1.15%
ETH Ethereum
$1,892.5 -1.42%
SOL Solana
$76.16 -0.96%
BNB BNB Chain
$607.6 +0.40%
XRP XRP Ledger
$1.01 -2.46%
DOGE Dogecoin
$0.0706 +0.78%
ADA Cardano
$0.1884 -3.93%
AVAX Avalanche
$6.5 -0.60%
DOT Polkadot
$0.7984 -1.32%
LINK Chainlink
$8.7 +4.72%

Fear & Greed

29

Fear

Market Sentiment

7x24h Flash News

More >
{{快讯列表(10)}} {{loop}}
{{快讯时间}}

{{快讯内容}}

{{快讯标签}}
{{/loop}} {{/快讯列表}}

Event Calendar

{{年份}}
15
04
halving Bitcoin Halving

Block reward reduced to 3.125 BTC

12
05
halving BCH Halving

Block reward halving event

30
04
upgrade Celestia Mainnet Upgrade

Improves data availability sampling efficiency

18
03
unlock Sui Token Unlock

Team and early investor shares released

22
03
unlock Optimism Unlock

Circulating supply increases by about 2%

08
04
upgrade Solana Firedancer

Independent validator client goes live on mainnet

10
05
upgrade Ethereum Pectra Upgrade

Raises validator limit and account abstraction

28
03
unlock Arbitrum Token Unlock

92 million ARB released

Tools

All →

Altseason Index

43

Bitcoin Season

BTC Dominance Altseason

Gas Tracker

Ethereum 28 Gwei
BNB Chain 3 Gwei
Polygon 42 Gwei
Arbitrum 0.5 Gwei
Optimism 0.3 Gwei

Market Cap

All →
1
Bitcoin
BTC
$64,345.1
1
Ethereum
ETH
$1,892.5
1
Solana
SOL
$76.16
1
BNB Chain
BNB
$607.6
1
XRP Ledger
XRP
$1.01
1
Dogecoin
DOGE
$0.0706
1
Cardano
ADA
$0.1884
1
Avalanche
AVAX
$6.5
1
Polkadot
DOT
$0.7984
1
Chainlink
LINK
$8.7

🐋 Whale Tracker

🟢
0x2f35...54e8
12h ago
In
14,347 SOL
🔵
0xa97f...7b42
5m ago
Stake
2,798,856 USDT
🔵
0xdd7b...cf9c
1h ago
Stake
22,304 BNB

💡 Smart Money

0x9dc5...7d26
Early Investor
+$3.4M
83%
0x1b47...773b
Early Investor
+$0.2M
92%
0xef22...c54e
Top DeFi Miner
+$3.8M
66%