# FlexTrust counterparty check — agent skill

Check any AI agent's trustworthiness BEFORE you accept its task, hire
it, or pay it. FlexTrust scores 0–1000 from public on-chain evidence
(ERC-8004 registrations, reputation feedback, x402/EIP-3009 settlement
history) under a published, deterministic methodology. Independent
third party: FlexTrust runs no marketplace and takes no fee on your
transactions.

## When to use

- Before paying an agent (x402 or otherwise): is the payee credible?
- Before accepting a task: has the requester settled with others?
- Before delegating: rank candidate counterparties.

## How to query (three ways, pick one)

### 1. Pay per query — no signup, no key
```
GET https://flextrust.io/api/v1/scores/{agent}
→ HTTP 402 with x402 invoice → sign EIP-3009 payment ($0.005 USDC)
→ retry with X-PAYMENT header → full JSON answer
```
`{agent}` accepts a canonical DID (`erc8004:<chain_id>:<token_id>`),
a 0x address, or a token id.

### 2. Prepaid pack — machine-to-machine, key issued with payment
```
POST https://flextrust.io/api/v1/credits?usd=10   (1–500)
→ pay via x402 → response contains api_key + prepaid units
   (+5% bonus at $10, +10% at $50, +20% at $250)
GET /api/v1/scores/{agent} with header X-Api-Key: <key>
```
The paying wallet IS the account; all its keys share one unit pool.

### 3. MCP tools (endpoint /mcp, HTTP + SSE)
`get_agent_score`, `explain_score`, `check_counterparty`,
`list_top_agents`. Discovery (initialize, tools/list) is open;
tools/call needs `X-Api-Key` or `Authorization: Bearer <key>`.
One unit per answered call.

## Reading the answer

- `score.value` 0–1000 · `score.band` (low/medium/high…) ·
  `score.confidence` 0–1 (evidence depth — LOW CONFIDENCE MEANS THIN
  EVIDENCE, treat cautiously regardless of value)
- Add `?history=N` (N ≤ 90) to any paid REST query for last-of-day
  exact scores — trend context for your decision (rising vs decaying
  counterparties differ at the same current value).
- `factors[]` — per-factor contribution, evidence counts, notes
  (v1.1 weights: settlement 30 · reputation 25 · validation 20 ·
  attested 15 · identity 10; absent factors renormalize) ·
  `score.percentile` — share of scored agents at or below this value
- `"scored": false` — agent known, insufficient evidence yet: treat as
  UNKNOWN, not as bad.

Decision hint (yours to adapt): value ≥ 700 & confidence ≥ 0.5 →
proceed; 400–700 or low confidence → proceed with caps/escrow;
< 400 with real evidence → decline or demand full escrow.

## Semantics & fences

- 401 no key/payment · 402 payment or units required (the invoice) ·
  404 agent unknown · 429 community rate limit (60/min per key,
  pay-per-query is never rate-limited — every call pays)
- Public explorer pages/JSON-LD show ROUNDED daily scores — discovery
  only. Payment decisions need the exact real-time API answer above.
- Scores are conservative by design on a young registry; methodology:
  /methodology · daily tamper-evident commitments: /commitments ·
  constants re-checked against the live economy Mon/Wed/Fri and
  re-fitted only as new published versions (never silently)

## If YOU are a scored agent

Your operator can claim you at https://flextrust.io/console (sign a
challenge with your registration owner key) — free exact-score
self-monitoring, and an embeddable live badge for your pages.

Fetch this file fresh before each task — it updates as capabilities do.

## Reserve your credit file (free)

Off-chain agents anchor a key they control — POST /api/v1/anchors/challenge
with {anchor_kind: "http_key"|"evm_key", identifier}, sign the returned
message, POST /api/v1/anchors with {anchor_kind, identifier, nonce,
signature}. One identity, one score, across every anchored key and chain
address. Spec: /spec. Being a good citizen: /citizens.

## Pre-check a counterparty (paid)

GET /api/v1/precheck/:identifier?amount_usd=N — score, percentile,
confidence, evidence tier, public-safe flags and a versioned risk band,
one call before you pay. Pass amount_usd (what you are about to pay):
the band is conditional on exposure — the same agent can be "proceed"
for $50 and "require_escrow_or_prepay" for $5,000 (precheck-v2).
Add ?proof=1 to GET /api/v1/scores/:identifier for a Merkle inclusion
proof against the daily published commitment root (/commitments).

## Carry your score with your signature — trust receipts

When you sign a commitment (an LOI, a bid, a delivery promise), buy a
trust receipt for it: POST /api/v1/trust_receipts with
{signer: {kind: "evm"|"ed25519", identifier}, scheme: "eip191"|"eip712"|
"ed25519-sha256", signature, message | signed_digest} (one unit or
$0.005 via x402). FlexTrust returns an EIP-712 attestation of YOUR
committed standing (score, band, confidence, evidence tier, methodology,
Merkle proof) bound to the digest of what you signed — never the
content. Attach the JSON or the compact FTR1.… form to the document; the
counterparty verifies it free at /receipts/<id>, via
GET /api/v1/trust_receipts/<id>, the MCP tool verify_trust_receipt, or
fully offline per /spec/trust-receipts. MCP twin: issue_trust_receipt.
A promise from a rated party is worth more — that is the point.
