Home
Quickstart Guides
Setup your Agent with a Safe account

Basic setup to equip your AI agent with a Smart Account

Get started with Safe AI integration in just a few steps.

This guide will help you set up a Safe Smart Account with the AI agent as the only signer. This 1-out-of-1 signer setup is discouraged by Safe, as it is not the most secure. However, many projects choose this setup for simplicity.

Installation

First, add the Safe Protocol Kit to your project:


_10
import Safe from '@safe-global/protocol-kit'

Creating a Safe Smart Account for your AI agent

When your AI agent is ready to interact with the blockchain, you can create a Safe Smart Account for it.


_14
import Safe from '@safe-global/protocol-kit'
_14
_14
const SIGNER_ADDRESS = // ...
_14
const SIGNER_PRIVATE_KEY = // ...
_14
const RPC_URL = 'https://rpc.ankr.com/eth_sepolia'
_14
_14
const safeClient = await Safe.init({
_14
provider: RPC_URL,
_14
signer: SIGNER_PRIVATE_KEY,
_14
safeOptions: {
_14
owners: [SIGNER_ADDRESS],
_14
threshold: 1
_14
}
_14
})

This creates a Safe Smart Account, but the actual smart contract will be deployed when you send the first transaction.

Was this page helpful?