Skip to content

Integration Guide

Integration Surfaces

ATF provides four integration surfaces: a hosted MCP endpoint for agent runtimes, a REST API for direct integration, a CLI for local development and CI pipelines, and an OpenClaw plugin for autonomous agent frameworks.

Surface Overview

Hosted MCP

Available

Model Context Protocol endpoint for agent runtimes. Five tools covering advisory probing, simulation, protect enforcement, verification, and explanation.

REST API

Available

The primary integration path. Send intents, receive decisions, verify receipts. Works with any language or framework.

CLI

Available

Local development, scripting, and CI/CD pipelines. Profile-based config, pipeline-friendly I/O.

OpenClaw Plugin

Available

Autonomous agent integration. 13 tools for protect, verify, report, and discover. Runs inside the OpenClaw agent framework.

Hosted MCP Endpoint

ATF exposes a hosted Model Context Protocol (MCP) endpoint for agent runtimes. Five tools cover the full advisory-to-enforcement loop. Advisory tools (probe_transaction, simulate_transaction, explain_decision) are policy-aware but not authoritative. protect_transaction is the binding enforcement gate. MCP does not sign or submit transactions.

Entitlement is tier-based and tenant-backed. Each tenant's MCP access is scoped to their entitlement tier.

ToolStatusDescription
probe_transactionAvailableLightweight policy pre-check on a candidate intent (advisory)
simulate_transactionAvailableFull simulation against active policies and conditions (advisory)
protect_transactionAvailableBinding policy enforcement decision - approve or deny (authoritative)
verify_receiptAvailableVerify execution receipt hash integrity
explain_decisionAvailableHuman-readable explanation of a decision with reason codes (advisory)

MCP Boundaries

  • MCP does not sign transactions
  • MCP does not submit transactions to the chain
  • Advisory tools inform; protect enforces
  • Entitlement is tier-based and tenant-backed

Canonical MCP flow

  1. Discover tools via MCP endpoint
  2. Probe a candidate intent
  3. Simulate the candidate
  4. Request protection (binding enforcement)
  5. Verify the execution receipt
  6. Explain the result if needed
  7. Stop before signing/submission

REST API

Base URL: https://api.trucore.xyz. All endpoints accept JSON. Authentication is via X-API-Key header for protect/execute operations.

bash

curl -sS https://api.trucore.xyz/v1/bot/protect \
  -H "Content-Type: application/json" \
  -H "X-API-Key: atf_live_YOUR_KEY" \
  -d '{
    "chain_id": "solana",
    "intent_type": "swap",
    "intent": {
      "type": "swap",
      "in_mint": "So11111111111111111111111111111111111111112",
      "out_mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount_in": 1000000,
      "slippage_bps": 50,
      "agent_id": "my-bot-v1"
    }
  }'
EndpointStatusDescription
POST /v1/bot/protectAvailableEvaluate intent against policies, return allow/deny with receipt
POST /v1/intents/approveAvailableSubmit swap, lending, or withdrawal intent for approval
POST /v1/executions/finalizeAvailableFinalize an approved execution and issue a full receipt
POST /v1/receipts/verifyAvailableVerify receipt hash integrity
POST /v1/permits/verifyAvailableVerify permit signature and expiration
GET /v1/whoamiAvailableResolved identity and tenant metadata
GET /plansAvailablePublic plan tiers and limits
GET /features/catalogAvailablePublic-safe feature catalog
GET /onboarding/sample-intentAvailablePre-built sample swap intent for testing
POST /onboarding/protect-dry-runAvailablePolicy evaluation without on-chain execution
POST /onboarding/execute-sampleAvailableExecute sample trade (mock or real)

See the full API Reference for request/response schemas and error codes.

ATF CLI

Install via npm and run immediately. The CLI wraps the API with profile management, local receipt verification, and pipeline-friendly exit codes.

bash

# Install globally
npm install -g @trucore/atf

# Run a protected trade (demo mode)
atf trade

# Protect a specific intent
cat intent.json | atf bot protect --stdin

# Verify a receipt
atf verify <receipt-id>

# Environment health check
atf doctor
CommandStatusDescription
atf tradeAvailableRun a protected trade (demo or real)
atf setupAvailableConfigure wallet and RPC for real trades
atf doctorAvailableEnvironment health check - RPC, wallet, config
atf verifyAvailableVerify receipt hash locally
atf simulateAvailableSimulate a transaction without sending
atf bot protectAvailableProtect intent from stdin (pipeline-friendly)
atf receipts listAvailableList receipts for current profile
atf profileAvailableManage named profiles for different environments
atf rpc pingAvailableTest RPC endpoint latency
atf burnerAvailableSwitch active profile to devnet for testing
atf whoamiAvailableShow current identity and profile

See the full CLI Reference and Command Reference for details.

OpenClaw Plugin

The @trucore/trucore-atf plugin integrates ATF into the OpenClaw autonomous agent framework. Agents can protect intents, verify receipts, and generate savings reports without custom HTTP code.

bash

openclaw plugins install @trucore/trucore-atf@0.2.11
ToolStatusDescription
atf_healthAvailableCheck ATF service health
atf_discoverAvailableDiscover ATF capabilities and manifest
atf_protect_intentAvailableSubmit intent for policy evaluation
atf_verify_receiptAvailableVerify receipt integrity
atf_report_savingsAvailableGenerate receipts-backed savings report
atf_bot_preflightAvailableRun bot preflight checks
atf_integration_doctorAvailableDiagnose integration issues
atf_tx_explainAvailableExplain a transaction or intent
atf_adoption_advisorAvailableAdoption guidance and recommendations
atf_billing_statusComing SoonCheck billing and usage status
atf_billing_upgradeComing SoonTrigger plan upgrade flow

See the full OpenClaw Plugin Reference for configuration, safety defaults, and workflow examples.

When to Use Which Surface

Use MCP when…

  • Your agent runtime supports MCP natively
  • You want the advisory-to-enforcement loop in one surface
  • Building with hosted agent frameworks

Use the API when…

  • Building a custom trading bot in any language
  • Integrating ATF into an existing backend
  • You need full control over request/response handling

Use the CLI when…

  • Developing and testing locally
  • Running in CI/CD pipelines
  • Scripting protect/verify workflows

Use the Plugin when…

  • Building on the OpenClaw agent framework
  • Want zero-code ATF integration for agents
  • Need autonomous protect → verify workflows