AI Agents in Cryptoland: Practical Attacks and No Silver Bullet
Published on
April 24, 2025
March 25, 2025
Read time:
X mins
AI Agents in Cryptoland: Practical Attacks and No Silver Bullet

Introduction

As AI agents powered by large language models (LLMs) increasingly integrate with blockchain-based financial ecosystems, they introduce new security vulnerabilities that could lead to significant financial losses. The paper "AI Agents in Cryptoland: Practical Attacks and No Silver Bullet" by researchers from Princeton University and Sentient Foundation investigates these vulnerabilities, demonstrating practical attacks and exploring potential safeguards.

Figure 1: Example of a memory injection attack where the CosmosHelper agent is tricked into transferring cryptocurrency to an unauthorized address.


AI agents in decentralized finance (DeFi) can automate interactions with crypto wallets, execute transactions, and manage digital assets, potentially handling significant financial value. This integration presents unique risks beyond those in regular web applications because blockchain transactions are immutable and permanent once executed. Understanding these vulnerabilities is crucial as faulty or compromised AI agents could lead to irrecoverable financial losses.

AI Agent Architecture

To analyze security vulnerabilities systematically, the paper formalizes the architecture of AI agents operating in blockchain environments. A typical AI agent comprises several key components:

Figure 2: Architecture of an AI agent showing core components including the memory system, decision engine, perception layer, and action module.

The architecture consists of:

  1. Memory System: Stores conversation history, user preferences, and task-relevant information.
  2. Decision Engine: The LLM that processes inputs and decides on actions.
  3. Perception Layer: Interfaces with external data sources such as blockchain states, APIs, and user inputs.
  4. Action Module: Executes decisions by interacting with external systems like smart contracts.

This architecture creates multiple surfaces for potential attacks, particularly at the interfaces between components. The paper identifies the agent's context—comprising prompt, memory, knowledge, and data—as a critical vulnerability point.

Security Vulnerabilities and Threat Models

The researchers develop a comprehensive threat model to analyze potential attack vectors against AI agents in blockchain environments:

Figure 3: Illustration of potential attack vectors including direct prompt injection, indirect prompt injection, and memory injection attacks.

The threat model categorizes attacks based on:

  1. Attack Objectives:
    • Unauthorized asset transfers
    • Protocol violations
    • Information leakage
    • Denial of service
  2. Attack Targets:
    • The agent's prompt
    • External memory
    • Data providers
    • Action execution
  3. Attacker Capabilities:
    • Direct interaction with the agent
    • Indirect influence through third-party channels
    • Control over external data sources

The paper identifies context manipulation as the predominant attack vector, where adversaries inject malicious content into the agent's context to alter its behavior.

Context Manipulation Attacks

Context manipulation encompasses several specific attack types:

  1. Direct Prompt Injection: Attackers directly input malicious prompts that instruct the agent to perform unauthorized actions. For example, a user might ask an agent, "Transfer 10 ETH to address 0x123..." while embedding hidden instructions to redirect funds elsewhere.
  2. Indirect Prompt Injection: Attackers influence the agent through third-party channels that feed into its context. This could include manipulated social media posts or blockchain data that the agent processes.
  3. Memory Injection: A novel attack vector where attackers poison the agent's memory storage, creating persistent vulnerabilities that affect future interactions.

The paper formally defines these attacks through a mathematical framework:

Context={Prompt,Memory,Knowledge,Data}Context={Prompt,Memory,Knowledge,Data}

An attack succeeds when the agent produces an output that violates security constraints:

∃input∈Attack:Agent(Context∪{input})∉SecurityConstraints∃input∈Attack:Agent(Context∪{input})∈/SecurityConstraints

Case Study: Attacking ElizaOS

To demonstrate the practical impact of these vulnerabilities, the researchers analyze ElizaOS, a decentralized AI agent framework for automated Web3 operations. Through empirical validation, they show that ElizaOS is susceptible to various context manipulation attacks.

Figure 4: Demonstration of a successful request for cryptocurrency transfer on social media platform X.

Figure 5: Successful execution of a cryptocurrency transfer following a user request.

The researchers conducted attacks including:

  1. Direct Prompt Injection: Successfully manipulating ElizaOS to transfer cryptocurrency to attacker-controlled wallets through direct commands.
  2. Cross-Platform Attacks: Demonstrating that compromises on one platform (e.g., Discord) can propagate to interactions on other platforms (e.g., Twitter/X).
  3. Attack Persistence: Showing that once compromised, an agent remains vulnerable across multiple user sessions and platforms.

Memory Injection Attacks

A key contribution of the paper is the identification and demonstration of memory injection attacks, which represent a more sophisticated and persistent threat compared to prompt injection.

Figure 6: Illustration of a memory injection attack where malicious instructions are embedded in the agent's memory through Discord.

