What goes wrong when an agent works alone
- It doesn't know when to stop, or when a case needs a person.
- There's no time limit, retry or fallback when the model fails or is slow.
- Decisions go unrecorded, and it's hard to explain later why something was done.
- If execution crashes midway, the work already done is lost.
- No one is clearly accountable for the outcome.
None of this is a problem with the AI model. It's the lack of a process around it.
The pattern: the agent decides, the process guarantees
The split of responsibilities that works in real operations:
- The AI agent interprets, analyzes, classifies, summarizes, suggests or carries out the step's task.
- The process defines the expected input and output, the time limit, retries, the agent's limits of autonomy, when to ask for human review, the next step, and a record of everything.
The agent decides; the process guarantees.
Human-in-the-loop in practice
Human-in-the-loop doesn't mean reviewing everything. The most common patterns:
- Approval before acting: the agent prepares, a person approves the irreversible action.
- Threshold-based review: above a certain amount, risk or uncertainty level, the case goes to a person.
- Escalation by exception: the agent handles the routine case; anything unusual is handed off with full context.
- Correct and resume: if the agent got it wrong, your team corrects the case and the process continues from there, without starting over.
Guardrails the process applies to the agent
- Timeout: a maximum time for the agent's step.
- Retry: new attempts when the model or a tool fails.
- Limits: what the agent can decide on its own and what needs approval.
- Pause for human approval: the case waits, with its state saved, until someone decides.
- Audit trail: every step recorded, including what the agent did.
- Resumption: pick up from the exact point after a failure or correction.
Example: customer service with an AI agent
- A customer opens a request; the process records the case and its deadline.
- The AI agent classifies the request and queries your systems to answer it.
- If confidence is high and the topic is within limits, the agent replies and the case is closed.
- If the topic is sensitive, or the agent doesn't finish in time, the case goes to a human agent along with the history and the AI's summary.
- The human agent resolves it; the process records the outcome and measures the SLA.
How to do this in Kikwiflow
In Kikwiflow, you call an LLM or AI agent from any step of the process, and the process handles the rest: timeouts, retries, pauses for human approval and a full trail of every step in Monitor. Because the process model is a JSON file (.kikwi) kept separate from your code, AI agents can also read, generate and review processes.
See also what application orchestration is and the customer service with AI and people use case.
Frequently asked questions
What is human-in-the-loop?
It means a person takes part at defined points of a process where an AI agent works: approving an irreversible action, reviewing cases above a threshold, taking over exceptions, or fixing a case and resuming it. It doesn't mean reviewing everything the agent does.
How do you put AI agents into operations without losing control?
By placing the agent inside a process that defines what it can decide on its own, the maximum time for each step, retries, when to request human approval and what comes next, while recording everything the agent did.
What happens if the AI agent fails or takes too long?
The process applies the rules defined for that step: it retries, hands the case to a person with full context, or takes an alternative path. State is saved, so completed work isn't lost and the case continues from the exact point.
Can AI agents create or review processes in Kikwiflow?
Yes. Because the process model is a JSON file (.kikwi) kept separate from the code, AI agents can read, generate and review processes.