Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add resonatehq/resonate-skills --skill resonate-human-in-the-loop-pattern-pythongit clone --depth 1 https://github.com/resonatehq/resonate-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python)<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.02249 |
| Opus 5.5 | $0.00030 | $0.00900 |
| Sonnet 5.5 | $0.00015 | $0.00450 |
| Haiku 4.5 | $0.00007 | $0.00225 |
Grade A, and why
resonate-human-in-the-loop-pattern-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Resonate Human-in-the-Loop Pattern — Python
Overview
A human-in-the-loop workflow suspends on a durable promise that is resolved (or rejected) by something outside the Resonate worker set — a person clicking an Approve button, a webhook from a third-party system, an operator running a CLI command. The worker doesn't poll or sleep; it opens a ctx.promise() and awaits it, and Resonate wakes it when the promise settles.
When to use
- Approval gates in business workflows (expense approval, content moderation, deploy gate)
- Waiting on third-party callbacks (Stripe webhooks, DocuSign signature events)
- Operator-driven unblock steps (break-glass in incident runbooks)
- Any workflow step where the data or decision comes from outside the Resonate worker
Basic shape
from __future__ import annotations
import asyncio, os, time
from typing import TYPE_CHECKING
from resonate.resonate import Resonate
from resonate.types import Value
if TYPE_CHECKING:
from resonate.context import Context
r = Resonate(url=os.environ.get("RESONATE_URL", "http://localhost:8001"))
async def notify_reviewer(ctx: Context, order_id: str, amount: int, approval_id: str) -> str:
# Side effects live in leaves — this prints/notifies exactly once
print(f" order {order_id} (${amount}) needs review; promise id: {approval_id!r}")
return approval_id
async def ship_order(ctx: Context, order_id: str) -> str:
return f"shipped-{order_id}"
async def cancel_order(ctx: Context, order_id: str) -> str:
return f"canceled-{order_id}"
async def fulfill_order(ctx: Context, order_id: str, amount: int) -> str:
# Open the approval promise; its id is deterministic (derived from the workflow id)
approval = ctx.promise()
approval_id = await approval.id()
# Notify the reviewer via a leaf (side effects belong in leaves)
await ctx.run(notify_reviewer, order_id=order_id, amount=amount, approval_id=approval_id)
# Suspend here — the worker holds no state while waiting
# This can be seconds, hours, or days; no process needs to stay alive
decision_raw = await approval
if decision_raw.get("approve"):
return await ctx.run(ship_order, order_id=order_id)
return await ctx.run(cancel_order, order_id=order_id)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 240 lines · 74 tokens per session scan A 8c40daa8c835
resonate-human-in-the-loop-pattern-python is a skill published in the GitHub repository resonatehq/resonate-skills (7 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 74 tokens to every session and 2,249 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
create-pubsub-python
Creates a Dapr pub/sub app in Python with FastAPI (publisher, subscriber or both) and declarative, programmatic or streaming subscriptions. Use for "create a pub/sub app in Python" or "build a FastAPI publisher and subscriber with Dapr". For an existing app use add-pubsub-python.
create-workflow-python
Creates a Dapr workflow app in Python, run locally with dapr run. Use for "create a workflow in Python" or "build a workflow app in Python". For Diagrid Catalyst use the catalyst-ai plugin.
add-pubsub-python
Adds Dapr pub/sub to an existing Python FastAPI app. Keeps its subscription type, shows a plan for approval, then makes targeted edits and checks imports after each. Use for "add pub/sub to my FastAPI app" or "make this Python service subscribe to a Dapr topic". For a new app use create-pubsub-python.
check-prereq-agent-python
Checks prerequisites for building durable AI agents in Python with the Dapr Agents SDK or a Diagrid framework wrapper. Use for "check prerequisites for Python agents" or "verify Python agent environment".
check-prereq-python
Checks prerequisites for building Dapr Workflow apps in Python. Use for "check prerequisites for Python" or "verify Python environment".
fastapi-pro
Production FastAPI patterns — async endpoints, SQLAlchemy 2.0 async, Pydantic V2, dependency injection, JWT auth, testing. Use for Python 3.11+ FastAPI backends. NOT for Django (→ django-patterns) or Node.js (→ backend-patterns).