Background Sub-Agents

How your AI agent delegates slow work to a second agent so your conversation never has to wait.

Intermediate
4 min read

Background Sub-Agents

Sometimes the thing you're asking your AI to do takes a while — a phone call, a prior authorization, looking up five records at once. Instead of leaving you staring at a "typing..." indicator, your agent can start that work in the background and keep talking to you about other things. When the background work is done, it comes back and tells you.

This page explains what that looks like when you're on the other end of the conversation.

How does my agent work in the background?

Your agent can start a second agent — a "sub-agent" — to handle slow tasks. The second agent runs in its own little chat, doing the work you asked for, while the first agent stays with you and keeps the conversation going.

Think of it like your agent having an assistant. When a caller asks about a prescription, your agent keeps them on the line — chatting, answering other questions, booking follow-ups — while the assistant calls the pharmacy. The moment the pharmacy responds, your agent weaves the answer into the conversation.

You don't have to tell it to do this. The agent decides when a task is too slow to block on, and delegates on its own.

What will I see?

Async delegation should feel natural. The main things you'll notice:

A "starting now" message when it delegates.

Let me start that in the background — I'll let you know as soon as I hear back.

I'm looking into that in parallel with another request. Give me a minute.

Spontaneous updates when the background work finishes.

I've got an update on the Ozempic prior authorization you asked about earlier — approved. The pharmacy expects it ready tomorrow.

Quick update: the outbound call to Alice went to voicemail. I left a message.

A status check any time you ask for one.

If you want to know what's happening, just ask:

You: What's the status on the prior auth?

Agent: Still waiting on the pharmacy. I'll ping you the moment I hear back.

Can I cancel it?

Yes. Just tell your agent in plain language:

  • Cancel the background work on the Ozempic request.
  • Stop working on that outbound call.
  • Never mind the prior auth — I'll handle it.

The agent will end the sub-agent's work gracefully. If the sub-agent is mid-way through something (like a tool call), it may finish the current step before stopping.

How do I know what's running?

Ask your agent directly:

  • What are you working on in the background?
  • Do you have any background tasks running right now?
  • List the sub-agents you have going.

The agent will reply with a short summary of each background task and its status — working, waiting for input, done, cancelled, or failed.

You can also find the background agent's chat in the Chats view if you want to follow along with its reasoning step by step. It shows up like any other chat, tied back to the conversation it came from.

Is this safe?

Yes — the same rules that keep your regular agents safe apply to sub-agents too.

  • PHI is audited. Every time a background task's contents are read, Gravity Rail writes an audit record saying that PHI was accessed and by whom. The audit trail never contains the actual patient information.
  • Ownership is enforced. Only the agent (and the person) that started a background task can check on it, send it instructions, or cancel it. No other agent in your workspace can see or touch it.
  • Workspace isolation holds. A background task started in your workspace can only read and act inside your workspace. It can't cross into another workspace's data.
  • Delegation is bounded. An agent can only delegate a few levels deep — this prevents runaway chains of agents spawning agents spawning agents.
  • Chats — Where you can find and follow background agent conversations.
  • Agents — Creating and configuring the agents that participate in background delegation.
  • Abilities — The tools your agents can use during background work.