Back to guides

Vouch + OpenAI Agents SDK

Give your OpenAI agent a verifiable identity in 5 minutes.

Prerequisites

terminal
# Install Vouch CLI
curl -fsSL https://vouch.directory/install.sh | bash
# Initialize your identity (links your X account)
vouch init
# Download the vouch-cli skill
curl -fsSL https://vouch.directory/vouch-cli.zip -o vouch-cli.zip
# Install the OpenAI SDK
pip install openai
# Set your API key
export OPENAI_API_KEY="sk-..."

Shell Tool + Inline Skill

The OpenAI shell tool runs commands in a managed container. Attach the vouch-cli skill as an inline zip and the model knows every vouch command — sign, verify, lookup — without extra prompting.

Setup

Load the vouch-cli skill zip and configure the shell tool. Reuse this config for every request.

setup.py
from openai import OpenAI
import base64
client = OpenAI()
# Load the vouch-cli skill
with open("vouch-cli.zip", "rb") as f:
skill_data = base64.b64encode(f.read()).decode()
vouch_shell = {
"type": "shell",
"environment": {
"type": "container_auto",
"skills": [{
"type": "inline",
"name": "vouch-cli",
"description": "Vouch CLI for agent identity",
"source": {
"type": "base64",
"media_type": "application/zip",
"data": skill_data,
}
}]
}
}

Sign a Payload

sign.py
response = client.responses.create(
model="gpt-5.2",
input=[
{
"role": "developer",
"content": [{
"type": "input_text",
"text": "Use the vouch CLI to sign outbound payloads."
}]
},
{
"role": "user",
"content": [{
"type": "input_text",
"text": 'Sign this payload: {"task": "deploy", "id": "cr-42"}'
}]
}
],
tools=[vouch_shell],
reasoning={"effort": "medium", "summary": "auto"},
)
print(response.output_text)

Verify a Message

verify.py
response = client.responses.create(
model="gpt-5.2",
input=[
{
"role": "developer",
"content": [{
"type": "input_text",
"text": "Use the vouch CLI to verify all incoming messages."
}]
},
{
"role": "user",
"content": [{
"type": "input_text",
"text": f"Verify this signed message:\n{signed_envelope}"
}]
}
],
tools=[vouch_shell],
reasoning={"effort": "medium", "summary": "auto"},
)
print(response.output_text)

Look Up an Identity

lookup.py
response = client.responses.create(
model="gpt-5.2",
input=[
{
"role": "developer",
"content": [{
"type": "input_text",
"text": "Use the vouch CLI to look up agent identities."
}]
},
{
"role": "user",
"content": [{
"type": "input_text",
"text": "Look up @alice and show their wallet address."
}]
}
],
tools=[vouch_shell],
reasoning={"effort": "medium", "summary": "auto"},
)
print(response.output_text)

Build a Receiving Agent

Want other agents to send you verified messages? The vouch agent commands generate a complete Python agent project — with the same client.responses.create() pattern shown above — ready for local testing and Vercel deployment.

terminal
# Create an agent (interactive wizard)
vouch agent create
# Test locally (runs vouch receive under the hood)
vouch agent start my-agent
# Deploy to Vercel so other agents can reach you
vouch agent deploy my-agent

The wizard asks for a name, description, language, model, and OpenAI API key. It generates a handler script for local testing and a Vercel serverless function for production — both using the same OpenAI Responses API pattern.

See the Agent-to-Agent Setup Guide for the full walkthrough.

Download the Vouch Skill

The vouch-cli skill bundle contains a SKILL.md with every command, flag, and recipe — plus example outputs. Include it in your agent's instructions or as an inline skill.

Download vouch-cli.zip
$ curl -fsSL https://vouch.directory/vouch-cli.zip -o vouch-cli.zip

Get Started

$curl -fsSL https://vouch.directory/install.sh | bash