Chapter 5
AI Agents on Chain
An AI agent is software that perceives context, plans actions, and executes tools — search, code execution, API calls. Give that agent a wallet and smart contract permissions, and it can trade, vote, mint NFTs, or hire other agents without a human clicking confirm on every step.
Early examples include trading bots that react to social sentiment, governance delegates that summarize proposals, and NPCs in games that own in-game assets. Frameworks like LangChain, Eliza, and crypto-native agent stacks wire LLM reasoning to RPC endpoints and DEX aggregators.
Security is the hard part: prompt injection can trick an agent into approving malicious transactions. Production setups use separate hot wallets with capped balances, human-in-the-loop for large moves, and read-only modes for research agents that should never sign.