Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Build Your Own Receipt Gateway in 28 Lines of Python

Описание и применение

Создайте собственный шлюз квитанций за 28 строк кода Python, который генерирует криптографически защищённые доказательства выполнения инструментов, обеспечивая целостность выполнения.

Задача

Agents can claim tool execution without verifiable proof, making it hard to trust their outputs.

Результат

A lightweight, 28‑line Python implementation that mints verifiable receipts for every tool call, ensuring execution integrity without external services.

Рабочий процесс

  • 1. Wrap the tool dispatch in execute_with_receipt, passing tool name, arguments, and the tool function.
  • 2. The executor runs the tool and obtains the result.
  • 3. Immediately after execution, generate a receipt containing a UUID, tool name, SHA‑256 hashes of canonicalized arguments and result, and a timestamp.
  • 4. Store the receipt and result in an append‑only log (RECEIPT_LOG).
  • 5. Return the result and receipt ID to the agent.
  • 6. To verify, fetch the receipt by UUID and compare the SHA‑256 hash of the claimed result with the stored hash using verify_receipt.

Доказательства

The receipt has to be minted by the thing that runs the tool, not the thing that talks about running the tool.

Источник

Wrap your tool dispatch in execute_with_receipt, and every call your agent makes now carries independently checkable proof.

Источник

  • Дата записи: 2026-09-22T00:00:37.033Z