Human in the loop
Make an agent stop and ask for your approval before it runs a tool, in the kagent UI.
About this tutorial
Some agents only answer questions. Others call tools that change something, cost money, or read sensitive data. For those, you can put a person in the loop: the agent stops before it runs the tool, shows you what it wants to do, and continues only after you approve.
In this tutorial, you turn on approval for the weather tool of the personal assistant, and then approve a call in the chat. The weather tool is harmless, which makes it a safe one to practice on. For how a pause works, see Human in the loop.
Time: about 5 minutes.
Before you begin
- Complete Build an agent and Add an MCP server, so that the
personal-assistantagent has the weather tool.
Require approval for a tool
Follow the steps in the kagent UI, or apply the same resources as YAML from the command line.
Open the kagent UI
kagent dashboardThe command forwards the UI to http://localhost:8082 and opens it in your browser. Leave it running while you work.
Require approval for a tool

In the sidebar, click Agents. In the row of the
personal-assistantagent, click the edit icon.Under Tools from MCP servers, find the row of the
kagent/weatherserver, and select Require approval.Approval belongs to the row, not to one tool. It covers every tool that the row lists, or every tool on the server when the list is left on All tools.
Click Save agent, and wait until the agent returns to Ready.
Approve a tool call
Click the agent name to open its chat page, and start a New chat.
Ask something that needs the tool, such as
What is the weather in Toronto right now?The agent stops, and the chat shows that the agent is asking permission to run a tool, with the name of the tool. Click Approve to let the call run. The agent then finishes its answer.
To refuse instead, click Reject. You can type a reason, and then click Send rejection. The agent receives the reason and carries on without the tool.
Mix free tools and approved tools
One server can supply both kinds. Add the server twice: once with the tools that the agent can use freely, and once with the tools that need approval, with Require approval selected on the second row. Build a K8s SRE does this with the Kubernetes tools.
Agents on the codex and claude harnesses accept each server only once, so approval there covers the whole server.
Verify that the agent asks first
Check that the agent is ready after the change.
kubectl get agent personal-assistant -n kagentExample output:
NAME READY AGE personal-assistant True 2mCheck that the weather tool binding requires approval.
kubectl get agent personal-assistant -n kagent -o jsonpath='{.spec.template.inline.tools[0].mcp.requireApproval}'Example output:
trueIn a New chat, ask
What is the weather in Toronto right now?The agent stops before it calls the tool and waits for you to click Approve or Reject.
What you built
An agent that stops for your approval before it runs a tool. Along the way, you used these features:
| Feature | What you did | Read more |
|---|---|---|
| Tool approval | Set requireApproval on an MCP tool binding, then approved and rejected calls | Human in the loop |
| MCP tools | Bound the weather server’s tools to the agent | About tools |
Clean up
- To let the agent call the weather tool freely again, open its edit form, clear Require approval on the
kagent/weatherrow, and click Save agent. From the command line, apply the YAML again without therequireApprovalline.