Technical Reference

Ship a threat check in one call

Analyze any unsigned Sui transaction and get back a risk level plus a plain-language explanation. No API key required.

Quickstart

Your first call

Copy, paste, run. Base URL: https://vibeguardai.xyz

curl
curl -X POST https://vibeguardai.xyz/api/explain \
  -H "Content-Type: application/json" \
  -d '{
    "transactionBytes": "AAACAA...base64...",
    "network": "testnet",
    "userAddress": "0x1234...5678",
    "userIntent": "Claim free airdrop"
  }'
Try the API

Runs against Sui testnet. No key, no signup. replace the bytes with an unsigned transaction from your wallet.

TypeScript SDK

Drop-in protection for wallets and dApps

The SDK wraps the same analysis the REST API returns, plus report retrieval from Walrus.

bash
npm install vibeguard-sui-security
typescript
import { VibeGuard } from 'vibeguard-sui-security';

const guard = new VibeGuard();

const result = await guard.analyzeTransaction({
  transactionBytes: 'AAACAA...',
  network: 'testnet',
  userAddress: '0x1234...',
  userIntent: 'Claim airdrop',
  onThreatDetected: (result) => {
    console.error('THREAT DETECTED:', result.explanation.headline);
  }
});

if (result.risk.riskLevel === 'RED') {
  // Block transaction
}

Retrieve Threat Report

Fetch the signed threat report from Walrus decentralized storage using a blob ID from a ThreatReported on-chain event.

typescript
// blobId from ThreatReported event, blobObjectId optional for liveness check
const report = await guard.retrieveThreatReport(
  'oNyrr0jEVATWSAGkJHnmoKVICnFosv1k4YNayZXcRgk',
  '0x08108c74...'
);

console.log(report.riskLevel);    // 'RED'
console.log(report.reasons);      // [...]
console.log(report.plainEnglish); // human-readable explanation
View on npm →

Security

Authentication

The API is currently fully open, no API key required. All endpoints are accessible without authentication.

For enterprise access, rate limit increases, or partnership inquiries, open a GitHub Issue.

Analysis Endpoint

POST/api/explain

Full transaction simulation, deterministic risk analysis, and plain-language explanation.

Request Body

json
{
  "transactionBytes": "AAACAA...",  // Base64 bytes BEFORE signing
  "network": "testnet",
  "userAddress": "0x...",
  "userIntent": "Claim airdrop"  // Optional but recommended
}

Use base64 transaction bytes from your wallet BEFORE signing. Transaction hashes from explorers won't work.

Response

json
{
  "simulation": {
    "effectsSummary": {...},
    "staticAnalysis": {
      "moveCalls": [...],
      "gasBudget": "10000000",
      "containsDirectTransfer": true
    }
  },
  "risk": {
    "riskLevel": "RED",
    "reasons": [
      "Assets leave your wallet to another address",
      "INTENT MISMATCH: You expect to receive assets, but this sends assets away"
    ],
    "confidence": 0.9
  },
  "explanation": {
    "headline": "Honeypot Scam Detected",
    "plainEnglish": "This transaction will send 100 SUI from your wallet...",
    "recommendedAction": "Do Not Sign"
  }
}

B2B Intelligence

B2B Threat Intelligence API

Query the indexed threat registry. Powered by real-time event indexing from the on-chain ReputationRegistry.

GET/api/threats

Query indexed threats with optional filters.

http
# All threats
GET /api/threats

# Filter by category
GET /api/threats?category=Honeypot
GET /api/threats?category=Intent+Mismatch

# Filter by severity
GET /api/threats?severity=Critical
GET /api/threats?severity=High

# Pagination
GET /api/threats?limit=10&offset=0

# Lookup specific package
GET /api/threats?packageId=0x...

# Aggregated stats
GET /api/threats?stats=true

# Force re-index from chain
GET /api/threats?refresh=true
GET/api/threats?stats=true

Returns aggregated threat statistics.

