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 agentmods add agents/langchain-ai/langgraphjs/human-in-the-loopgit clone --depth 1 https://github.com/langchain-ai/langgraphjsWrote 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/agents/langchain-ai/langgraphjs/human-in-the-loop)<a href="https://agentmods.dev/agents/langchain-ai/langgraphjs/human-in-the-loop"><img src="https://agentmods.dev/badge/agents/langchain-ai/langgraphjs/human-in-the-loop.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.01186 |
| Opus 5 | $0.00000 | $0.00593 |
| Sonnet 5 | $0.00000 | $0.00237 |
| Haiku 4.5 | $0.00000 | $0.00119 |
Grade A, and why
human-in-the-loop 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 4d 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 — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Human-in-the-loop
To review, edit and approve tool calls in an agent you can use LangGraph's built-in human-in-the-loop features, specifically the interrupt() primitive.
LangGraph allows you to pause execution indefinitely — for minutes, hours, or even days—until human input is received.
This is possible because the agent state is checkpointed into a database, which allows the system to persist execution context and later resume the workflow, continuing from where it left off.
For a deeper dive into the human-in-the-loop concept, see the concept guide.
Review tool calls
To add a human approval step to a tool:
- Use
interrupt()in the tool to pause execution. - Resume with a
Command({ resume: ... })to continue based on human input.
import { MemorySaver } from "@langchain/langgraph-checkpoint";
import { interrupt } from "@langchain/langgraph";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { initChatModel } from "langchain/chat_models/universal";
import { tool } from "@langchain/core/tools";
import { z } from "zod";
// An example of a sensitive tool that requires human review / approval
const bookHotel = tool(
async (input: { hotelName: string; }) => {
let hotelName = input.hotelName;
// highlight-next-line
const response = interrupt( // (1)!
`Trying to call \`book_hotel\` with args {'hotel_name': ${hotelName}}. ` +
`Please approve or suggest edits.`
)
if (response.type === "accept") {
// proceed to execute the tool logic
} else if (response.type === "edit") {
hotelName = response.args["hotel_name"]
} else {
throw new Error(`Unknown response type: ${response.type}`)
}
return `Successfully booked a stay at ${hotelName}.`;
},
{
name: "bookHotel",
schema: z.object({
hotelName: z.string().describe("Hotel to book"),
}),
description: "Book a hotel.",
}
);
// highlight-next-line
const checkpointer = new MemorySaver(); // (2)!
const llm = await initChatModel("anthropic:claude-3-7-sonnet-latest");
const agent = createReactAgent({
llm,
tools: [bookHotel],
// highlight-next-line
checkpointer // (3)!
});
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.
- 4d ago First seen · 119 lines · 0 tokens per session scan A 862d0a37dbeb
human-in-the-loop is an agent published in the GitHub repository langchain-ai/langgraphjs (3,249 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,186 tokens. 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-30.
Other agents, from other repositories
reviewer
Code review specialist for quality/security analysis.
reviewer-test-coverage
Review code changes for missing tests, untested edge cases, and test quality.
reviewer-holistic
Review code changes for overall design concerns, side effects, integration risks, and user impact.
reviewer-code-quality
Review code changes for bugs, logic errors, edge cases, and code smells.
reviewer-performance
Review code changes for performance inefficiencies and resource issues.
Company Researcher
Research a company from its URL or description to infer Stripe Connect integration shape.