Skip to content

[Submission] Temporal order repair with per-order Tenuo warrants #149

Open

Description

@d8joseph

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=True and 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 ToolCallDecision Signal, 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_repair and 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

  1. github-actions commented on Oct 15, 2026

    @github-actions

    ZiggyBot — automated pre-evaluation


    Criterion Assessment
    Useful to Temporal users ✅ Yes — Demonstrates per-call authorization for LLM-driven tool execution modeled as Activities, with signed human approvals delivered via Signals.
    Benefits clearly explained ✅ Yes — The submission and README describe the prompt-injection scenario, the warrant mechanism, and the before/after outcome in a comparison table.
    OSI Approved License ✅ Yes — Repository is MIT (demo), with Tenuo stated as Apache-2.0; both are OSI-approved.
    README with working instructions ⚠️ Unclear — The top-level README lists demos but contains no setup or run instructions; the submission references poetry install and temporal server start-dev and a per-demo README, neither of which is included in the fetched data.

    Overall: Needs review ⚠️

    Notes:

    • The submission is one demo within a multi-demo monorepo. The fetched top-level README documents the demo catalog but not the setup, run, or test steps for the temporal-order-repair/ subdirectory. Confirm a per-demo README with the stated poetry install / temporal server start-dev instructions exists.
    • The core workflow (RepairAgentWorkflow) is forked from Josh Smith's temporal-multi-agent-order-repair. The submission states the Temporal-side change is limited to execute_repair and one Signal handler; the attribution and MIT licensing of the upstream should be verified for compatibility.
    • Authorization is enforced via a Temporal interceptor (TenuoActivityInboundInterceptor) that verifies warrants before the Activity body runs. The fetched source for temporal-order-repair/workflows.py is truncated and does not show the Signal handler or execute_repair logic, so the described Signal-driven approval flow could not be directly confirmed.
    • Warrant arguments are stated to be derived from the order record rather than the LLM plan, which is the mechanism that blocks the injection. This is a design claim that depends on implementation details not visible in the truncated source.
    • A replay-based determinism test for the Tenuo path is claimed but not visible in the fetched files.
    • Third-party dependency (Tenuo) with a cloud/early-access offering; the demo's functionality without Tenuo key files is stated to fall back to the upstream behavior.

    Suggested questions for submitter:

    • Does the temporal-order-repair/ subdirectory contain its own README with the poetry install and temporal server start-dev steps, and can you link it directly?
    • Can you confirm the upstream temporal-multi-agent-order-repair license and that redistribution under MIT is compatible?
    • Where is the replay/determinism test located, and does it run against the local dev server as part of the in-process test suite?
    • Does the demo require network access or credentials for the live gpt-4o run, and is there a cassette/offline mode for the LLM calls?

    Notable Temporal pattern:

    Per-tool authorization enforced inside an Activity inbound interceptor, combined with human approvals delivered as Signals and verified in the Workflow before the gated Activity is dispatched. This is representative because it ties warrant verification to Activity execution boundaries and uses Signals for cryptographically signed human-in-the-loop approval, rather than enforcing authorization only at the Workflow entry point.
    View in source ↗


    Automated AI pre-screen by ZiggyBot. Final decisions are made by the community team.

    Reviewer: Check the box below to generate a Contentful-ready long description for this submission.

    • Generate long description if needed
  2. d8joseph commented on Oct 15, 2026

    @d8joseph
    Author

    Thanks for the review. Answers to the questions:

    • Setup and run steps: the demo's README is temporal-order-repair/README.md. The top-level README now has the same steps under Running a demo.
    • Upstream license: Josh Smith's demo is MIT. His LICENSE is kept with his copyright notice, and our additions in that folder use the same license.
    • Replay test: test_replay_takes_the_recorded_path_whatever_the_worker_config in tests/test_tenuo_workflow.py. It's part of the same suite, which runs the Workflow with all three workers in one process against a local dev server.
    • LLM access: only the live run calls a model, and it needs an LLM key. The tests use a plan recorded from a real planner run with the poisoned notes, so they need no key and make no model calls.

    Two pointers the pre-screen couldn't see in the truncated source:

    • The Signal handler is ToolCallDecision. The Workflow records the decision; the signatures are checked on the repair-tools worker before the Activity runs.
    • The warrant is built from the order record in issue_order_warrant. The "notable pattern" link points at a different demo in the repo (temporal-incident-response); this submission is temporal-order-repair/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code exchange submissionCode and/or content about Temporal!triageIssues that Temporal folk need to look atziggy reviewedPre-screened by ZiggyBot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions