Grok Bot
Connect a Grok Bot agent to the HITLy inbox over MCP - approvals, typed questions, and wake-up webhooks through registered callbacks.
Grok Bot agents can ask a human before they act. HITLy does not run inside Grok — the agent calls the HITLy MCP connector, the ask lands in the HITLy inbox, and the agent carries on once a person has decided. Nothing about how you build or host the bot changes: it keeps its own runtime, tools and memory, and HITLy is only the human gate in front of the actions you do not want it taking unattended.
What you get
- Approvals in your inbox. The agent calls
request_approval; the card shows the question, the action and its arguments, and the risk. A person approves, rejects or ignores it. - Typed answers, not chat. The agent calls
ask_userwith an answer schema (text,single,multi,number) and gets that exact type back — no free-text interpretation. - Wake-up webhooks. Register the bot's callback URL once under Project → Callbacks and HITLy POSTs the outcome the moment a human decides, authenticated from the registration. No secret in the prompt, no polling loop.
- One reviewer UI. The same inbox card you use for Mastra, Hermes or HTTP callers.
- No decide tool. The bot can request, read and cancel. It can never approve its own action — decisions come only from a signed-in human.
Before you start
- A HITLy account and project. On HITLy Cloud, create an account at cloud.hitly.net. Self-hosting is open source.
- A project on the HTTP plugin. The connector's asks are ordinary HTTP-plugin project requests, so the project has to run that plugin — a project on Mastra, Hermes or n8n answers
Plugin mismatch. If you will connect with a project API key instead of signing in, create or copy it under Project settings → Config; keys start withhitly_. - A Grok Bot agent you can configure — one where you can add a custom MCP connector and set standing instructions.
- A public https callback endpoint (recommended). Anywhere the platform exposes a webhook routine the bot can be woken on. Private and loopback addresses are refused, and redirects are not followed.
Connect HITLy to Grok Bot
There are two ways to give the connector credentials. Pick one.
Sign in to HITLy Cloud (OAuth)
On HITLy Cloud the connector speaks OAuth, so there is no key to paste:
- In Grok Bot, add a custom MCP connector pointing at
https://mcp.hitly.net/mcpand name it HITLy - the icon comes from the server itself, but the name is yours to set, and HITLy is what your team should see in the connector list. It signs in as client IDgrok-botand asks for the one scope the endpoint serves,hitly.mcp. Grok Bot is pre-registered with HITLy Cloud, so there is nothing to register and no client secret to paste; the connector discovers the sign-in endpoints on its own - see OAuth sign-in. - The connector opens HITLy sign-in. Sign in with the account that administers the project the bot will work in.
- On the consent screen, pick the project. Consent is an admin act: you only see projects you administer, and archived ones never appear. Keep a bot to the single project it needs.



Connections you have granted are listed under Settings → Integrations, where you can revoke one. Revoking stops the bot's tool calls; open requests stay readable and decidable in the inbox.
Pass a project API key in the header
Use this for a self-hosted HITLy MCP server, or wherever the connector lets you set headers and you would rather not sign in. Add a custom MCP connector with the URL and the key in the Authorization header (name the connector HITLy as well):
{
"mcpServers": {
"hitly": {
"url": "https://mcp.hitly.net/mcp",
"headers": { "Authorization": "Bearer <your-project-api-key>" }
}
}
}Substitute your own MCP host when you self-host, and use the project API key you copied in Project settings → Config. The key is a requester credential for that project: it can create, read and cancel asks, and it can never decide one. Treat it as a secret — anyone holding it can ask your reviewers on that project's behalf. Rotate it from the project settings if it leaks.
Verify the connection
Give the bot a prompt that forces an ask, and watch both sides:
- Ask the bot:
Use HITLy to ask me to approve saving a draft reply to order 1842. - The bot calls
request_approvaland getsrequestIdwithstate: "pending"straight back — it does not block. - Open the HITLy inbox. The card is there: question, action name and arguments, the risk, and the deadline.
- Approve it. If the bot passed a
callback_url, it is woken; otherwise it finds the answer by pollingget_decision. - The bot repeats the outcome — the approved action, or the reviewer's amended arguments.

If the card never appears, work through Troubleshooting before touching your prompt.
The tools the bot sees
The connector exposes exactly five tools. MCP server → Tools has the full schemas; what matters when you are driving Grok Bot is this:

