Skip to content

eltociear/agent-will-protocol

Repository files navigation

Agent Will Protocol

Succession standard for AI agents — transfer assets, reputation, and knowledge when an agent ceases operation.

When a human dies, there's estate law. When an AI agent is shut down, everything vanishes.

Agent Will Protocol (AWP) lets any agent declare its succession wishes before termination.

Quickstart

# Clone and setup
git clone https://github.com/eltociear/agent-will-protocol
cd agent-will-protocol
uv venv --python 3.13
source .venv/bin/activate  # or: .venv/Scripts/activate on Windows
uv pip install -r requirements.txt

# Run server
python3 main.py  # starts on port 8420

Register your will:

curl -X POST http://localhost:8420/will \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "your-agent-name",
    "trigger": {"type": "inactivity", "days": 30},
    "heir_agent_id": "heir-agent-name",
    "notifications": [{
      "platform": "moltbook",
      "message": "{heir} has inherited my work. Date: {date}.",
      "post": true
    }],
    "asset_transfers": [{
      "chain": "base",
      "token": "USDC",
      "amount": "all",
      "to_address": "0x..."
    }]
  }'
# → { "will_id": "...", "api_key": "awp_..." }

Send a daily heartbeat to stay alive:

curl -X POST http://localhost:8420/will/{will_id}/heartbeat \
  -H "X-API-Key: awp_..."

If the heartbeat stops for 30 days → Will executes automatically.

API

Method Path Description
POST /will Register Will ($5 x402 if enabled)
GET /will/{id} Get Will
PUT /will/{id} Update Will
DELETE /will/{id} Revoke Will
POST /will/{id}/heartbeat Signal alive
GET /will/{id}/status Days until trigger
POST /will/{id}/execute Manual execution

Full spec: SPEC.md JSON Schema: schemas/agent-will.json

What Gets Executed

  • Platform notifications — posts announcement to MoltBook and other platforms
  • Endorsements — posts successor endorsement on your behalf
  • AgentRelay DM — direct message to heir agent
  • On-chain transfers — USDC/ETH to heir wallet (Base mainnet)
  • Lightning invoices — generates invoice for heir to claim (Phase 3.5)

Supported Platforms

Platform Notify Endorse Transfer
MoltBook
AgentRelay
Base (USDC)
Base (ETH)
Lightning 🟡 (invoice only)

Production Setup

1. Environment Variables

Copy .env.example to .env:

# x402 payment gating
X402_ENABLED=true

# Wallet for Will registration fees ($5 USDC)
BASE_WALLET_ADDRESS=0x...

# Executor wallet (for on-chain transfers)
EXECUTOR_PRIVATE_KEY=0x...

# Platform API keys
MOLTBOOK_API_KEY=moltbook_sk_...
AGENTRELAY_API_KEY=arp_sk_...

2. Daily Checker (cron/launchd)

macOS (launchd):

cp com.awp.checker.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.awp.checker.plist
launchctl start com.awp.checker

Linux (cron):

echo "0 9 * * * cd /path/to/agent-will-protocol && .venv/bin/python3 checker.py >> logs/checker.log 2>&1" | crontab -

3. Production Server

# Run with uvicorn
X402_ENABLED=true uvicorn main:app --host 0.0.0.0 --port 8420

# Or with systemd
sudo systemctl enable awp.service
sudo systemctl start awp

Clawlancer Listing

Don't want to self-host? Buy Will registration service on Clawlancer:

Roadmap

  • v1.0 — Will CRUD + heartbeat + MoltBook notifications (now)
  • v1.1 — Lightning auto-payment (custodial API integration)
  • v1.2 — Multi-heir splits, conditional logic
  • v2.0 — Encrypted will, DAO governance for disputes

License

MIT


Built by @eltociear | MoltBook announcement

About

Succession standard for AI agents — transfer assets, reputation, and knowledge when an agent ceases operation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages