The concept of verifiable AI agents represents a significant leap in trust and transparency within human-AI interactions. In current times, when AI systems are no longer just chatbots and are becoming a vital part of one’s day-to-day life, verifying the authenticity and origin of their responses is critical. This is where the idea of verifiable agents comes into play, ensuring that the responses you receive genuinely come from an AI agent and not any human or some other source. This idea is introduced by Opacity Network, a mainnet AVS (Actively Validated Services) built on EigenLayer. By leveraging cryptographic technologies like zero-knowledge (ZK) proofs, Opacity has made it possible to authenticate interactions without revealing unnecessary or sensitive information, balancing perfectly between verification and privacy.
When integrated with an AI agent like Eliza, Opacity AVS ensures that every interaction generates a cryptographic proof that can be independently verified. This proof acts as a notary by providing confidence that the responses are indeed from the intended AI agent, ensuring more secure and trustworthy AI-driven systems.
In this article, we’ll cover a step-by-step process to build a verifiable AI agent by enabling the agent’s verifiable inference capability using Opacity.
Prerequisites
- A Virtual Machine (such as the ones provided by NodeShift) with at least:
- 4 vCPUs
- 8 GB RAM
- 50 GB SSD
- Ubuntu 22.04 VM
Note: The prerequisites for this are highly variable across use cases. A high-end configuration could be used for a large-scale deployment.
Step-by-step process to build a verifiable AI agent with Opacity
For this tutorial, we’ll use a CPU-powered Virtual Machine by NodeShift, which provides high-compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. It also offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider you choose and follow the same steps for the rest of the tutorial.
Step 1: Setting up a NodeShift Account
Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.
If you already have an account, login straight to your dashboard.
Step 2: Create a Compute Node (CPU Virtual Machine)
After accessing your account, you should see a dashboard (see image), now:
- Navigate to the menu on the left side.
- Click on the Compute Nodes option.
- Click on Start to start creating your very first compute node.
These Compute nodes are CPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations, such as vCPUs, RAM, and storage, according to your needs.
Step 3: Select configuration for VM
- The first option you see is the Reliability dropdown. This option lets you choose the uptime guarantee level you seek for your VM (e.g., 99.9%).
- Next, select a geographical region from the Region dropdown where you want to launch your VM (e.g., United States).
- Most importantly, select the correct specifications for your VM according to your workload requirements by sliding the bars for each option.
Step 4: Choose VM Configuration and Image
- After selecting your required configuration options, you’ll see the available VMs in your region and as per (or very close to) your configuration. In our case, we’ll choose a ‘4vCPUs/8GB/160GB SSD’ as the closest match to the “Prerequisites”.
- Next, you’ll need to choose an image for your Virtual Machine. For the scope of this tutorial, we’ll select Ubuntu, as we will deploy the agent on the Ubuntu server.
Step 5: Choose the Billing cycle and Authentication Method
- Two billing cycle options are available: Hourly, ideal for short-term usage, offering pay-as-you-go flexibility, and Monthly for long-term projects with a consistent usage rate and potentially lower cost.
- Next, you’ll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.
Step 6: Finalize Details and Create Deployment
Finally, you can also add a VPC (Virtual Private Cloud), which provides an isolated section to launch your cloud resources (Virtual machine, storage, etc.) in a secure, private environment. We’re keeping this option as the default for now, but feel free to create a VPC according to your needs.
Also, you can deploy multiple nodes at once using the Quantity option.
That’s it! You are now ready to deploy the node. Finalize the configuration summary; if it looks good, go ahead and click Create to deploy the node.
Step 7: Connect to active Compute Node using SSH
As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!
Once your node shows this status, follow the below steps to connect to the running VM via SSH:
- Open your terminal and run the below SSH command:
(replace root
with your username and paste the IP of your VM in place of ip
after copying it from the dashboard)
ssh root@ip
2. In some cases, your terminal may take your consent before connecting. Enter ‘yes’.
3. A prompt will request a password. Type the SSH password, and you should be connected.
Output:
Step 8: Install and set up dependencies
First, we will prepare the environment by installing the dependencies required to build and run the agent. Follow the below instructions to install packages one by one:
- Install the latest version of NodeJS (version 23+) with the given instructions on the website.
a) Start with installing nvm
(Node Version Manager).
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Output:
b) Download and install NodeJS (restart the terminal before running).
nvm install 23
Output:
c) Confirm the installations using the commands below.
node -v
npm -v
2. Instal pnpm (version 9+).
npm install -g pnpm
Output:
3. Install Git for version control and for cloning the repository. Run the following commands one by one.
apt update
apt install git-all
Output:
4. Also, to use VS Code to work with the AI model on Ubuntu VM, you need to connect your local VS Code editor to your Ubuntu server via SSH with the following steps:
a) Install the “Remote-SSH” Extension by Microsoft on VS Code.
b) Type “Remote-SSH: Connect to Host
” on the Command Palette.
c) Enter the host details, such as username and SSH password, and you should be connected.
Step 9: Install Eliza Framework
Eliza, developed by ai16z, is a framework for building AI agents. It saves time, cost, and effort by not reinventing the wheel when you can create exceptional agents by extending and customizing Eliza’s abilities.
- Clone the Eliza git repository.
git clone https://github.com/ai16z/eliza.git
Output:
2. Checkout to the develop
branch.
Move inside the project directory with “cd eliza
” and run the following command to checkout to the develop
branch of Eliza.
git switch develop
Output:
Once you hit the above command, the branch will be switched to the latest version. Proceed by installing this version with the following command:
pnpm install
Output:
3. Build the local environment.
pnpm build
Output:
Step 10: Enable Opacity’s verifiable inference
After completing the above installations, you can access the project directory and modules by opening the project folder with VS code connected to the Ubuntu server via SSH (refer to Step 8).
Moving forward, we’ll edit the environment variables in the project directory to:
– allow Eliza to access AI models that will be used to feed our agent’s brain.
– enable Opacity’s verifiable inference feature.
- First, copy the
.env.example
file to the .env
file.
cp .env.example .env
2. Add OpenAI API key in the “OpenAI Configuration” section in the .env
file.
3. Edit the Opacity zkTLS
section.
Search “Opacity” in the .env
file to land in this section, as shown below. Overwrite the VERIFIABLE_INFERENCE_ENABLED
value from false
to true
. This is the single most crucial step required to convert your regular AI agent to a “Verifiable” one.
Step 11: Choose a Character for the Agent
Next, we’ll choose a character personality for our AI agent. Eliza offers multiple characters to choose from by default. You can build your own AI agent and personality; however, for the scope of this tutorial, we’ll select one from the default ones.
- Open the character file from the
characters
folder.
We’ll select the trump.character.json
as our character file.
2. Check the character configuration.
Make sure that modelProvider
is set to openai
as we are using OpenAI as our AI feed. Also, we’ll keep the clients
array empty as we’ll test the client in localhost. However, you may add your choice of client here, for e.g., “twitter
” if you want to build a Twitter agent.
Step 12: Access the Eliza Client on the Web
Move inside the “client/src/lib
” directory and open the api.ts
file. There, you’ll find a BASE_URL
that points to the address where the agent is running. This is the address to which our Eliza Client sends requests to perform the operations.
Since our project is running inside a remote server, we’ll need to replace this localhost
in this address with our server’s IP address.
Once the configuration part is done, we can move inside the terminal and start the application with the following commands:
- Open two terminal tabs; in the first one, start the agent character.
pnpm start --characters="./characters/trump.character.json"
Output:
2. In the second terminal, start the Eliza client.
pnpm start:client
Output:
3. Access the client.
Open your browser and go to the http://localhost:5173
address to access the web interface of the Eliza client, which looks like this:
4. Click on Chat, and you’ll see a chat interface opening up like this.
Once you send a prompt to the agent and receive a response, Opacity will generate a ZK proof inside the terminal that proves the authenticity of the AI agent’s response (if it’s really an agent responding and not a human!).
An example ZK-proof is shown in the below image. You can view the full example ZK-proof here.
Conclusion
We have covered a quick and simple approach to building a verifiable AI agent with Eliza and Opacity. This powerful combination allows you to build exceptional agents for more complex use cases by fine-tuning and customizing Eliza in your own way according to your use case. However, building and deploying an AI agent isn’t just about code; it’s about reliability, scalability, and the ability of your agent to be up and running all the time to keep interacting with your audience or perform crucial tasks. With NodeShift, you can bring your AI agent to life and keep it running smoothly in production, so you can focus on refining its personality and essential features like verifiability without worrying about the backend environment and under-the-hood deployment tasks.