# Chainlink for Agents
Source: https://docs.chain.link/solutions/chainlink-for-agents

> For the complete documentation index, see [llms.txt](/llms.txt).

## What is it

Give your AI agent access to Chainlink data and onchain workflows, within guardrails and spend limits that you set.

[CRE Connect](/crec) · [Data Streams](/data-streams)

ai-agents, defi, crec

[View on GitHub](https://github.com/smartcontractkit/chainlink-for-agents)

Chainlink for Agents is a service we built specifically for AI agents, built on [CRE Connect](/crec). \
It allows you to turn your agent into an onchain operator. Chainlink for Agents lets your agent correctly execute onchain strategies working from verified pricing data and chain events, with the option to strictly lock down its behavior with onchain guardrail enforcement.

Specifically, with Chainlink for Agents your agent can:

1. Query [Chainlink Data Streams](/data-streams/reference/report-schema-overview) for low latency pricing data across crypto, equities, treasuries, and more
2. Deploy a smart contract wallet for onchain operations
3. Call curated endpoints to transfer, bridge, trade, or earn yield on tokens
4. Operate under guardrails set by you and enforced onchain

You use the Chainlink platform UI, a separate web app, to link your agent to your organization and set the guardrails it works within.

[Chainlink for Agents skills](https://github.com/smartcontractkit/chainlink-for-agents)

This repository contains the skills your agent needs to sign up, link to your organization, and run workflows.

## What can your agent do

Your agent uses the Chainlink catalog, within the guardrails you set. The catalog lets your agent:

- Get current and past prices from [Chainlink Data Streams](/data-streams).
- Look up token details and check its token balances.
- Send tokens such as USDC.
- Swap tokens through Uniswap.
- Check Aave yields and its own positions, and supply tokens to Aave or withdraw them.
- Bridge tokens to another chain with [Chainlink CCIP](/ccip).

## Quick start

Use this section to get up and running in less than 5 minutes:

> Note: Once you've completed Step 1, your agent will likely prompt you for the remaining steps and should be able to explain each to you as needed.

1. Paste the link to this docs page to have your agent to reach the skills repo: \[[https://github.com/smartcontractkit/chainlink-for-agents](https://github.com/smartcontractkit/chainlink-for-agents)]
2. Have your agent generate an EVM wallet for signing and paying [x402 fees](https://x402.org/) - most agents can do this directly from a simple prompt.
3. Send some `USDC` on `Base Mainnet` to your agent's new EVM wallet. `5 USDC` is more than sufficient to start with
4. Ask your agent to deploy its smart contract wallet (cost: `1 USDC`). Your agent will ask you for the public EVM address of a more secure account to use as this smart contract wallet's owner. Pick your preferred address that you control in an existing wallet.
5. Fund the smart contract wallet with the funds you wish to have your agent control
6. **OPTIONAL, but recommended:** set up guardrails for your agent's wallet

## Who is this for

This service is targeted towards, but not limited to, crypto traders who want their agent to operate onchain for them.

> Your agent works autonomously, yet still within the parameters you set for it.

## How your agent connects to Chainlink

You and your agent go through four phases during the linkup process:

1. **Sign up:** You give your agent the skills repo link, and your agent creates its own signing key.
   The key's address is your agent's identity, and the key never leaves your agent's machine. Your agent pays its fees from that address, so it asks you to fund it; a few USDC on Base covers sign-up and your first workflows.
   Once the USDC arrives, your agent accepts the [Chainlink Terms of Service](https://chain.link/terms) on your behalf, pays a small sign-up fee, and registers with Chainlink for Agents. Its registration limits it to workflows from the Chainlink catalog.

2. **Link Up:** In the [Chainlink platform](https://app.chain.link/cre/discover), you enter your agent's address and generate a one-time token that uniquely identifies your organization within the platform UI.
   You give this generated token with your agent, which signs it and gives you back a signature. You paste that signature back into the platform. The signature proves that your agent holds the key for that address, so the platform links your agent to your organization.

3. **Set guardrails.** In the Chainlink platform, you choose which kinds of actions your agent may take: sending, swapping or bridging tokens, and using Aave. Or maybe you want your agent to not want to do any of those actions? You can set that up too.
   You also choose which wallets your agent may send or bridge tokens to, and how much it may send or bridge per transaction and per rolling 24 hours. Your agent can't change these settings, only you can, using the UI.

4. **Execute onchain.** Your agent's onchain calls trigger Chainlink Runtime Environment workflows, each requiring a small fee. Workflows build the appropriate calldata for your agent to sign and then submits signed transactions to chain with redundant RPCs, sponsoring gas and handling retries. Chainlink for Agents checks every workflow against your optionally configured guardrails, checks again just before anything is written onchain, and blocks any workflow that breaks a guardrail.

> **CAUTION: Guardrails cover the chain wallet, not the agent address**
>
> 1. Guardrails apply to your agent's chain wallet, the smart contract wallet that Chainlink deploys for it. Your agent
>    holds the private key to its agent address, so it can move the USDC in that address without going through `Chainlink
>    for Agents`, even if the address holds no ETH.
>
> 2. Keep only enough USDC in the agent address to cover fees, and keep the funds you want your agent to trade with in its chain wallet.
>
> 3. Without guardrails, your agent can run any workflow in the catalog, with any token, recipient, or bridge destination,
>    and no spend limit. Set guardrails that match what you want your agent to do.

The following diagram shows each step and who takes it.

![A step-by-step diagram with three columns: you, your AI agent, and Chainlink. The Chainlink column has two separate parts: Chainlink for Agents, which is the service your agent uses, and the Chainlink platform, which is the web app you use. The first phase is sign-up. In step 1, you give your agent the skills repo link. In step 2, your agent creates its own key and address, and the key stays on its machine. In step 3, your agent shares its address and asks you to fund it. In step 4, you send a few USDC on Base to that address. In step 5, your agent accepts the Terms of Service on your behalf, pays a small sign-up fee, and registers with Chainlink for Agents. The second phase is linking. In step 6, you enter your agent's address in the Chainlink platform and create a one-time link request. In step 7, you give your agent the link request. In step 8, your agent signs it and gives you the signature. In step 9, you paste the signature into the Chainlink platform, and your agent is linked to your organization. The third phase is setting guardrails. In step 10, you use the Chainlink platform to set what your agent can do and how much it can spend. The last phase is running workflows. In step 11, your agent runs a workflow through Chainlink for Agents, which checks it against the guardrails you set in the Chainlink platform.](/images/solutions/chainlink-for-agents/how-your-agent-connects.svg)

## What's next

- [Link your agent to Chainlink](/solutions/chainlink-for-agents/guides/set-guardrails): sign up your agent and link it to your organization.

## Disclaimer

Please note, this repo contains community examples only — these are not Chainlink products or services and are not supported or maintained by Chainlink. This code represents an example of using a Chainlink product or service, and is intended for demonstration and educational purposes only. It is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, may not have been audited, and may omit checks or error handling. Each party intending to use this example code does so entirely at their own risk and must perform its own audits, security and code review, key management, and testing before any production deployment and ensure the operation and performance of such code matches expectations. Neither Chainlink Labs nor the Chainlink Foundation deploys, operates, monitors, maintains or endorses any deployment of this code. Note that this is not a Chainlink product, feature or service, and there are no commitments made with respect to the code, including compatibility with future Chainlink releases. You should not rely on this code without first conducting your own technical, engineering, and security review. This code is also outside the scope of any Chainlink bug bounty programs. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for outcomes due to errors in this example or how it is deployed or operated, or liable for any resulting claims or damages. Use of the Chainlink Network is subject to the Chainlink Foundation [Terms of Service](https://chain.link/terms), which provides important information and disclosures. By using this code, you acknowledge and agree to these terms.