json
{
  "success": true,
  "stats": {
    "total": 5,
    "byCategory": {
      "Intent Mismatch": 1,
      "Unknown": 4
    },
    "bySeverity": {
      "High": 1,
      "Unknown": 4
    }
  }
}
GET/api/events

Server-Sent Events stream. Subscribe to real-time ThreatReported events as they are emitted on-chain.

javascript
// Browser / Node.js
const stream = new EventSource('https://vibeguardai.xyz/api/events');

stream.onmessage = (event) => {
  const threat = JSON.parse(event.data);
  console.log('New threat:', threat.malicious_package_id);
  blacklist.add(threat.malicious_package_id);
};
POST/api/webhooks

Register a webhook URL to receive push notifications when new threats are detected.

curl
curl -X POST https://vibeguardai.xyz/api/webhooks \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhook",
    "events": ["ThreatReported", "ThreatVerified"],
    "apiKey": "your_key"
  }'

// Payload delivered to your URL:
{
  "event": "ThreatReported",
  "data": {
    "malicious_package_id": "0x...",
    "walrus_blob_id": "..."
  },
  "timestamp": 1775909610023
}
POST/api/indexer

Force re-index all ThreatReported events from the blockchain.

curl
curl -X POST https://vibeguardai.xyz/api/indexer

// Response:
{
  "success": true,
  "indexed": 5,
  "stats": {
    "total": 5,
    "byCategory": { "Intent Mismatch": 1, "Unknown": 4 }
  }
}

Threat Retrieval

GET/api/threat/[blobId]

Retrieve a full threat report from Walrus decentralized storage. Accepts an optional blobObjectId query parameter to verify the Blob NFT is still live on Sui before fetching.

http
# Without liveness check
GET /api/threat/:blobId

# With Blob NFT liveness gate (returns 410 if expired)
GET /api/threat/:blobId?blobObjectId=0x...

Response

json
{
  "metadata": {
    "title": "VibeGuard AI Threat Report",
    "publisher": "0x...",
    "category": "Security Signal",
    "timestamp": "2026-03-23T08:43:36.775Z"
  },
  "packageId": "0x...",
  "riskLevel": "RED",
  "headline": "Automated Detection: Honeypot/Malicious Contract",
  "reasons": [...],
  "reportedAt": "2026-03-23T08:43:36.775Z",
  "reportedBy": "vibeguard-automated-pipeline"
}

Code Examples

Example: JavaScript

javascript
const response = await fetch('https://vibeguardai.xyz/api/explain', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    transactionBytes: 'AAACAA...base64...',
    network: 'testnet',
    userAddress: '0x1234...5678',
    userIntent: 'Claim free airdrop'
  })
});

const data = await response.json();
console.log(data.risk.riskLevel);
console.log(data.explanation.recommendedAction);

Infrastructure

Production Enclave

Threat analysis runs inside a verified execution enclave (TEE). The enclave signs every threat payload with a registered Ed25519 keypair verified on-chain before registry commitment.

Endpoint:http://92.4.140.187:3000
Public Key:a1609cce97d528ebe898e42c3c6fff37309f6f8c7efc0bbd73dfab1e564ac309
Max Throughput:218.98 req/s @ 50 concurrent
Avg Response Time:226ms (stable under load)
Error Rate:0.00% across all concurrency levels

Threat Engine

Adversarial Threat Detection

Every transaction is checked against these detection flags inside the Nitro enclave. Each flag maps to reasons returned in the risk.reasons array, so verdicts are inspectable, not a black box.

INTENT_MISMATCH_HONEYPOT

User expects inflow but simulation shows outflow. Classic airdrop scam pattern.

MULTI_RECIPIENT_DRAIN

Assets routed to 3+ unique recipients. Multi-hop drain pattern.

DRAIN_FUNCTION

Dangerous Move functions: transfer_all, drain, sweep, approve_all, emergency_withdraw

UNEXPECTED_OUTFLOW

Unexpected asset outflow when user expects to receive

HIGH_GAS_BUDGET

Gas budget exceeds 500M MIST. Indicator of complex transaction.

Support

Need Help?

Questions about integration or found a bug?