agent_id and it runs as one of the
organization’s agents instead: it inherits that
agent’s system instructions, default template and harness, is tagged with its
identity for telemetry, and is graded against its rubric.
That is also how one agent spawns another. A run that launches a session with
agent_id creates a subagent: a child session doing a scoped piece of work
under a different agent’s persona and permissions, which the parent polls for
a result.
Launch one
GET /api/v0/sessions/{id} (or
runtm-api session status <id>) until last_prompt.status is completed,
error, or timed_out, then read the result with
GET /api/sessions/{id}/history.
The agent’s own defaults fill the gaps: omit template/agent and the child
boots on the agent’s default_template and default_agent. Anything you pass
explicitly wins.
Who is allowed to
Each agent carries acallable_by allowlist — set it in the dashboard under
Access control → Who may launch this agent, or with
PATCH /api/v1/agents/{id}:
Naming anyone closes the agent to everyone else. An agent whose only entry
is another agent is delegation-only: a person calling the API with their own
key gets
403 AGENT_NOT_CALLABLE, and it disappears from
GET /api/v1/agents?can_launch=true. Leave the list empty to keep it open.
Org admins and owners bypass the list under the default role access model;
switch the organization to the group model to make membership the only rule.
When the edge needs an approval
A caller edge can require a human decision before each delegation:{"agent_id": "...", "approval": {"required_team_id": "team_ops"}}. The
launch is refused with APPROVAL_REQUIRED until one exists.
- The calling run raises an approval on its own session — from inside the
sandbox with the
runtm-approvalhelper. There is no public endpoint that creates one; the API only lists and resolves. - Someone in the required group resolves it — in the dashboard, or with
Resolve Approval. Find its id with
List Approvals or
runtm-api session approvals list <parent-session-id>. - Retry the launch with that approval’s id:
approved, belong to the calling session, match the
edge’s required_team_id / required_role / kind, and have been resolved
within the last 10 minutes. It is not reusable for a later delegation
once it goes stale — request a fresh one.
Limits worth knowing
- Chain depth. Delegation is capped at 3 hops; deeper returns
DELEGATION_TOO_DEEP. Subagents spawning subagents is supported, not unbounded. - Disabled agents. An agent with a kill switch on refuses every launch and has had its keys revoked.
- Budget and templates. The agent’s monthly cap and its
access_grant.allowed_templatesare enforced at launch, so a delegation can be refused for spend or for booting the wrong template. - Scopes.
sessions:writeforsession create;sessions:writeplussessions:promptforsession launch.