# Set up guardrails for your agent
Source: https://docs.chain.link/solutions/chainlink-for-agents/guides/set-guardrails

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

> **NOTE: Prerequisites**
>
> This page assumes that the reader is familiar with the Chainlink for Agents product. If that is not the case, please
> go through the [Introduction page](/solutions/chainlink-for-agents) first.

In this guide you will:

1. Learn about Chainlink for Agents' guardrails.
2. Sign up on the Chainlink platform UI.
3. Link your agent to your organization.
4. Set up guardrails for your agent on the Chainlink platform.
5. Create a fresh chain wallet that your agent will use to interact with Chainlink onchain, bound by the guardrails you set up.

## Chainlink for Agents Guardrails

Guardrails for your agent must be set up by you (the human) in the Chainlink platform, which separates them from the agent's control.
See below for instructions on creating an account and linking your agent.

The platform offers a suite of guardrails to help you control and limit your agent's actions.

- **Agent Restriction:** Toggling this on restricts your agent's maximal permission set to just the specific onchain actions that are available to it from [Chainlink for Agents](https://github.com/smartcontractkit/chainlink-for-agents).
  We highly recommend enabling at least Agent Restriction, although best practices would include configuring all guardrails relevant to your operations.
  With this turned off, your agent won't be restricted by any guardrails at all.
- **Send Limit:** Cap the amounts your agent can send/bridge. The platform allows you to configure two types of send limits, in `USD`:
  - Per Transaction Value Limit
  - 24 Hour Transaction Value Limit
- **Operations:** Define the operational boundaries for your agent, such as allowing to only interact with Aave and not Uniswap, or the other way around. We offer the following constraints:
  - Aave - deposits and withdrawals
  - Uniswap - token swaps
  - Token Transfers
  - Bridge using CCIP
- **Transfer and Bridge Allowlist:** Limit the addresses your agent can send or bridge tokens to. Your agent's own chain wallets are always allowed, and you can add other addresses to the allowlist.

## Sign up to the Chainlink platform UI

1. Go to the [Chainlink platform](https://app.chain.link/cre/discover) and sign up for an account if you haven't already.
2. Make sure you have access to the Agents dashboard. Your screen should look something like this. Don't do anything more, you're not quite ready to link your agent to the platform yet.

   ![Screenshot of the Chainlink platform UI showing the Agents dashboard.](/images/solutions/chainlink-for-agents/link-your-agent/link-your-agent-1.png)

## Link your agent to the Chainlink platform

### Generate and fund a wallet address for your agent

1. Just point your agent to the skills repo, and it will set up a new address for you.

2. Fund the newly created address with some `USDC` on `Base` mainnet, to get started.

   ![Screenshot showing the agent creating its own key and address, and asking you to send a little USDC on Base to that address.](/images/solutions/chainlink-for-agents/link-your-agent/link-your-agent-2.png)

3. Once your address is funded, simply ask your agent to finish signing up with Chainlink for Agents, and the skills repo should guide your agent as needed.

   ![Screenshot showing the agent confirming that it's registered with Chainlink for Agents.](/images/solutions/chainlink-for-agents/link-your-agent/link-your-agent-3.png)

### Generate a unique token

1. Now, go to the Agents dashboard of the Chainlink platform, and click on **+ Link Agent**.

2. Paste your agent's address and click on **Generate token**.

   ![Screenshot of the Link Agent form in the Chainlink platform, with fields for your agent's address and a display name, and the Generate token button.](/images/solutions/chainlink-for-agents/link-your-agent/link-your-agent-4.png)

3. Copy the generated token, and give it back to your agent, simply telling it to continue signing up using the token and the instructions provided by the skills repo.

### Complete the linking process

1. After providing the token to your agent, it will give you back a unique signature payload

   ![Screenshot showing the agent returning the signature for you to paste into the Chainlink platform.](/images/solutions/chainlink-for-agents/link-your-agent/link-your-agent-5.png)

2. Take this payload back to the Chainlink platform's UI, and click on **Link Agent**. This one-time back and forth handshake uniquely links your agent's address to your organization.
   Any actions your agent does on your behalf, using the skills we provide, will now be configurable using the platform's UI via guardrails.

## Set up guardrails

1. Go to the [Chainlink platform's Agents dashboard](https://app.chain.link/cre/agents), and click on **Add Guardrails**.

2. Set up minimal guardrails that allow you to follow the tutorial below, without exposing a wider than needed permission set.

   ![Screenshot of the Chainlink platform's guardrails panel for the agent. Agent Restriction is on. Send Limit is on, with a per-transaction limit of 10 USD and a 24-hour limit of 15 USD. Under Operations, only Uniswap token swaps is on; Aave deposits and withdrawals, Token Transfers, and Bridge using CCIP are off. The Transfer and Bridge Allowlist is off.](/images/solutions/chainlink-for-agents/check-price-and-swap/check-price-and-swap-1.png)

3. Click on **Apply Settings** and make sure your guardrails are set up.

> **CAUTION: Keep Agent Restriction on**
>
> We highly recommend leaving Agent Restriction on, even if you don't configure specific settings. It limits your agent
> to the workflows in the Chainlink catalog, even if your agent switches itself to unrestricted mode.

## Create and fund your agent's chain wallet

Give this prompt to your agent to create a fresh, separate chain wallet that it will use to carry out swaps and other onchain operations, bound by the guardrails set up by you in the UI:

```
Create a chain wallet for yourself on Base and give me its address.
```

Behind the scenes, Chainlink for Agents deploys the wallet contract on Base, and the agent pays a one-time fee for that deployment. It's the biggest fee-paying operation in this guide.

> The chain wallet is a contract, so it has no private key. Each chain gets its own chain wallet, so a chain wallet on another chain has a different address.

> **TIP: Agent address vs. chain wallet**
>
> Your agent works with two addresses:
>
> - **Agent address:** the address your agent created during sign-up, and the one you linked to your organization. It's your agent's identity, and your agent pays its Chainlink for Agents fees from it.
> - **Chain wallet:** a [smart contract wallet](/crec/concepts/smart-accounts) that Chainlink for Agents deploys for your agent on each chain it uses, such as Base. It holds the tokens your agent swaps or sends. It has no private key of its own: it only carries out instructions signed with your agent's key and delivered by Chainlink for Agents.
>   - The Chainlink platform and the skills repo also call it an SVA (Signature Verifying Account).
>
> Your agent's swaps run from its chain wallet, so Chainlink for Agents can check each one against your guardrails before it goes onchain. Your link covers both addresses, but guardrails only apply to what your agent does from its chain wallet.

![Screenshot showing the agent creating a new chain wallet on Base.](/images/solutions/chainlink-for-agents/check-price-and-swap/check-price-and-swap-3.png)

- Send `6 USDC` to the freshly created chain wallet on `Base Mainnet`. You can use [BaseScan](https://basescan.org/) to track balances.

## What's next

- [Check the ETH price and swap USDC on Base](/solutions/chainlink-for-agents/guides/check-price-and-swap): ask your agent for a live price, make a small swap, and see a guardrail block a swap.

## 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.