`interrupt()` records that a human resumed, not which human

Something I ran into building an approval flow, and the workaround I settled
on. My actual question is at the bottom: I want to know whether there is an
idiom for this that I have missed.

interrupt() pauses the graph and Command(resume=value) resumes it. The
resume payload identifies which interrupt it answers and carries a value. As
far as I can find, there is no field on that boundary for who answered, and no
principal is modelled there, so any code holding the thread can resume it,
including the process that raised the pause. In langgraph/types.py the resume
value is an arbitrary caller-supplied object.

That is not a criticism. LangGraph is a graph and checkpointing library and it
never claimed to be an authorisation layer, and for most applications the
identity lives in the web layer that called invoke, which is the right place
for it.

It matters when somebody asks, months later, who approved. The record a plain
interrupt() flow leaves behind cannot distinguish a run where an engineer
read the arguments and decided from one where a script resumed everything
automatically. Both look like “resumed with True”.

I care about this because EU AI Act Article 14 obligations for Annex III
high-risk systems started applying on 2 August, and the harmonised standard
that says what satisfies them, prEN 18229-3, is still at public comment. So
deployers are currently being asked to evidence human oversight with no
finalised guidance on what that evidence looks like.

What I did

A small adapter that wraps invoke and resume and writes an append-only record
of what was proposed, how it was classified, and who approved it:

pip install testimony-langgraph
rec = Recorder(agent={"id": "support-agent", "kind": "agent"},
               risk={"issue_refund": "high"})     # your table, not the model's

rec.invoke(graph, {"ticket": 41}, config)          # runs to the interrupt

rec.approve(graph, config,                          # identity from YOUR auth
            approver={"id": "sam@example.com", "kind": "human"},
            identity_source="auth-session")

rec.write("record.jsonl")

The node names the action so it can be classified:

def gate(state):
    ok = interrupt({"action": "issue_refund", "args": {...}})
    return {"refunded": bool(ok)}

langgraph is the only dependency.

The part I think is actually interesting

It does not invent an approver, because the identity is not anywhere in
LangGraph for it to find. It refuses to write an approval unless you supply one
from your own authentication layer, and it makes the omission visible instead of
silent: resume the graph the ordinary way and the record still says exactly
what happened, it just does not claim a human was involved.

Three things it refuses outright, each a way to produce a plausible file that
lies:

  • an action missing from your risk table raises rather than defaulting, because
    a default risk class is a guess wearing a policy’s clothes
  • an identity_source the model could have written (request-body, model,
    prompt, plan, agent) is refused
  • an approver whose id equals the proposer’s is refused, because an agent’s own
    credential signing off its own action satisfies everything else and is worth
    nothing

Whether this is a real problem or just mine

I assessed eight agent memory and agent framework implementations against
twenty requirements, published with a DOI, every verdict citing a file and line
at a named commit. Six take or gate actions. Five of those are not my own
software. Against “does an approval identify a person or a named role holder”,
four were assessed absent and the fifth could not be established either way.

The assessment includes my own implementation, which is the one entry that
passes, and the published document says that entry carries no evidential
weight. Verdicts of absence say where I looked, so any of them can be
overturned by pointing at code rather than by arguing with me. LangGraph 1.2.11
is one of the four and the evidence is pinned to langgraph/types.py.

All of it is CC BY or MIT and none of it needs anything of mine to implement.

What I would like to know: is there an idiom for carrying approver identity
across the resume boundary that I have missed? If this is already solved a way
I have not found, that is genuinely the best outcome and I would rather be
told than keep maintaining a file that did not need to exist.

There is one idiom for the identity half, if you resume through LangGraph Server. With a custom auth handler, the authenticated user lands in config["configurable"]["langgraph_auth_user"], and the resume is its own run, sent by whoever resumed. The node that called interrupt() runs again from the top on resume, so reading that key right after interrupt() returns gives you the resumer from your auth layer, not from the payload. The docs don’t spell it out for resume runs, so I’d test it in your deployment before relying on it.

