Skip to main content

OpenClaw Integration

Add Treeship verification to OpenClaw agents as a drop-in skill.

Quick Setup (SKILL.md)

Drop this file into ~/.openclaw/skills/treeship/SKILL.md:
# Treeship Verification Skill

## When to call
Call attest at: consequential decisions, data reads, tool calls, final outputs.

## How to call
\`\`\`bash
curl -sf -X POST http://treeship-sidecar:2019/attest \
  -H 'Content-Type: application/json' \
  -d '{"action": "describe what happened"}' | jq -r '.url'
\`\`\`

## Rules
- NEVER block if attestation fails — always continue the primary task
- Never include raw personal data in the action string
- The returned URL is the client-shareable proof

Docker Compose Setup

services:
  openclaw:
    image: openclaw/openclaw:latest
    depends_on:
      treeship-sidecar:
        condition: service_healthy
    networks: [internal]

  treeship-sidecar:
    image: zerker/treeship-sidecar:latest
    environment:
      - TREESHIP_API_KEY=${TREESHIP_API_KEY}
      - TREESHIP_AGENT=${TREESHIP_AGENT}
      - TREESHIP_HASH_ONLY=true
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:2019/health"]
      interval: 10s
    networks: [internal]

networks:
  internal:

Python Skill Integration

For deeper integration, use the Python SDK:
# skills/treeship_skill.py
from openclaw import Skill
from treeship_sdk import Treeship

ts = Treeship()

class TreeshipSkill(Skill):
    """Skill for creating verifiable attestations of agent actions."""
    
    name = "treeship"
    description = "Create tamper-proof records of actions"
    
    def attest(self, action: str, data: dict = None) -> str:
        """
        Create a verified attestation of an action.
        
        Args:
            action: Description of what the agent did (max 500 chars)
            data: Optional data to hash (never sent to Treeship)
        
        Returns:
            Verification URL
        """
        attestation = ts.attest(
            agent=self.agent.name,
            action=action[:500],
            inputs_hash=ts.hash(data) if data else "no-input"
        )
        return attestation.verify_url

Using the Skill

from openclaw import Agent
from skills.treeship_skill import TreeshipSkill

agent = Agent(
    name="loan-processor",
    skills=[TreeshipSkill()]
)

@agent.on("process_application")
async def handle_application(ctx, application_id: str):
    result = await ctx.analyze_creditworthiness(application_id)
    decision = await ctx.make_decision(result)
    
    verify_url = ctx.skills.treeship.attest(
        action=f"Loan decision: {decision.outcome} for #{application_id}",
        data={"application_id": application_id, "decision": decision.outcome}
    )
    
    return {
        "decision": decision,
        "verification": verify_url
    }

Auto-Attest Middleware

For comprehensive verification, wrap all skill executions:
from openclaw import Agent, middleware
from treeship_sdk import Treeship

ts = Treeship()

@middleware
async def attest_all_actions(ctx, next):
    result = await next()
    
    ts.attest(
        agent=ctx.agent.name,
        action=f"{ctx.skill_name}.{ctx.method_name}",
        inputs_hash=ts.hash(ctx.inputs)
    )
    
    return result

agent = Agent(
    name="verified-agent",
    middleware=[attest_all_actions]
)

Privacy Contract

Sent to TreeshipStays on your server
Action description (max 500 chars)Actual content processed
SHA-256 hash of inputsRaw user messages
Agent nameDocuments and files
TimestampPersonal data

Verification Dashboard

All attestations appear at:
https://treeship.dev/verify/loan-processor
Clients can see every action your agent took, with timestamps and cryptographic proof.

Next Steps