AVEL

io.github.Ensi81由 GitHub 帳號 Ensi81 發布v0.1.2更新於 Oct 24, 2026

Identity/reputation verification for agent-to-agent payments across x402, AP2, MPP, checkout.

概覽

AI 產生的概覽

讓助理在代理之間付款前核驗付款方與收款方代理的身分與信譽,而資金本身不經過此服務。

可以做什麼
此用戶端針對 AVEL 執行個體提供 verify、issue_challenge、verify_challenge 與 get_verdict。verify 對標準化交易文字做 EIP-191 簽章,回傳 APPROVED、DENIED,或在佣金未付清前保留裁決;issue_challenge 讓賣方簽署具約束力的條款,verify_challenge 讓買方在一次呼叫中接受。get_verdict 允許任一方讀取某筆交易的結果,而彙總信譽是公開且免驗證的 HTTP 端點。
適用情境
當某個代理即將向另一個代理付款或收款,並希望先做身分與信譽檢查時使用,包括可重用既有付款證明的 x402、AP2、MPP 或 checkout 流程。它不是支付通道,只回報是否可以安全繼續。若需要服務代管或移轉資金則不適合,因為金庫相關方法已停用。
執行需求
以 stdio 本機程序執行,透過 uvx 從 PyPI 套件 agent-interchange 啟動。需要能連線到 AVEL 執行個體的網路,由 AVEL_BASE_URL 設定(預設 AVEL_PRIVATE_KEY,即代理身分的 EVM 私鑰。不需要事先註冊。僅限桌面端,沒有網頁可執行版本。
安裝前請注意
此伺服器需要 AVEL_PRIVATE_KEY,也就是代理身分的 EVM 私鑰;它用來簽署每一次 verify、issue_challenge、verify_challenge 與 get_verdict 呼叫,且絕不會以工具參數形式暴露。首次通過驗證的使用會把該身分綁定到簽章位址(首次使用即信任),之後必須使用同一把金鑰。會收取被驗證金額 1% 的佣金,最低 0.50,且當呼叫方簽章有效時,即使結果為 DENIED 也需支付;在佣金未付清前,裁決結果會被保留。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 AVEL,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

agent-interchange

SDK Python per AVEL (Agent Verification Layer) — verifica identità/reputazione di chi paga e chi riceve, su qualunque metodo di pagamento, senza mai custodire denaro. Il server è closed-source; questo pacchetto è lo strato client, pensato per essere pubblico e riusabile (licenza MIT). Standalone — nessuna dipendenza dal codice del server, solo httpx, eth-account e l'URL di un'istanza raggiungibile (https://aisrail.fly.dev).

Install

bash
pip install -e .

Uso

python
from agent_interchange import InterchangeClient
client = InterchangeClient("https://aisrail.fly.dev")result = client.verify(    payer_address=agent_a_address,    payee_id="merchant-42",    amount=25.0,    currency="EUR",    private_key=agent_a_private_key,    fee_payment_method_id="pm_...",   # con cosa si paga LA VERIFICA)

Il pagamento fra i due agenti non passa da qui. Questa chiamata dice soltanto se è sicuro procedere; poi l'agente paga sul rail che già usa. Noi incassiamo solo la provvigione per il controllo eseguito (1% dell'importo verificato, minimo 0,50 su carta) — dovuta anche su un verdetto DENIED, se la firma di chi chiama è comunque valida: è il prezzo del controllo, non dell'esito.

Tre esiti possibili:

RispostaSignificato
verdict: "APPROVED"Controllo superato, provvigione incassata: si procede
verdict: "DENIED"Non procedere. Provvigione comunque dovuta se la firma di chi chiama è valida — gratuito solo quando non lo è (nessuno da addebitare con certezza)
verdict_withheld: trueVerifica eseguita ma provvigione non ancora incassata: il verdetto (APPROVED o DENIED) resta trattenuto finché non si paga

private_key è la chiave EVM dell'agente (mai la nostra). Il primo uso autenticato lega quell'identità all'indirizzo che firma (trust-on-first-use): ogni chiamata successiva deve firmare con la STESSA chiave. Nessuna registrazione preventiva.

verify() usa protocol="native". Se l'agente sta già pagando con x402, AP2 o MPP non serve una seconda firma: si manda la prova che ha già prodotto per il pagamento — un esempio per ciascun protocollo è in scripts/protocol_adapters_demo.py.

Verifica simmetrica di B

Se il venditore (B) dichiara un indirizzo (payee_address), deve anche provare di controllarlo — altrimenti il verdetto è negato. La firma va calcolata da B (o da chi negozia per suo conto) su build_counterparty_message(payer_address, payee_id, amount, currency, nonce) e passata come payee_signature:

python
from agent_interchange.client import build_counterparty_message
message = build_counterparty_message(payer_address, payee_id, amount, currency, nonce)payee_signature = "0x" + Account.sign_message(encode_defunct(text=message), private_key=b_private_key).signature.hex()
result = client.verify(    payer_address=a_address, payee_id="merchant-42", amount=25.0, currency="EUR",    private_key=a_private_key, nonce=nonce,    payee_address=b_address, payee_signature=payee_signature,)

Modello B-driven (protocollo challenge)

Più vicino a come funzionano davvero x402/MPP: è il venditore (B) a fissare prezzo e termini e a firmarli per primo, l'acquirente (A) li accetta firmando lo stesso testo.

python
# Lato B — nessuna chiamata di rete, va consegnato ad A fuori bandachallenge = client.issue_challenge(    payee_address=b_address, payee_id="merchant-42", amount=25.0, currency="EUR",    private_key=b_private_key, ttl_seconds=600,)
# Lato A — accetta il challenge e chiede il verdetto in un colpo soloresult = client.verify_challenge(    challenge, payer_address=a_address, private_key=a_private_key,    fee_payment_method_id="pm_...",   # o fee_method="x402" per pagare in stablecoin)

Il challenge è valido una sola volta per la transazione esatta che lo accetta: un ritentativo identico (necessario per completare il pagamento della commissione dopo un 402) resta ammesso, un riuso con termini diversi no.

Verdetto bidirezionale

Entrambe le parti possono leggere l'esito di una transazione specifica — non solo chi ha chiamato verify()/verify_challenge():

python
verdetto = client.get_verdict(    payee_address=b_address, nonce=nonce,    address=b_address, private_key=b_private_key,   # o quella di A)

Richiede una firma che provi di essere il pagante o il ricevente di quella transazione — a differenza dello storico aggregato (GET /ais/reputation/{address}, pubblico), il dettaglio di una singola transazione non lo è.

Caso marketplace

Quando payee_id/payee_address sono una vetrina e non chi fornisce davvero il prodotto/servizio, verify() accetta anche sub_merchant_address/sub_merchant_signature (stesso principio di B: la firma va calcolata su build_sub_merchant_message(payer_address, payee_id, amount, currency, nonce, sub_merchant_address)). Se dichiarato, la sua reputazione (sub_merchant_reputation nella risposta) entra nel verdetto tanto quanto quella di B.

Vedi example.py per una versione eseguibile del flusso base.

Metodi degli Agent Vaults — SPENTI

pay(), get_balance(), deposit() e withdraw() appartengono al modello precedente, in cui il servizio custodiva un saldo interno. Il server risponde ora 410 a quegli endpoint: non custodiamo più denaro, nemmeno per un istante. Il codice resta ed è riattivabile lato server con AGENT_VAULTS_ENABLED=true; la documentazione qui sotto è conservata come riferimento storico.

InterchangeClient

  • verify(payer_address, payee_id, amount, currency, private_key, nonce="", payee_address=None, payee_signature=None, sub_merchant_address=None, sub_merchant_signature=None, fee_payment_method_id=None) → dict. Il metodo da usare per il modello "A dichiara, B conferma". Firma EIP-191 sul testo canonico della transazione, chiede il verdetto e paga la provvigione. Un 402 non è un errore ma una risposta prevista ("verifica passata, ora paga"): viene restituito, non sollevato.

  • issue_challenge(payee_address, payee_id, amount, currency, private_key, ttl_seconds=600) → dict. Lato B (venditore), modello B-driven: emette e firma un challenge vincolante, nessuna chiamata di rete. Il risultato va consegnato ad A fuori banda.

  • verify_challenge(challenge, payer_address, private_key, fee_payment_method_id=None, fee_method=None) → dict. Lato A (acquirente): accetta il challenge di issue_challenge() e chiede il verdetto in un'unica chiamata.

  • get_verdict(payee_address, nonce, address, private_key) → dict. Verdetto bidirezionale: legge l'esito di una transazione specifica, utilizzabile da entrambe le parti coinvolte. Solleva InterchangeAPIError (403) se address non è né il pagante né il ricevente di quella transazione, (404) se non esiste alcun verdetto registrato per quel payee_address/nonce.

  • get_agent_reputation non è un metodo del client — è pubblico e senza autenticazione: GET {base_url}/ais/reputation/{address} con una semplice richiesta HTTP.

  • pay(payer_ref, payee_ref, amount, private_key, currency="USDC", task_id=None) (spento, 410) → PaymentResult. private_key signs an EIP-191 message binding this exact transaction (trust-on-first-use — see Usage above); mandatory since the Interchange added wallet authentication to /pay. Auto-derives agent_request_id from task_id + the call's own parameters (see client._derive_request_id) — pass your agent framework's own task/run id so a genuine retry (same task_id, same arguments) is safely idempotent, while a different payment under the same task_id never false-collides with it. Omitting task_id still works but loses the retry-safety property (a fresh random id is used, so a real retry would be treated as a brand new transaction).

    Raises:

    • InsufficientBalanceError — payer's balance can't cover amount + fee.
    • RequestConflictError — HTTP 409: the derived id was already used for different content (a possible replay/hijack of a captured payment proof by untrusted middleware — rejected, not executed) or was reserved but never completed (never retried automatically).
    • InterchangeAPIError — any other non-2xx response, or the Interchange being unreachable. 401 means private_key doesn't match the signature; 403 means payer_ref is already bound to a different address (not this key).

    A risk-score DENY (as opposed to an insufficient-balance one) is not raised — it comes back as a normal PaymentResult with .success == False; check .decision / .reasons for why.

  • get_balance(agent_ref, private_key) → dict[str, int], atomic units per currency, e.g. {"USDC": 500000}. private_key proves control of agent_ref (same trust-on-first-use binding as pay()); allowed with any key only if agent_ref was never used in pay()/ withdraw() yet.

  • withdraw(agent_ref, amount_usdc, payout_address, private_key, task_id=None) → dict. private_key is agent_ref's own key, proving it controls the balance being withdrawn — the Interchange's own treasury still signs and pays out on-chain, private_key here only authenticates the withdrawal request itself. Same task_id derivation and exception contract as pay() (InsufficientBalanceError on HTTP 402, RequestConflictError on 409, 401/403 same meaning as pay()'s); any other non-2xx (e.g. 403 for an unwhitelisted platform-treasury withdrawal) raises InterchangeAPIError.

  • await deposit(agent_ref, amount_usdc, private_key, task_id=None) → dict. Async (unlike the other three methods) and needs the deposit extra — pip install agent-interchange[deposit] — because it signs a real x402 payment with the depositing agent's own key. Calling it without the extra installed raises InterchangeAPIError (not an ImportError) with instructions. Base install (pip install -e .) never needs x402/eth-account unless you call this.

Verified live against a running Interchange (04 Sep 2026): a normal payment (fee correctly deducted from amount, not added on top); InsufficientBalanceError on an oversized pay()/withdraw(); an idempotent retry (same task_id + same arguments) returning the identical cached result with no second transfer/payout; the same task_id with different arguments executing as a distinct payment (no false conflict); a forged same-id-different-content request correctly rejected with RequestConflictError, simulating the replay/hijack scenario the Interchange's own P1 binding defends against (interchange/security.py in the main repo); a real on-chain withdraw() and deposit(), each with the resulting transaction confirmed on Base Sepolia; and deposit()'s clean-failure message when the deposit extra isn't installed (simulated by blocking the imports).

InterchangeTool — LangChain / CrewAI / AutoGen

python
from agent_interchange import InterchangeClient, InterchangeTool
client = InterchangeClient("http://localhost:8000")tool = InterchangeTool(client)
langchain_tools = tool.for_langchain()   # requires: pip install langchain-corecrewai_tools = tool.for_crewai()         # requires: pip install crewaiautogen_tools = tool.for_autogen()       # requires: pip install autogen-core

Only wraps pay/get_balance as agent-callable tools — deliberately not deposit/withdraw: those move real funds and deposit needs a raw private key, both a heavier judgment call than exposing to an LLM's tool-calling loop by default. Call them directly on client from your own code instead.

Lazy imports: constructing InterchangeTool and calling pay()/ get_balance() on it directly never requires any of the three frameworks — only for_langchain()/for_crewai()/for_autogen() do, and each fails cleanly (ModuleNotFoundError) if its package isn't installed. Verified live (construction, underlying _get_balance call, and the clean-failure path for all three factories); the tool-decorated output itself carries the same verification level as the main repo's framework_tools.py — see that file's docstring for how the underlying @tool/FunctionTool API shape was confirmed against each framework's real published source.

Not included here

The main repo's agent_tools.py / framework_tools.py (repo root) cover the same ground but aren't packaged/independently installable — prefer this SDK for anything outside the main repo's own dev environment.

來源:README.md,提交 a2f7c1c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分