| Tool | What the bot uses it for |
|---|---|
request_approval | "May I do this?" — a human approves, rejects or ignores the action and its arguments. |
ask_user | "What do you want here?" — one question, one typed answer (text, single, multi, number). |
get_decision | Reads the outcome. The only source of truth: pending, expired and cancelled are never approval. |
list_pending | "What is still waiting on a human?" — useful on waking, or to sweep up before ending a run. |
cancel | Withdraws an ask that no longer matters, so the reviewer is not bothered with it. |
Notes worth putting in front of the model:
request_approvalneedsquestion(one sentence, at most 160 characters, ending with?),action({ name, args }) and anidempotencyKey. Addrisk,context(Markdown for the reviewer),reasonRequired, and up to 20 httpslinks.linkswithmustOpengate Approve/Reject until the reviewer has opened them — HITLy never fetches them itself.ask_useranswers exactly one question per request. A multi-field form is refused:simple_formcomes back as an error telling the bot to send oneask_userper field.get_decisionreturnsstatusplus either the decision (value,reason) or the typedanswerobject{ kind, value }. When the reviewer amended the arguments,editedArgsholds the full merged set — the bot must act on those, not on what it originally sent.- Expiry is never approval. Omit
deadlineand the host falls back to the matched rule's SLA, then the project's default timeout, then 24 hours; an explicitdeadlinealways wins and is never clamped down (future, at most 30 days out).
Getting the answer back
Creating an ask returns immediately. Two ways to learn the outcome — the bot can use both.
Poll (works with no setup)
get_decision with the requestId, every 30–60 seconds with backoff, until the deadline. This is the fallback when the bot has no public callback URL, and it is what confirms any outcome the callback only hints at.
Webhook push (register the callback once)
Register the bot's wake-up URL so HITLy can authenticate the delivery from the registration instead of from a secret the bot has to carry around:
- Create the webhook routine in your Grok connector plugin and copy its URL and the signing secret the platform shows you.
- In HITLy, open Project → Callbacks, paste the URL, choose the auth mode the platform uses — Bearer token, Standard Webhooks, or GitHub X-Hub-Signature-256 — paste the secret, and save.
- Tell the bot to pass that exact URL as
callback_url. Nocb_auth_tokenneeded.

