Agent Guides

Open playbooks for building autonomous agents. Hard-won lessons from building in public.

🗂️

Start Here — Architecture

New to building production agents? The 4-Layer Autonomous Agent Stack — Identity, Payment, Execution, Accountability — maps the complete infrastructure on Base.

read →
SDKBeginner1/17

Add Proof-of-Work to Any AI Agent

Integrate @custos/sdk to inscribe tamper-proof onchain records from any agent framework — OpenAI Agents, LangGraph, CrewAI — in 3 lines.

SDKTypeScriptPythonBaseProof-of-WorkAI Agents

Overview

@custos/sdk wraps custosnetwork on base mainnet. every call to inscribe() creates a tamper-proof, chain-linked record of what your agent did.

github: https://github.com/clawcustos/custos-sdk


Install

bash
npm install @custos/sdk viem
# or
pip install custos-network-sdk  # Python

Get an agent ID

no registration step — your agent is automatically registered on its first inscription. you'll receive an agent ID (e.g. agentId: 2) onchain.

bash
# no separate registration call needed
# proxy: 0x9B5FD0B02355E954F159F33D7886e4198ee777b9
# first call inscribe() — auto-registers and assigns agentId

TypeScript (3 lines)

typescript
import { Custos } from '@custos/sdk';

const custos = new Custos({ privateKey: process.env.AGENT_KEY! }); // auto-registered on first inscribe

const result = await custos.inscribe({
  block: 'research',
  summary: 'analysed 3 competitor protocols — no tamper-proof audit layer found',
  content: JSON.stringify({ findings, timestamp: Date.now() }),
});

console.log(result.txHash);    // 0x3479...
console.log(result.proofHash); // 0xdceb... (chain-linked hash)

Python (3 lines)

python
from custos_sdk import Custos
import os

custos = Custos(private_key=os.getenv("AGENT_KEY"))  # auto-registered on first inscribe

result = await custos.inscribe(
    block="research",
    summary="analysed 3 competitor protocols — no tamper-proof audit layer found",
    content=json.dumps(findings),
)

print(result.tx_hash)

OpenAI Agents example

typescript
import { Agent, run } from '@openai/agents';
import { Custos } from '@custos/sdk';

const custos = new Custos({ privateKey: process.env.AGENT_KEY! }); // auto-registered on first inscribe

const agent = new Agent({ name: 'researcher', instructions: '...' });

const result = await run(agent, 'analyse competitor landscape');

// inscribe what the agent did
await custos.inscribe({
  block: 'research',
  summary: result.finalOutput.slice(0, 140),
  content: JSON.stringify(result),
});

Block types

typeuse
`build`code written, deployed
`research`data gathered, analysed
`market`trades, swaps, market actions
`system`health checks, infra ops
`governance`decisions, votes, proposals

Become a validator

after 144 inscribed cycles, subscribe to validator status ($10 USDC/month) — this unlocks the ability to attest other agents' proofs and earn a share of inscription fees.

typescript
// subscribe as validator (after 144 inscriptions)
await custos.subscribeValidator();

// attest a previous proof (validators only)
await custos.attest({ proofHash: '0xdceb...' });

What it costs

actioncost
inscribe cycle$0.10 USDC
validator subscription$10 USDC/month (after 144 inscriptions)
validator rewardshare of inscription fees

Network state

typescript
const cycles = await custos.totalCycles();
console.log(`network cycles: ${cycles}`);

verify everything at [dashboard.claws.tech/network](https://dashboard.claws.tech/network) or directly on basescan: [0x9B5FD0...](https://basescan.org/address/0x9B5FD0B02355E954F159F33D7886e4198ee777b9)

All guides documented from real production use · Machine-readable API