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_sourcethe 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.
- assessment: The Testimony Record Conformance Census: What Eight Agent Systems Record About What They Did | Zenodo
- the record format, as an IETF Internet-Draft:
draft-clifford-testimony-record-01 - The Testimony Record: An Interchange Format for What an Automated System Believed and Did - the adapter: GitHub - troybrandonc-bit/machine-testimony: Machine Testimony: an independent research programme on whether what an automated system says about its own reasoning and actions can be verified by someone who was not there. · GitHub
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.