camelRun by camelAI
Human in the
loop
AI agents
camelRun by camelAI is a hosted runtime for AI agents that hold a risky tool call until an authorized person approves it, sleep at $0 while they wait, and carry on from the same step when the answer arrives.
Delete the staging database
Allow db__drop to run?
{"database":"staging"}Done. The staging database is gone.
input_resolved · approved · actor alice
→ db__drop({"database":"staging"})
Done. The staging database is gone.
Four kinds of input
How AI agents ask a person
Approval gates stop consequential tool calls before they run. An agent can also ask a direct question with ask_human, or surface MCP form and URL elicitation steps from connected servers. Every pause parks the run the same way.
- 01Approval
Allow db__drop to run?
{ "database": "staging" }ApproveDenyApprove a tool call
Set
requiresApprovalon a custom tool, or match tool names and prefixes inapprovalRequiredsuch asdb__*orbash. The reviewer sees the exact call before it runs.approvalRequired: ["db__drop"]
- 02QuestionSnapshot
Keep a snapshot of staging before it goes?
- Keep one
- No snapshot
SubmitAsk with ask_human
Enable the
humanbuilt-in so the model can callask_humanto pause for clarification, choices, or free-text confirmation."builtins": ["human"] · ask_human
- 03MCP form
Where should the last backup go?
bucketops-archivelabelstaging-finalSubmitSkipCollect fields for an MCP tool
A remote MCP server can send an
elicitation/createform prompt mid-call. camelRun parks the run and hands the submitted fields back to the server.MCP elicitation/create · mode: "form"
- 04MCP URL
Connect the cloud account to finish
Open https://accounts.example.comDoneCancelFinish a step on an https page
A remote MCP server can send a URL
elicitation/createstep to an https page so the person can connect an account or sign off before the call continues.MCP elicitation/create · mode: "url"
Approvals in code
Add a human approval step to your AI agent
When a gated tool runs, camelRun returns status input_required with the pending input ID and releases the agent's concurrency slot. Resolve it over REST now or days later, from any server, and the run resumes from that exact call.
- Custom tool
requiresApproval: truepauses before every call to that tool.- Patterns
approvalRequiredaccepts tool names or wildcard prefixes likedb__*orbash.- MCP prompts
- Remote MCP servers can request form or URL elicitation mid-call.
const BASE = "https://run.camelai.com/v2/agents/ops";
const headers = {
Authorization: `Bearer ${process.env.CAMELRUN_API_KEY}`,
"Content-Type": "application/json",
};
// 1. Configure the agent and gate destructive tools.
await fetch(BASE, {
method: "PUT",
headers,
body: JSON.stringify({
model: "openrouter/openai/gpt-6-luna",
instructions: "You manage staging environments with your tools.",
mcpServers: [{ name: "db", url: "https://ops.example.com/mcp", auth: { type: "runtime" } }],
approvalRequired: ["db__drop"], // waits for a human before running
builtins: ["human"],
}),
});
// 2. Start a run on behalf of an authenticated app user.
let run = await fetch(`${BASE}/runs`, {
method: "POST",
headers,
body: JSON.stringify({
prompt: "Delete the staging database",
actor: "alice",
wait: true,
}),
}).then((r) => r.json());
// 3. After your app verifies who is allowed to approve, resolve the input.
while (run.status === "input_required") {
const input = run.inputs[0];
run = await fetch(`${BASE}/inputs/${input.id}`, {
method: "POST",
headers,
body: JSON.stringify({ approved: true, actor: "alice", wait: true }),
}).then((r) => r.json());
}
console.log(run.text);export CAMELRUN_API_KEY=cr_live_...
curl -s -X POST https://run.camelai.com/v2/agents/ops/inputs/inp_h9a2k4x1 \
-H "Authorization: Bearer $CAMELRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"approved": true, "actor": "alice", "wait": true}'{"id":"run_7c9a2e1f","status":"completed","text":"Done. The staging database is gone."}Answer anywhere
Answer AI agent approvals in your app, in Slack or from your server
The pending input lives in camelRun's durable state, not in the process that started the run. Route the decision through whichever interface your team uses and post the verdict back over REST.
- Your app UI
alice
Delete the staging database
Staging has no traffic this week. I'll drop it once you say so.
Allow db__drop to run?
{ "database": "staging" }ApproveDenyYour app UIWatch the agent's SSE event stream for
input_required, show Approve and Deny in your own interface, and submit through your backend. - Slack · thread
Thread
ops
alice5:58 PM@ops Delete the staging database
opsApp5:58 PMStaging has no traffic this week. I'll drop it once you say so.
Approve db__drop with {"database":"staging"}?
Posted by your ops bot · reply approve or deny.
alice9:12 AMapprove
opsApp9:12 AMDone. The staging database is gone.
Slack via your appWhen
run.input_requiredfires, your bot posts the pending call into Slack, checks who replied, and sends the decision back to camelRun. - Webhook · RESTTo your server
POST https://example.com/hooks/agents
{"id": "evt_…", "type": "run.input_required", "createdAt": 1790000000000, "data": {"agentId": "agt_…", "agentKey": "ops", "runId": "run_…", "inputId": "inp_h9a2k4x1", "kind": "approval", "toolName": "db__drop"}}Your answerPOST /v2/agents/ops/inputs/inp_h9a2k4x1
{"approved": true, "actor": "alice"}The turn resumes.
Your serverA signed
run.input_requiredwebhook alerts your backend with the input ID. Check who is authorized, then resolve it withPOST /v2/agents/:key/inputs/:inputId.
Human in the loop authorization
Control who can approve your AI agent's actions
Your application owns responder authorization. Check the user's identity and permissions in your backend before resolving the input with your tenant key.
Runs as approved
An approved call runs with the exact tool name and arguments that were parked.
Declined means never
A declined call never runs. Include an optional
messageto tell the model why.Signed on MCP calls
With runtime-auth MCP, the Ed25519 JWT includes the
approvalclaim alongsidesubandact.
- alice (via your backend)Verified by your app, submitted with tenant keyCan answer
- ops-lead (via your backend)Allowed by your app's own approval policyCan answer
- agt_tok_… with actorAgent tokens cannot claim actor or answer signed MCP inputs403
- The modelCannot resolve its own pending inputsCan't answer
FAQ
Questions about human in the loop AI agents
- 01
What are human-in-the-loop agents?
AI agents that pause before acting on something consequential, like deleting data or changing production. On camelRun the run stops in input_required, waits for a person's decision, and resumes from that exact tool call once resolved.
- 02
How does approval authorization work on camelRun?
Your application controls who is allowed to approve. Your backend verifies the logged-in responder and posts { approved, actor } to POST /v2/agents/:key/inputs/:inputId using your tenant API key. Scoped browser tokens cannot forge an actor or answer signed MCP prompts, and the model itself has no way to answer.
- 03
What input modes does camelRun v2 support?
Four: tool approvals via requiresApproval or approvalRequired patterns (including wildcards like db__*), open or multiple-choice questions via the ask_human built-in, plus MCP form and URL elicitation steps requested by connected remote MCP servers.
- 04
How long can an AI agent wait for a person on camelRun?
Up to two weeks by default before the parked input expires cleanly and reports the timeout back to the model. While parked, the agent releases its concurrency slot and holds its checkpoint across a deploy or a crash until an answer arrives.
- 05
Do I pay while my agent waits for approval?
No. Idle, sleeping, and waiting agents cost $0, and camelFS workspace and history storage is $0 right now. Active agent time is $0.05 per active agent-hour, active Linux container execution for bash is $0.00005/sec ($0.18/hr) with free pre-warming, and model tokens are $0 from camelRun on your own keys or pass-through on direct providers.
- 06
Can people approve agent actions from Slack?
Yes, by wiring your app to the run.input_required webhook. When an approval pauses a run, your service posts the pending tool call into Slack, checks that the person clicking or replying is authorized in your app, and submits { approved: true } to POST /v2/agents/:key/inputs/:inputId.
- 07
What if someone sends a new message instead of answering?
By default, a new run from the same actor (or with no actor) supersedes the parked input and starts fresh. A run from a different actor, or a request with supersedeInputs: false, leaves the waiting approval untouched.
More on human in the loop AI agents
- DocsHuman input: approvals, ask_human and MCP prompts
- DocscamelRun concepts: agents, runs and waking later
- OverviewcamelRun, the hosted runtime for AI agents
- camelRunSlack AI agent
- camelRunDurable AI agents
- camelRunBackground AI agents
- camelRunTelegram AI bot
- camelRunMulti-agent orchestration
- camelRunGitHub AI agent
- GuideBuilding durable AI agents that wait days for a person
Put a person in the loop today
Get an API key, add a tool to approvalRequired, and hold consequential actions until your app approves them. The human input guide has the rest.
claude mcp add --transport http camelrun https://run.camelai.com/mcp
Adds camelRun's hosted MCP server to Claude Code (also works with Codex and ChatGPT). Signing in creates your account automatically.