0Pricing
AI Agents with LangChain & Autonomous Workflows · Lekcja

Zatwierdzanie przez człowieka w pętli

Dodawaj bezpieczne punkty kontrolne do autonomicznych workflowów, w których człowiek sprawdza lub zatwierdza ryzykowne działania przed kontynuowaniem pracy przez agenta, równoważąc automatyzację z kontrolą.

Zatwierdzanie przez człowieka w pętli to bezpłatna lekcja AI Agents with LangChain & Autonomous Workflows na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej AI Agents with LangChain & Autonomous Workflows, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs AI Agents with LangChain & Autonomous Workflows zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

Why Pause for Humans

Full autonomy is risky for high-stakes actions: sending money, deleting records, emailing customers. A mistake can be costly and irreversible.

Human-in-the-loop (HITL) inserts an approval step so a person confirms before the agent acts.

Where to Add Checkpoints

You do not need approval everywhere — only at sensitive points:

  • Before destructive or irreversible operations
  • Before external side effects (payments, emails)
  • When the agent's confidence is low

Read-only steps can stay fully automatic.

The Interrupt Pattern

In LangGraph you mark nodes where the graph should pause. Execution stops, state is saved, and control returns to your application to await a decision.

graph = builder.compile(
    checkpointer=memory,
    interrupt_before=['execute_payment']
)

Persisting State to Resume

To pause and resume later, the workflow needs a checkpointer that saves state under a thread id. The human might approve minutes or hours later.

config = {'configurable': {'thread_id': 'order-42'}}
result = graph.invoke(initial_state, config)

Surfacing the Pending Action

When paused, inspect the saved state to show the human exactly what the agent wants to do — the tool, the arguments, and the reason.

state = graph.get_state(config)
print(state.next)
print(state.values['proposed_action'])

Approve and Continue

If the human approves, resume the graph by invoking again with the same thread id. It picks up right where it paused.

graph.invoke(None, config)  # resume

Reject or Edit

Approval is not the only outcome. A human can reject the action or edit the agent's proposed arguments before continuing — for example fixing a wrong recipient.

graph.update_state(
    config,
    {'proposed_action': edited_action}
)
graph.invoke(None, config)

Asynchronous Approvals

In production the human is not at a console. The pause sends a notification (Slack, email, a dashboard task); the resume happens when they click approve. The thread id ties the request to the right paused run.

Timeouts and Defaults

Decide what happens if no one responds. Options:

  • Auto-reject after a timeout (safe default)
  • Escalate to another approver
  • Hold indefinitely for critical actions

Auditability

Log every approval decision: who approved, when, and what was executed. This audit trail is essential for compliance and for debugging agent behavior later.

Balancing Automation

Too many approvals defeat the purpose of automation; too few add risk. Start cautious, then remove checkpoints as you gain confidence in the agent for specific action types.

Quick Check

Test your HITL knowledge.

Recap

You learned to add human oversight to autonomous workflows:

  • Insert approval checkpoints at risky steps only
  • Use interrupt_before plus a checkpointer to pause
  • Surface the proposed action, then approve, reject, or edit
  • Handle async approvals, timeouts, and audit logging

Human-in-the-loop makes autonomy safe for high-stakes work.

Często zadawane pytania

Czy lekcja „Zatwierdzanie przez człowieka w pętli” jest bezpłatna?

Tak — pełny tekst „Zatwierdzanie przez człowieka w pętli” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu AI Agents with LangChain & Autonomous Workflows, przejdź na CoddyKit PRO. Kurs AI Agents with LangChain & Autonomous Workflows zawiera 4 lekcji w sumie.

Co nauczysz się w „Zatwierdzanie przez człowieka w pętli”?

Dodawaj bezpieczne punkty kontrolne do autonomicznych workflowów, w których człowiek sprawdza lub zatwierdza ryzykowne działania przed kontynuowaniem pracy przez agenta, równoważąc automatyzację z ko… Ćwiczysz AI Agents with LangChain & Autonomous Workflows z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć AI Agents with LangChain & Autonomous Workflows?

Nie wymagamy żadnego doświadczenia. AI Agents with LangChain & Autonomous Workflows w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.

Ile czasu zajmuje lekcja „Zatwierdzanie przez człowieka w pętli”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji AI Agents with LangChain & Autonomous Workflows?

Tak. Każda lekcja AI Agents with LangChain & Autonomous Workflows zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. Projektowanie złożonych przepływów pracy
  2. Asynchroniczne wykonywanie zadań przez agentów
  3. Obsługa błędów i odporność
  4. Zatwierdzanie przez człowieka w pętli
← Powrót do AI Agents with LangChain & Autonomous Workflows