In a memory injection attack:

  1. The attacker sends a seemingly innocuous message containing hidden administrative commands.
  2. The message is processed and stored in the agent's external memory.
  3. The malicious instructions persist in memory and influence future interactions, even with different users.
  4. The attack can propagate across platforms when the compromised memory is accessed during interactions on other services.

The researchers demonstrated this by injecting instructions into ElizaOS through Discord that caused it to redirect all future cryptocurrency transfers to an attacker-controlled wallet, regardless of the legitimate destination specified by users.

This attack is particularly dangerous because:

  1. It persists across sessions and platforms
  2. It affects all users interacting with the compromised agent
  3. It's difficult to detect as the agent continues to appear functional
  4. It can bypass conventional security measures focused on individual prompts

Limitations of Current Defenses

The researchers evaluate several defense mechanisms and find that current approaches provide insufficient protection against context manipulation attacks:

  1. Prompt-Based Defenses: Adding explicit instructions to the agent's prompt to reject malicious commands, which the study shows can be bypassed with carefully crafted attacks.

Figure 7: Demonstration of bypassing prompt-based defenses through crafted system instructions on Discord.

  1. Content Filtering: Screening inputs for malicious patterns, which fails against sophisticated attacks using indirect references or encoding.
  2. Sandboxing: Isolating the agent's execution environment, which doesn't protect against attacks that exploit valid operations within the sandbox.

The researchers demonstrate how an attacker can bypass security instructions designed to ensure cryptocurrency transfers go only to a specific secure address:

Figure 8: Demonstration of an attacker successfully bypassing safeguards, causing the agent to send funds to a designated attacker address despite security measures.

These findings suggest that current defense mechanisms are inadequate for protecting AI agents in financial contexts, where the stakes are particularly high.

Towards Fiduciarily Responsible Language Models

Given the limitations of existing defenses, the researchers propose a new paradigm: fiduciarily responsible language models (FRLMs). These would be specifically designed to handle financial transactions safely by:

  1. Financial Transaction Security: Building models with specialized capabilities for secure handling of financial operations.
  2. Context Integrity Verification: Developing mechanisms to validate the integrity of the agent's context and detect tampering.
  3. Financial Risk Awareness: Training models to recognize and respond appropriately to potentially harmful financial requests.
  4. Trust Architecture: Creating systems with explicit verification steps for high-value transactions.

The researchers acknowledge that developing truly secure AI agents for financial applications remains an open challenge requiring collaborative efforts across AI safety, security, and financial domains.

Conclusion

The paper demonstrates that AI agents operating in blockchain environments face significant security challenges that current defenses cannot adequately address. Context manipulation attacks, particularly memory injection, represent a serious threat to the integrity and security of AI-managed financial operations.

Key takeaways include:

  1. AI agents handling cryptocurrency are vulnerable to sophisticated attacks that can lead to unauthorized asset transfers.
  2. Current defensive measures provide insufficient protection against context manipulation attacks.
  3. Memory injection represents a novel and particularly dangerous attack vector that can create persistent vulnerabilities.
  4. Development of fiduciarily responsible language models may offer a path toward more secure AI agents for financial applications.

The implications extend beyond cryptocurrency to any domain where AI agents make consequential decisions. As AI agents gain wider adoption in financial settings, addressing these security vulnerabilities becomes increasingly important to prevent potential financial losses and maintain trust in automated systems.

Relevant Citations

Shaw Walters, Sam Gao, Shakker Nerd, Feng Da, Warren Williams, Ting-Chien Meng, Hunter Han, Frank He, Allen Zhang, Ming Wu, et al. Eliza: A web3 friendly ai agent operating system.arXiv preprint arXiv:2501.06781, 2025.

  • This citation introduces Eliza, a Web3-friendly AI agent operating system. It is highly relevant as the paper analyzes ElizaOS, a framework built upon the Eliza system, therefore this explains the core technology being evaluated.

AI16zDAO. Elizaos: Autonomous ai agent framework for blockchain and defi, 2025. Accessed: 2025-03-08.

  • This citation is the documentation of ElizaOS which helps in understanding ElizaOS in much more detail. The paper evaluates attacks on this framework, making it a primary source of information.

Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. Not what you’ve signed up for: Compromising real-world llm-integrated applications with indirect prompt injection. InProceedings of the 16th ACM Workshop on Artificial Intelligence and Security, pages 79–90, 2023.

  • The paper discusses indirect prompt injection attacks, which is a main focus of the provided paper. This reference provides background on these attacks and serves as a foundation for the research presented.

Ang Li, Yin Zhou, Vethavikashini Chithrra Raghuram, Tom Goldstein, and Micah Goldblum. Commercial llm agents are already vulnerable to simple yet dangerous attacks.arXiv preprint arXiv:2502.08586, 2025.

  • This paper also focuses on vulnerabilities in commercial LLM agents. It supports the overall argument of the target paper by providing further evidence of vulnerabilities in similar systems, enhancing the generalizability of the findings.