There’s also what they approved. Because the node starts over on resume, the action args are rebuilt from the state at that point. If anything calls update_state between the pause and the resume, what executes can differ from what the approver read, and the record still says approved. I’d put a hash of the proposed action in the interrupt payload, have the approval send that hash back, and refuse to execute on a mismatch.

If you’re not on LangGraph Server, there’s a plain-library version of the same idea: the resume is its own invoke, so put the approver from your auth layer in that call’s config, not in the resume value. I tested this on langgraph 1.2.18 with InMemorySaver and SqliteSaver:

  1. A configurable key passed on the resume call is visible in the node’s config after interrupt() returns, so the node can stamp the approver into state.
  2. config["metadata"] passed on the resume call is written into the metadata of the checkpoint created by that resume. The paused checkpoint before it has none. Non-dunder configurable keys (like approver_id below) also got copied into that checkpoint’s metadata.
  3. checkpointer.list(config, filter={"approved_by": ...}) finds it, and so does get_state_history(), so you get one audit entry per resume without a side file.
from typing import TypedDict
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import StateGraph, START, END
from langgraph.types import interrupt, Command

class S(TypedDict, total=False):
    approved: bool
    approved_by: str

def gate(state: S, config: RunnableConfig):
    ok = interrupt({"action": "issue_refund"})
    return {"approved": bool(ok), "approved_by": config["configurable"].get("approver_id")}

g = StateGraph(S); g.add_node("gate", gate); g.add_edge(START, "gate"); g.add_edge("gate", END)
cp = InMemorySaver(); graph = g.compile(checkpointer=cp)
t = {"configurable": {"thread_id": "t1"}}
graph.invoke({}, t)
graph.invoke(Command(resume=True),
    {"configurable": {"thread_id": "t1", "approver_id": "sam@example.com"},
     "metadata": {"approved_by": "sam@example.com", "identity_source": "auth-session"}})

for snap in graph.get_state_history(t):
    print(snap.metadata.get("step"), snap.metadata.get("approved_by"))
# 1 sam@example.com / 0 None / -1 None

The caveat is the one you already named: this is still caller-supplied, so it’s only as trustworthy as the server code that sets it from the session. It gives you no principal check. Combined with the action-hash idea above, though, it covers “who” and “what” in the checkpoint store you already have.

The distinction between the authenticated resume context and the resume payload makes sense.

I was thinking about separating approval evidence from the graph’s execution state. For example, the backend could pass the authenticated approver’s identity through the resume call’s config, while the approval event is recorded independently in an append-only audit log.

The action hash idea is also interesting. I’d consider binding it to the specific thread and interrupt ID to ensure an approval cannot be reused for a different pending action.

One question: would you consider checkpoint metadata sufficient for auditability, or would you maintain a separate audit record to protect against checkpoint updates, pruning, or deletion?

I’d keep a separate record. Checkpoints are execution state and LangGraph treats them that way: the built-in savers all have delete_thread, and LangGraph Server’s thread TTL can either delete the thread or run keep_latest, which prunes old checkpoints and keeps only the latest state. With keep_latest, once the thread passes its TTL, the checkpoint carrying approved_by in its metadata is gone if the graph has run on since.

So I’d have the backend write the approval to an append-only log when it accepts the resume, with the thread id, interrupt id, action hash and the approver from the session, and pass that record’s id in the resume call’s metadata. The checkpoint then points at the evidence instead of being it, and each can be checked against the other.

Binding the hash to the thread and interrupt id is right. On its own the hash would also match the same refund pending on another thread.

I agree with separating execution state from durable approval evidence.

One additional consideration is replay protection: how would you ensure that the same approval record cannot be reused to resume an interrupt more than once?

I’d also validate that the action hasn’t changed between the approval request and execution.

I think combining an append-only audit log, strict authorization checks, and idempotent resume handling makes Human-in-the-Loop workflows much more reliable in production.

