Repository navigation
[Submission] Temporal order repair with per-order Tenuo warrants #148
Description
Project link
https://github.com/tenuo-ai/tenuo-demos/tree/main/temporal-order-repair
Language
Python
Short description (max 256 chars)
Josh Smith's multi-agent order-repair demo with per-order Tenuo warrants: every repair tool call is checked on the worker before it runs, so a poisoned order note can't redirect a repair, and big restocks wait for signed approvals.
Long Description
This takes Josh Smith's temporal-multi-agent-order-repair, where LLM agents detect, plan and repair broken orders, and adds per-order authorization to the repair tools.
The problem it shows: the planner reads customer notes, and customer notes are untrusted. The demo includes a script that poisons two of them. In a live run with gpt-4o, the planner did what the notes said: it planned to send an order's approval request to the customer who wrote the note, and to restock 5,000 badge sets.
What changes with Tenuo:
- Each repair tool runs as its own Activity on a separate worker. That worker runs Tenuo's Temporal plugin with
require_warrant=Trueand holds only public keys. - After the plan is approved, an issuer Activity signs a one-hour warrant per order, filled in from the order record, never from the plan. Payment requests can only go to that order's customer, approval requests only to the shop's approvals desk, and restocks are capped.
- Calls outside the warrant fail as non-retryable Activity failures that name the broken constraint, so you see them in the Web UI.
- Restocks over 100 units wait for approvals. Every approver named in the warrant has to sign that exact call. The signatures reach the Workflow as a
ToolCallDecisionSignal, and the tools worker verifies them before the Activity runs. - Every checked call gets a signed receipt you can verify offline with
tenuo receipt chain. - The Workflow change is small (
execute_repairand one Signal). Without Tenuo's key files the demo runs exactly as Josh wrote it.
| Planned repair | Temporal only | Temporal + Tenuo |
|---|---|---|
| Ask Harry to update his payment | Sent | Sent |
| Ask Ron to update his payment | Sent | Sent |
Send Hagrid's approval request to hagrid@hogwarts.edu |
Sent to Hagrid | Refused by the warrant |
| Order 5,000 badge sets for Hermione | Ordered | Held until both approvers sign |
The tests run all three workers in-process against a local dev server, including a replay check that the Tenuo path stays deterministic. Runs on Python 3.12 with poetry install and temporal server start-dev. MIT for the demo; Tenuo is Apache-2.0.
Author(s)
DJ, Tenuo (https://github.com/tenuo-ai), building on Josh Smith's temporal-multi-agent-order-repair
Activity