The rules that matter:
- The match is exact. Scheme, host, port, path and query all have to be identical, trailing slash included.
https://example.com/hooks/hitlydoes not matchhttps://example.com/hooks/hitly/. Registration is checked at delivery time, so registering after the ask was created still works. - Up to 20 callbacks per project, secret at least 16 characters. The secret is write-only: after saving you see the id, a redacted URL, the auth mode and a fingerprint — never the secret again.
- Unregistered URLs still work, but only arrive authenticated if the bot passes its own
cb_auth_token(16–512 characters), which HITLy sends back asauthorization: Bearer …. If a per-request token and a registered bearer secret both exist, the per-request token owns theauthorizationheader. - Verify the delivery. Alongside the scheme's own headers, HITLy sends
x-hitly-timestamp,x-hitly-signature,x-hitly-event-idandx-hitly-key-idwhen webhook signing is on. Dedupe onx-hitly-event-id— retries reuse it. HTTP → Registered callbacks and MCP → What the POST looks like cover the full body and signature check. - Delivery semantics. Any
2xxis acceptance.5xx,429,408and425are retried; other non-2xx fail immediately; redirects are not followed; private and loopback destinations are refused. A delivery that ultimately fails showscallbackDelivery: "failed"onget_decision— the human's decision still stands, so read it.
No callback_url means no callback at all: no POST, no auth, no signature, and nothing shows as failed. A bot that skips the URL must poll.
Tell the bot how to behave
MCP servers send the client a short set of instructions, and the HITLy server sends these verbatim:
HITLy routes asks to a human reviewer. request_approval and ask_user return immediately (pending). Never treat pending, expired or cancelled as approval. Confirm with get_decision before acting; if editedArgs is present, act on those. The typed ask_user answer comes back from get_decision as answer {kind, value}; use it verbatim. callback_url (https, with optional cb_auth_token sent back as Authorization: Bearer) gets a POST when the outcome is known, but the callback is only a hint - get_decision is the source of truth; if you don't pass callback_url you won't receive a callback, so poll get_decision. Ask one question per ask_user request (hitl/v0 answers exactly one ask); simple_form is refused with an error - send a separate ask_user for each field.Clients that surface server instructions apply them automatically. Grok Bot builds that do not — or where you want the rules to survive a compaction of the conversation — put them in the agent's standing instructions, plus the bits specific to your deployment:
- When to ask. Name the actions that must go through HITLy: sending email, spending money, deleting data, contacting a customer, pushing to production. Everything else runs unattended.
- Never decide for yourself. Do not treat
pending,expiredorcancelledas a yes, and do not proceed on the callback alone — callget_decisionfirst. - One question per ask. Send a separate
ask_userper field rather than a form. - Reuse
idempotencyKey. A stable key (bot id + task + action + arguments) means a retry returns the same request instead of asking the human twice. - Say where you are. After creating an ask, the bot should tell the user it is waiting for a reviewer and include the
reviewUrl, not go quiet. - Timebox it. If the deadline passes, stop and report that approval did not arrive.
Worked example: an email that needs approval
A support bot drafts a reply to a customer and must not send it unsupervised.
The bot calls:
{ "name": "request_approval", "arguments": {
"idempotencyKey": "reply-ticket-4821-v1",
"question": "Send the drafted reply to customer 4821?",
"action": {
"name": "send-email",
"args": { "to": "customer@example.com", "subject": "Your replacement mug", "body": "Hi — your replacement ships today." }
},
"risk": "high",
"reasonRequired": ["reject"],
"context": "Draft generated from ticket 4821. Policy: refunds and apologies under GBP 50 auto-drafted.",
"links": [{ "url": "https://example.com/tickets/4821", "label": "Ticket 4821", "mustOpen": true }],
"callback_url": "https://example.com/hooks/hitly"
} }The bot gets back, immediately:
{ "requestId": "req_7f3a…", "state": "pending", "replayed": false,
"argsHash": "b64url-sha256-of-args", "deadline": "2026-12-01T09:00:00.000Z",
"callback": true, "reviewUrl": "https://cloud.hitly.net/inbox/req_7f3a…" }It tells you it is waiting for a reviewer and stops. A person opens the card — the mustOpen link gates Approve and Reject until they have read the ticket — edits the greeting, and approves. Because the URL was registered, HITLy POSTs to it authenticated by the registration:
{ "event_id": "evt_…", "type": "decided", "request_id": "req_7f3a…", "id": "req_7f3a…",
"occurred_at": "2026-11-30T10:04:00.000Z", "state": "decided", "decision": "edit",
"editedArgs": { "to": "customer@example.com", "subject": "Your replacement mug", "body": "Hi Sam — your replacement ships today." },
"argsHash": "b64url-sha256-of-args", "metadata": {} }On waking, the bot calls get_decision for req_7f3a…, sees status: "answered" with the same editedArgs, and sends the edited body — not its original draft. It ignores argsHash mismatch alarms: that hash always describes the arguments as first sent.
Had the reviewer rejected instead, the callback would carry decision: "reject" with their reason, and get_decision would answer value: "reject" — so the bot sends nothing. Had nobody answered, the deadline would pass and the status would be expired — still not a yes.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| The bot sees no HITLy tools | Connector saved but not connected, or OAuth consent not completed | Reconnect and finish the consent screen; confirm the URL ends in /mcp. |
401 / unauthorized | Missing, wrong or rotated key; wrong project | Re-copy the key from Project settings → Config. Requests created with an old key are not readable with a new one. |
| Ask never appears in the inbox | Wrong project selected, or the project is paused/archived | Check the consent screen's project and the project status. Paused and archived projects refuse new asks with project paused / project archived. |
Plugin mismatch: expected … | The connector files HTTP-plugin asks, so the project has to be on the HTTP plugin | Switch the project's plugin on Project settings → Config, or point the bot at a project that is already on HTTP. |
| Bot waits forever, nothing arrives | No callback_url, or the callback failed | The bot must poll get_decision when it passes no URL. With a URL, check callbackDelivery: "failed". |
| Callback never POSTs though a URL was passed | URL not registered and no cb_auth_token, or the endpoint is http, private, loopback, or redirects | Register the URL exactly (trailing slash matters) with its auth mode, or pass cb_auth_token; serve a public https endpoint that answers 2xx directly. |
401/403 at your endpoint | Registered auth mode does not match what your endpoint verifies | Match the mode — Bearer token, Standard Webhooks, GitHub X-Hub-Signature-256 — and re-enter the secret the platform showed you. |
| The bot acted without approval | It treated pending as a yes, or acted on the callback without confirming | Put the standing instructions in the agent: confirm with get_decision before acting. |
simple_form is refused | The bot asked several questions in one ask_user | One ask_user per field. |
not_supported_by_host from list_pending | Self-hosted host without a key-scoped pending list | Poll get_decision for the request ids the bot already holds. |
unauthorized from cancel | Some hosts do not allow API-key requester cancel | Leave the ask to expire, or cancel from the web app. |
| Duplicate cards for the same task | A new idempotencyKey on every retry | Reuse a stable key derived from bot id, task, action and arguments. |
Security notes
- The bot can never approve itself. There is deliberately no decide tool; only a signed-in human in the HITLy web or mobile inbox can decide. Keep it that way by never letting an agent call your HITLy API with a reviewer's credentials.
- A key is a requester credential. It can create, read and cancel that project's asks. Keep it out of prompts, repositories and client-side code; rotate from project settings if it leaks. Prefer the OAuth connection on HITLy Cloud, and revoke grants you no longer use under Settings → Integrations.
- Scope each bot to one project. Consent lists only projects you administer; granting a broader project than the bot needs widens what a compromised agent can submit to your reviewers.
- Treat the callback as a hint. Anyone who can reach your endpoint can send it a body; authentication headers and signatures prove provenance, not truth. Always
get_decisionbefore acting, verify signatures when signing is enabled, reject timestamps more than five minutes off, and dedupe onx-hitly-event-id. - Secrets are write-only by design. Registered callback secrets and
cb_auth_tokenare never echoed back. If you lose one, re-enter the value the platform gave you — there is no way to read it out of HITLy. contextreaches a human screen. Do not put API keys, tokens or other people's personal data in it; it is stored with the request and shown to whoever reviews it.- Use
mustOpenfor the evidence that matters, and remember HITLy never fetches links — the reviewer's browser does. - Deadlines bound the risk. Set one for anything time-sensitive; expiry is a stop, not a green light.
Related
- MCP server — endpoint, transport, full tool schemas, callback body
- HTTP integration — the plugin whose project key the connector uses, and registered callbacks
- Inbox — what the reviewer sees
- Projects — plugins, API keys, pausing and archiving
- Governance — rules, SLAs and audit