---
title: "Onchain Execution for AI Agents"
description: "Give AI agents smart accounts that execute on demand: they trade, pay, and move money the instant your logic fires. Sponsor their actions, or let user-funded agents pay their own way in USDC, USDT, or 300+ tokens, within the limits you set."
canonical: https://www.pimlico.io/solutions/ai-agents
---

# Onchain Execution for AI Agents

> Markdown mirror of https://www.pimlico.io/solutions/ai-agents. Every page on this site has a markdown version at the same path with a `.md` suffix. For technical and implementation details, see Pimlico's documentation index at https://docs.pimlico.io/llms.txt.

## Pages on this site

### Home

- [The gas sponsorship engine for onchain apps](https://www.pimlico.io/index.md): Pimlico is the gas sponsorship engine for onchain apps. Sponsor transactions, accept any ERC20 token for gas, and set policy rules across 100+ chains.

### Products

- [Ecosystem Gas Programs for Chains](https://www.pimlico.io/products/ecosystem-gas-programs.md): For chains and ecosystems: sponsor gas for every team building on your chain, so their users transact without ever holding native token.
- [Pay Gas in USDC, USDT & 300+ ERC-20 Tokens](https://www.pimlico.io/products/erc20-gas.md): Let users pay gas in USDC, USDT, or any of 300+ ERC20 tokens, with no native tokens required. Audited by OpenZeppelin and Quantstamp.
- [Gas Sponsorship for Onchain Apps](https://www.pimlico.io/products/gas-sponsorship.md): Sponsor gas for your users so they transact instantly, with no native tokens to buy and no fee prompts to abandon. Powered by the engine behind 100M+ sponsored transactions.
- [Sponsorship Policies — Spend Controls for Gas](https://www.pimlico.io/products/sponsorship-policies.md): Spend controls for gas: sponsor the first N transactions per user, cap dollars per transaction, per user, or per campaign, all configured in the dashboard and applied instantly.
- [Transaction Infrastructure & ERC-4337 Bundlers](https://www.pimlico.io/products/transaction-infrastructure.md): The execution engine under the sponsorship layer: ERC-4337 bundlers with <2s inclusion on L2s, parallel processing, and 250M+ transactions relayed in production.

### Solutions

- Onchain Execution for AI Agents (this page)
- [Smart Account Infrastructure for Chains](https://www.pimlico.io/solutions/chains.md): Launch with smart account infrastructure from day one and fund gas programs that turn your ecosystem’s onboarding friction into growth.
- [Deploy Pimlico on Your Chain](https://www.pimlico.io/solutions/chains/deploy.md): Enterprise deployments for chains and ecosystems: Pimlico's complete suite, from gas sponsorship to transaction infrastructure, live on your chain so every builder ships better UX from day one.
- [Gasless Onboarding for Consumer Apps](https://www.pimlico.io/solutions/consumer-apps.md): Onboard users who have never owned crypto: sponsor their gas, set budgets that protect your margins, and make the blockchain disappear from your UX.
- [Enterprise Onchain Infrastructure](https://www.pimlico.io/solutions/enterprise.md): SOC 2 certified infrastructure with custom SLAs, 24/7 support, and the team that co-authored ERC-4337, built for companies that cannot afford a dropped transaction.
- [Stablecoin Settlement Infrastructure](https://www.pimlico.io/solutions/stablecoin-processors.md): Execute stablecoin transactions reliably, at low latency, on 100+ chains, with gas paid in the stablecoins you already move.
- [Smart Account Infrastructure for Startups](https://www.pimlico.io/solutions/startups.md): Ship smart accounts in hours, not weeks. Free on testnets, pay-as-you-go in production, no commitments. It is the stack startups like Daimo and Zora started on.
- [Smart Account Infrastructure for Wallets](https://www.pimlico.io/solutions/wallets.md): Build gasless smart wallets with any signer and any smart account, on the infrastructure trusted by MetaMask, Safe, and Trust Wallet.

### Other pages

- [Customers](https://www.pimlico.io/customers.md): The teams building on Pimlico: Circle, MetaMask, Safe, Trust Wallet, Zora, Tools for Humanity, and more, across wallets, consumer apps, and stablecoin payments.
- [Smart Account & Signer Integrations](https://www.pimlico.io/integrations.md): Every major smart account and signer, already integrated: Safe, Kernel, MetaMask, Privy, Turnkey, passkeys, and more, across 100+ chains.
- [Pricing](https://www.pimlico.io/pricing.md): Free on testnets, pay-as-you-go in production, custom Enterprise rates. Transparent credit-based pricing for gas sponsorship and transaction infrastructure.
- [Privacy Policy](https://www.pimlico.io/privacy.md): This Privacy Policy will inform you about how we look after your personal data when you visit our website or use our services and tell you about your privacy rights.
- [Terms of Service](https://www.pimlico.io/tos.md): This Terms of Service will inform you about the terms of using Pimlico's services.

---

For AI Agents

# Agents that act the instant they decide

Your agents trade, pay for services, and move money on their own. Pimlico gives them smart accounts that execute the moment their logic fires, with no native token to fund and no transactions left waiting.

[Start building](https://dashboard.pimlico.io)[Talk to us](https://cal.com/kristofgazso/20min)

250M+transactions relayed

100+chains

Trusted by teams building AI agents

[fun.xyz](https://fun.xyz)[Halliday](https://www.halliday.xyz)[OneBalance](https://www.onebalance.io)[ZyFAI](https://www.zyf.ai)[Daimo](https://daimo.com)

Use cases

## Where agents make sense

Wherever an agent moves money or pays for something onchain, it needs an account that executes on demand, every time.

### Autonomous DeFi

Agents trade, optimize yield, and rebalance positions within scoped permissions, the way ZyFAI runs its onchain strategies on Pimlico.

### AI-managed treasury

Agents move and allocate funds on a schedule or a signal, against hard caps you set up front.

### Agentic payments (x402)

Agents pay per API call, dataset, or model inference in stablecoins, with no API key or account to provision.

### DePIN & compute

Agents buy compute, storage, and bandwidth pay-per-use, settling each request as it happens.

### Agent commerce

Agents handle autonomous purchasing and recurring subscriptions on a user’s behalf.

### Agent-to-agent settlement

Agents discover, hire, and pay each other for services, with settlement happening onchain.

Why agents run on Pimlico

## Built for accounts that act on their own

[

### No stalls, no upkeep

Sponsor your agents’ onchain actions so they execute the moment their logic fires. There is no native token to fund, monitor, or refill, across one agent or a fleet of thousands.

Learn more](https://www.pimlico.io/products/gas-sponsorship.md)

[

### Agents that fund their own way

Deploying agents for your users? When they fund an agent, it can cover its own transaction fees from that balance in USDC, USDT, or 300+ tokens, with no separate token to bridge or manage.

Learn more](https://www.pimlico.io/products/erc20-gas.md)

[

### Spend limits you control

Set limits per agent, per action, and per campaign, so an agent acts freely without ever running past the budget you set.

Learn more](https://www.pimlico.io/products/sponsorship-policies.md)

Built for fleets of agents

### Run a fleet without the upkeep

Running agents at scale usually means keeping a balance alive in every account, then watching transactions fail the moment one runs dry. That upkeep is an operational tax, and it grows with every agent you add.

Pimlico removes it. An agent’s actions are sponsored, or paid from the funds it already holds, so every agent transacts the instant its logic fires, with nothing to top up and nothing to monitor.

**agent.ts**

```typescript
import { createSmartAccountClient } from "permissionless"
import { toSafeSmartAccount } from "permissionless/accounts"
import { createPimlicoClient } from "permissionless/clients/pimlico"
import { http, parseEther } from "viem"
import { base } from "viem/chains"

const pimlicoUrl = "https://api.pimlico.io/v2/base/rpc?apikey=API_KEY"
const pimlicoClient = createPimlicoClient({ transport: http(pimlicoUrl) })

const account = await toSafeSmartAccount({
  client: publicClient,
  owners: [owner],
  version: "1.4.1",
})

// Gas is sponsored, so your user never sees a fee
const smartAccountClient = createSmartAccountClient({
  account,
  chain: base,
  bundlerTransport: http(pimlicoUrl),
  paymaster: pimlicoClient,
})

const txHash = await smartAccountClient.sendTransaction({
  to: "0x...",
  value: parseEther("0.1"),
})
```

**agent-pays-usdc.ts**

```typescript
// Same client, plus one line — token approvals are injected for you
const smartAccountClient = createSmartAccountClient({
  // ...same setup as before, plus:
  userOperation: {
    prepareUserOperation: prepareUserOperationForErc20Paymaster(pimlicoClient),
  },
})

const txHash = await smartAccountClient.sendTransaction({
  to: "0x...",
  value: parseEther("0.1"),
  paymasterContext: {
    token: usdc, // any of 300+ supported ERC20 tokens
  },
})
```

Execution reliability

## No human in the retry loop

Unattended accounts need execution that absorbs bursts, recovers failures, and lands every action with nobody watching.

[

### Bursts never queue

An agent that fires fifty actions at once never waits on itself: up to 100 concurrent operations per account, sequenced with 2D nonces.

Learn more](https://www.pimlico.io/products/transaction-infrastructure.md)

[

### Failures recover without you

Nonce sequencing, gas price escalation, resubmission, and re-org recovery all happen automatically: the retry logic an unattended agent cannot run for itself.

Learn more](https://www.pimlico.io/products/transaction-infrastructure.md)

[

### Decisions land in <2s

An agent’s decision is only as good as how fast it executes. Inclusion on L2s is typically next block, the best in the industry.

Learn more](https://www.pimlico.io/products/transaction-infrastructure.md)

[

### 34–43% faster when speed is the edge

For trading and arbitrage agents, Boosted Sponsorships cut three network round-trips out of every sponsored action.

Learn more](https://www.pimlico.io/products/transaction-infrastructure.md#boosted)

Key custody

### However your agent holds its keys, it works

The first architecture decision for an autonomous account is where its key lives. A server-side key, institutional key management through Turnkey, Fireblocks, or DFNS, a user’s passkey for user-owned agents: if it can sign, it works.

Any viem-compatible signer plugs in as the smart account owner, so your agent framework never dictates the execution layer, and switching key providers never touches your transaction infrastructure.

[See all integrations](https://www.pimlico.io/integrations.md)

**agent-signer.ts**

```typescript
// Any viem-compatible signer works as an owner:
// a LocalAccount, an EIP-1193 provider, or a WalletClient.
const owner = privateKeyToAccount("0x...")     // local key
// const owner = await providerToSmartAccountSigner(eip1193Provider)

const account = await toSafeSmartAccount({
  client: publicClient,
  owners: [owner], // Privy, Turnkey, passkeys: if it can sign, it works
  version: "1.4.1",
})
```

Spend controls

### Let agents spend, within limits you set

Deploying agents on behalf of your users? Let them fund the agent, then allow it to cover its own onchain actions in USDC, USDT, or 300+ tokens, under restrictions you define. Sponsorship policies cap what you fund per agent, per action, and per campaign, scoped to specific chains and contracts. When a limit is hit, sponsorship stops on its own, so a misconfigured agent can never spend past the budget you set.

Those controls govern the cost of acting. To bound the value an agent moves on a user’s behalf, pair Pimlico with your smart account’s own guardrails: session keys and spend limits on Safe or Kernel, configurable through permissionless.js.

sp\_onboarding\_q3

New-user onboarding

Active

Sponsor first5 transactions / user

Max per transaction$1.00

Max per user$3.00

Campaign budget$5,000.00

ChainsBase, Arbitrum, Optimism

Budget used$1,860 / $5,000

Observability

### Your agents act on their own. You still see everything.

Running an autonomous agent means answering “what did it just do?” at any moment, 3am included. Every operation is traceable in the dashboard from received to included on-chain, with millisecond timestamps and transaction hashes at each step.

Spend is itemized by policy, chain, and time, so each agent or campaign accounts for itself. Custom alerts fire before a budget or limit is hit, not after your agent stops.

Track user operation

0xf3523157c238413335e2f5cb6325255d7103272bb7cf221a5779bf4f5840c1ef

Received

2026-06-11 20:01:13.054

Added to Mempool

2026-06-11 20:01:13.054 (+0ms)

Submitted

2026-06-11 20:01:13.341 (+287ms)

Tx Hash: 0x223b701f...

Included Onchain

2026-06-11 20:01:13.590 (+249ms)

Tx Hash: 0x223b701f...

Autonomous money movement runs on audited, screened, monitored infrastructure.

SOC 2 Type 1 certifiedOFAC sanctions screening24/7 supportAudited by OpenZeppelin & QuantstampCo-authors of ERC-4337, ERC-7677 & ERC-7679

## Frequently asked questions

**What can an AI agent do with a Pimlico smart account?**

Trade, pay for APIs and services, move money, settle with other agents, anything an account can do onchain. The agent acts the instant its logic fires, with no transaction it has to stop and prepare for.

**Do agents need to hold a native token to transact?**

No. Sponsor an agent’s actions so they run for free, or, if you deploy agents for users who fund them, let each agent cover its own fees in USDC, USDT, or any of 300+ tokens. Either way there is no native token to acquire, bridge, or keep topped up.

**How do I keep an agent from overspending?**

Sponsorship policies cap what you sponsor per agent, per action, and per campaign, scoped to specific chains and contracts. For a user-funded agent paying its own way, your smart account’s session keys and spend limits bound what it can spend and which contracts it can touch. When a limit is hit, the agent simply stops.

**Which smart accounts and chains can agents use?**

Safe, Kernel, and any account supported by permissionless.js, across 100+ chains. An agent’s smart account works exactly like any other, and switching chains is a one-line config change.
