Developer Reference
ATF Execution Example
A complete request cycle: protect an intent, inspect the deterministic receipt, and verify the outcome. Framework-agnostic. No external plugins required.
npx @trucore/atf@1.5.1. No global install needed.Protect an intent
Submit the proposed transaction to the firewall before signing or broadcasting. The firewall evaluates it against your active policy and returns a decision synchronously.
HTTP
POST /v1/bot/protect
Content-Type: application/json
Authorization: Bearer <api_key>
{
"action": "swap",
"amount_usd": 500,
"slippage_bps": 40,
"market": "SOL-USDC",
"venue": "jupiter"
}CLI (stdin)
echo '{"action":"swap","amount_usd":500,"slippage_bps":40,"market":"SOL-USDC","venue":"jupiter"}' \
| atf bot protect --stdinDeterministic receipt fields
Every decision produces a receipt. The fields below are present in all outcomes, approved or rejected. They are deterministically reproducible: the same input and policy always produce the same content_hash.
{
"decision": "approved", // "approved" | "rejected"
"receipt_token": "rcpt_01J...", // stable receipt ID
"content_hash": "sha256:e3b0c4...", // deterministic fingerprint
"policy_id": "pol_01J...", // policy evaluated
"reason_codes": [], // array of rejection reason strings
"evaluated_at": "2026-03-04T21:00:00Z",
"ttl_seconds": 30
}| Field | Type | Description |
|---|---|---|
| content_hash | string | SHA-256 fingerprint of the canonical receipt payload. Identical for the same input and policy. |
| receipt_token | string | Unique ID for this receipt. Use this to retrieve or verify it later. |
| reason_codes | string[] | Empty on approval. On rejection, lists the rule(s) that blocked the transaction. |
| ttl_seconds | number | How long the decision remains valid. After expiry, re-submit the intent. |
Verify a receipt
Verification re-derives the content_hash from the receipt payload and confirms it matches the value returned at issuance. Any third party with the receipt data can run this check independently.
HTTP
POST /v1/receipts/verify
Content-Type: application/json
Authorization: Bearer <api_key>
{
"receipt_token": "rcpt_01J..."
}CLI
atf receipts verify rcpt_01J...Ready to configure limits for your bot?
See guardrails checklist