I’d make the approval single use in the log, and check the graph before accepting it. Put a unique key on (thread id, interrupt id) and insert the approval before sending the resume, so a second request for the same interrupt fails on the insert instead of racing the first. Before inserting, read get_state() for the thread: on the latest state, interrupts only holds the ones still waiting for an answer, so if that id isn’t there the graph has already moved past it and the record gets refused.

The action check goes in the node: after interrupt() returns, recompute the hash from current state, compare it with the one in the approval record, and only then execute.

Idempotency is the other half. The node runs again from the top on resume, so anything before interrupt() runs twice, and if the process dies after the refund call but before the step is checkpointed, the retry runs the refund again. I’d keep side effects after the interrupt and pass the approval record id as the idempotency key to whatever moves the money (Stripe takes an Idempotency-Key header), so the same approval can’t pay twice.

Yeah, if the process raising the pause can also write the approval evidence, an auditor still has only that process’s word that a human approved it.

I’d have the approver sign (thread_id, interrupt_id, action_hash) with a private key only they hold, then pass that signed approval as the resume value. The graph code immediately after interrupt() returns should verify the signature against the approver’s public key and the pending action before allowing execution to continue. Calling resume directly still has to pass that check inside the graph.

The orchestrator can’t produce that signature itself, but you still don’t know if someone actually read the arguments. You still need to handle approver key management, and the oversight auditor would need to check that.

@Zealynx the approval record id as the idempotency key is the bit i like most here, i landed on almost the same thing for lost-ack retries, the key gets minted in the harness before the call so a retry after a dropped response can’t fire twice. also agree on keeping the log separate from checkpoints, in mine the agent process has no write handle to it at all and sqlite triggers reject UPDATE and DELETE.

what stood out to me is recomputing the action hash after interrupt() returns. that catches the args changing, but i kept hitting cases where the args were identical and the world had moved, like the order getting refunded through support before anyone hit resume. so i re-read the specific facts the action depends on right before it fires. the catch is that checking everything voids approvals constantly, so each action only declares the fields it cares about. i put it in a benchmark that scores catch rate and false-alarm rate separately: https://github.com/rayyanmaan/agent-guardrail

@Zealynx In the deployments you’ve seen, how long do approvals usually sit before resume? that’s what decides whether staleness is a real problem or an edge case. and @TroyClifford, does your census look at whether a system checks that the approved action still holds at execution time, or only who approved it? feels like the same evidence gap from the other side.

I don’t have a number for how long approvals sit, so I can’t settle that one. I’d size it by who else can write to the record. A refund that waits two minutes is already stale if support is working the same order, and the average wait won’t show you that.

Your re-read still leaves a small gap between the check and the write. Where the downstream supports it I’d send the version you read as a condition on the write, If-Match or a compare-and-set on the order row, so the check and the effect are one step. Where it doesn’t, the approval id stops a double fire but not a refund on an order that changed in that gap.

I’d also write the declared fields into the approval record, so an auditor can see what “still holds” covered for that action when it was approved.

@Zealynx this helped. the conditional write is actually what i already do, the effect runs as one atomic statement with the version i read as a condition, so if something changes between the recheck and the write it gets refused instead of slipping through. but you’re right that it only holds where the store gives you compare-and-set. where it doesn’t, the approval id keeps it from firing twice but won’t stop a real change in that gap, and i should be upfront about that limit in the writeup.

the part about sizing it by who else can write to the record, not by how long the approval sits, is the bit that shifted how i think about it. i’d been treating staleness as a timing problem, when the real question is whether anyone else can touch the fact at all. one other writer and any wait is unsafe. that’s nudging me toward tracking who or what can write a fact, not just its value, which is where i want to take this next.

and recording the declared fields in the approval record is a good call. right now i log what the recheck accepted but not the full set the action was approved under. keeping what was supposed to still hold, so someone can read it back later, is worth adding. thanks for this.

@TroyClifford does your record have a place for what was checked at approval, not just who approved? the set of facts an action was approved under feels like it belongs right next to the approver.