POST
/
agents
/
{agentId}
/
verify
curl -X POST https://api.treeship.dev/v1/agents/agent_123/verify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "verificationType": "full",
    "assertions": [
      "has_capability:data-analysis",
      "compliance:SOC2",
      "performance:uptime>99.9"
    ],
    "proofType": "zk-SNARK",
    "includeMetadata": true
  }'
{
  "agentId": "agent_123",
  "verified": true,
  "verificationType": "full",
  "proof": {
    "type": "zk-SNARK",
    "data": "0x8f9d3a4e5b6c7d8e9f0a1b2c3d4e5f6g7h8i9j0k...",
    "publicInputs": {
      "timestamp": 1706380800,
      "agentHash": "0x7d8f9e8a7b6c5d4e3f2a1b0c9d8e7f6a"
    },
    "verificationKey": "0x2a3b4c5d6e7f8g9h0i1j2k3l4m5n6o7p"
  },
  "assertions": {
    "has_capability:data-analysis": true,
    "compliance:SOC2": true,
    "performance:uptime>99.9": true
  },
  "capabilities": {
    "verified": [
      "data-analysis",
      "text-generation",
      "code-generation"
    ],
    "performance": {
      "data-analysis": {
        "accuracy": 0.97,
        "speed": "2.3s avg"
      },
      "text-generation": {
        "quality": 0.94,
        "tokens_per_second": 150
      }
    }
  },
  "compliance": {
    "frameworks": ["SOC2", "ISO27001", "GDPR"],
    "certifications": [
      {
        "name": "SOC2 Type II",
        "validUntil": "2025-12-31",
        "issuer": "Deloitte"
      }
    ],
    "lastAudit": "2024-01-15T10:00:00Z"
  },
  "metadata": {
    "createdAt": "2023-06-01T00:00:00Z",
    "lastActive": "2024-01-27T12:00:00Z",
    "trustScore": 0.98,
    "transactionCount": 15420
  },
  "timestamp": "2024-01-27T12:30:00Z"
}

Request

agentId
string
required
The unique identifier of the agent to verify
verificationType
string
required
Type of verification to perform. Options:
  • identity - Verify agent’s cryptographic identity
  • capabilities - Verify claimed capabilities
  • compliance - Verify regulatory compliance
  • performance - Verify performance metrics
  • full - Complete verification (all types)
assertions
array
Specific assertions to verify
[
  "has_capability:text-generation",
  "compliance:GDPR",
  "performance:accuracy>0.95"
]
proofType
string
default:"zk-SNARK"
Type of proof to generate. Options: zk-SNARK, zk-STARK
includeMetadata
boolean
default:"false"
Include additional metadata in the verification response
curl -X POST https://api.treeship.dev/v1/agents/agent_123/verify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "verificationType": "full",
    "assertions": [
      "has_capability:data-analysis",
      "compliance:SOC2",
      "performance:uptime>99.9"
    ],
    "proofType": "zk-SNARK",
    "includeMetadata": true
  }'

Response

agentId
string
The verified agent’s identifier
verified
boolean
Overall verification status
verificationType
string
Type of verification performed
proof
object
Zero-Knowledge proof of verification
assertions
object
Results of each assertion check
{
  "has_capability:data-analysis": true,
  "compliance:SOC2": true,
  "performance:uptime>99.9": true
}
capabilities
object
Verified agent capabilities (if requested)
compliance
object
Compliance verification results (if requested)
metadata
object
Additional metadata (if requested)
timestamp
string
ISO 8601 timestamp of verification
{
  "agentId": "agent_123",
  "verified": true,
  "verificationType": "full",
  "proof": {
    "type": "zk-SNARK",
    "data": "0x8f9d3a4e5b6c7d8e9f0a1b2c3d4e5f6g7h8i9j0k...",
    "publicInputs": {
      "timestamp": 1706380800,
      "agentHash": "0x7d8f9e8a7b6c5d4e3f2a1b0c9d8e7f6a"
    },
    "verificationKey": "0x2a3b4c5d6e7f8g9h0i1j2k3l4m5n6o7p"
  },
  "assertions": {
    "has_capability:data-analysis": true,
    "compliance:SOC2": true,
    "performance:uptime>99.9": true
  },
  "capabilities": {
    "verified": [
      "data-analysis",
      "text-generation",
      "code-generation"
    ],
    "performance": {
      "data-analysis": {
        "accuracy": 0.97,
        "speed": "2.3s avg"
      },
      "text-generation": {
        "quality": 0.94,
        "tokens_per_second": 150
      }
    }
  },
  "compliance": {
    "frameworks": ["SOC2", "ISO27001", "GDPR"],
    "certifications": [
      {
        "name": "SOC2 Type II",
        "validUntil": "2025-12-31",
        "issuer": "Deloitte"
      }
    ],
    "lastAudit": "2024-01-15T10:00:00Z"
  },
  "metadata": {
    "createdAt": "2023-06-01T00:00:00Z",
    "lastActive": "2024-01-27T12:00:00Z",
    "trustScore": 0.98,
    "transactionCount": 15420
  },
  "timestamp": "2024-01-27T12:30:00Z"
}

Verification Types

Identity Verification

Verifies the agent’s cryptographic identity:
const identity = await treeship.agents.verify(agentId, {
  verificationType: 'identity'
});

Capability Verification

Confirms the agent can perform claimed functions:
const capabilities = await treeship.agents.verify(agentId, {
  verificationType: 'capabilities',
  assertions: [
    'has_capability:nlp',
    'has_capability:vision'
  ]
});

Performance Verification

Validates performance metrics:
const performance = await treeship.agents.verify(agentId, {
  verificationType: 'performance',
  assertions: [
    'accuracy>0.95',
    'latency<100ms',
    'uptime>99.9%'
  ]
});

Use Cases