עברית

xlex ID: the trust layer for AI agents

xlex ID consent API: a person approves an exact action with a device-bound key and you get a signed, single-use receipt. For AI agents, apps and businesses.

The model

  1. Request an approval for one exact action (type, title, amount, counterparty, details).
  2. The person approves on their phone with fingerprint or face (first time: a free xlex ID key in under a minute), or a standing mandate they signed covers it.
  3. xlex issues a receipt: a JWS signed with EdDSA, bound to the SHA-256 of the exact action statement, valid for a short execution window, single use.
  4. Right before acting, reserve it (redeem) with the exact action and an Idempotency-Key. A changed amount, item or destination, an expired window, a revoked or disputed approval: refused. A second reservation with another key: refused. A retry with the same key returns the current state, so a network failure never leads to a double execution.
  5. After acting, report the result (executed or failed). The execution receipt is labelled as the statement of the executor; another party (the merchant, the bank) can add an independent confirmation.

States: pending → approved → reserved → executed | failed, or declined, expired (approval or reservation not used in time), revoked (by the person, only before reservation).

1. Request

curl -X POST https://xlex.co.il/api/v1/consent \
  -H "Authorization: Bearer xlx_..." -H "content-type: application/json" \
  -d '{
    "holder": { "email": "dana@example.com", "name": "Dana Levi" },
    "action": { "type": "purchase", "title": "Order 2x HP 305A toner",
                "amount": 389.9, "currency": "ILS", "counterparty": "Office Depot" },
    "agent": "Procurement bot",
    "execute_within_minutes": 30,
    "external_ref": "PO-1042"
  }'

Response: status is pending with an approve_url (also e-mailed to the person), or approved at once with a receipt when a mandate covers the action.

2. Wait

Poll GET /api/v1/consent/{id} or subscribe to the webhooks consent.approved, consent.declined, consent.executed, consent.revoked. Embed the approval in your site with the button script:

<script src="https://xlex.co.il/sdk/consent.js" defer></script>
<button onclick="XlexConsent.open(approveUrl).then(r => console.log(r.status, r.receiptId))">
  Approve with xlex ID
</button>

3. Redeem, execute, report

POST /api/v1/consent/{id}/redeem   Idempotency-Key: 7f3c...   { "action": { ...the exact same action... } }
# 200 reserved (same key again: same state); 409 already_reserved | action_mismatch | revoked | disputed; 410 expired

POST /api/v1/consent/{id}/result   { "status": "succeeded", "reference": "ORD-77812", "amount": 389.9, "currency": "ILS" }
# returns an execution receipt (xlex-execution+jwt, evidence: executor_reported); same report again returns the same receipt

POST /api/v1/consent/confirm   { "receipt_id": "rc_...", "reference": "ORD-77812", "amount": 389.9 }
# called by ANOTHER organization (merchant / bank): evidence becomes counterparty_confirmed

Against hijacked agents

Actions that send data, messages or money (data.share, message, transfer, payment) must declare destinations. The approval page shows the exact signed statement and risk signals xlex computes itself: a destination the person never approved, a first request from you or from this agent, an unusual amount, links in the details. xlex cannot detect every prompt injection; it makes an unexpected action visible to the human before it can be approved. People can decline and block a requester.

Verify anywhere

Offline: verify the JWS with the keys at /.well-known/jwks.json (EdDSA, Ed25519). Online: POST /api/v1/consent/verify with { "receipt": "..." } returns validity and whether the receipt is still usable. Every receipt has a public page at /r/{receipt_id}. Discovery: /.well-known/xlex-trust.json.

AI assistants (MCP)

Connect https://xlex.co.il/mcp in Claude or ChatGPT. Tools: request_consent, get_consent, redeem_consent, report_consent_result, verify_consent_receipt. The assistant asks its own user, who approves on the phone.

What a receipt proves

That a person controlling the e-mail address, at the stated assurance level, approved the exact action statement with a device-bound key and user verification (or under a mandate they signed with such a key), at the stated time. It does not prove that the action was executed: that is the separate execution receipt, as reported by the executor. xlex is an independent verifier of consent, not a registered certification authority under the Israeli Electronic Signature Law, 2001.