Skip to content

ATF Integration

ATF Integration Pattern

Use ATF as an enforcement checkpoint between agent intent and execution. The integration is agent-native, deterministic, and chain-agnostic.

Agent → ATF → Execution Flow

[ AI Agent ]
[ ATF Policy Engine ]
[ Execution Layer ]

ATF sits between decision and capital movement.

  1. 1. Agent constructs a normalized execution request.
  2. 2. ATF evaluates permit constraints and policy invariants.
  3. 3. ATF returns a deterministic decision and receipt hash.
  4. 4. Agent proceeds when allowed, or aborts when denied.

Minimal Example (curl)

The sample below mirrors a Jupiter-style swap intent without executing on-chain logic.

curl -s https://trucore.xyz/api/simulate \
  -H "content-type: application/json" \
  -H "x-api-key: tk_live_..." \
  -d '{
    "action": "swap",
    "token_in": "SOL",
    "token_out": "USDC",
    "amount": 25,
    "max_slippage_bps": 100,
    "ttl_seconds": 60
  }'

Interpret the response using these fields:

  • status: Use allowed to continue orchestration, and denied to stop execution.
  • reason: Human-readable denial or approval rationale for observability and incident triage.
  • receipt_hash: Deterministic hash for audit logs, replay checks, and post-trade review.

Generic agent hook example:

async function evaluateWithAtf(intent: Record<string, unknown>) {
  const response = await fetch("/api/simulate", {
    method: "POST",
    headers: {
      "content-type": "application/json",
      "x-api-key": process.env.ATF_API_KEY ?? "",
    },
    body: JSON.stringify(intent),
  });

  const decision = await response.json();
  if (decision.status !== "allowed") {
    return { proceed: false, reason: decision.reason, receiptHash: decision.receipt_hash };
  }

  return { proceed: true, receiptHash: decision.receipt_hash };
}

Deterministic Guarantee

  • Same input produces the same output decision.
  • Receipt hash is reproducible from canonicalized decision data.

Enforcement Boundary

  • ATF does not custody funds.
  • ATF does not sign transactions.
  • ATF evaluates policy.

MCP Integration

For MCP-compatible agent runtimes, ATF is also available as a hosted MCP endpoint with five tools covering the full advisory-to-enforcement loop. MCP does not sign or submit transactions.

See MCP Integration docs for the tool inventory, canonical flow, and connection details.

OpenClaw Plugin

For OpenClaw-based agents, ATF is available as a plugin. Install it and the gateway handles policy enforcement automatically.

openclaw plugins install @trucore/trucore-atf

See OpenClaw Plugin docs for tools, configuration, and the full onboarding flow.