Skip to main content

What Are Prompts?

Prompts define:
  • system instructions (prompt)
  • model (model)
  • available tools (tools)
  • optional context controls and validation
Prompts are auto-discovered from agents/prompts/.

Basic Example

Tool Types in tools

tools accepts multiple forms:
  • string callable name
  • SubpromptConfig for prompt-tool options
  • PromptToolConfig for tool-level options
  • SubagentToolConfig for dual_ai subagent relationships

Subagent Tool Configuration

Use SubagentToolConfig to define parent -> child behavior:

Important Fields

  • blocking: wait for child completion or return immediately
  • resumable: persistent child instances with message routing
  • initUserMessageProperty: map args to child initial message
  • initAttachmentsProperty: map args to child initial attachment paths
  • initAgentNameProperty: map args to child thread display name
  • immediate: true for default immediate boot, or an object when you want explicit nameEnv / descriptionEnv hints and runtime-only scopedEnv transfer

Resumable Runtime Tools

When a prompt has resumable subagent configs, AgentBuilder injects runtime tools:
  • subagent_create
  • subagent_message
subagent_create requires a non-empty name argument. Use a concise stable child-instance label rather than leaving the thread anonymous. subagent_create.arguments is shaped from the prompt schema on the child side selected by resumable.receives_messages. AgentBuilder persists those values with the child thread, exposes them to both child sides as ThreadState.arguments, and makes top-level keys available to prompt variable interpolation. Non-resumable subagents behave like normal tool calls and are not created via lifecycle tools.

Context and Validation

Useful options:
  • includeChat
  • includePastTools
  • toolChoice
  • requiredSchema
  • reasoning
  • hooks

Best Practices

  • Keep orchestrator prompts focused on delegation + synthesis
  • Put strict production/QA logic into the child dual_ai agent
  • Use explicit init*Property mappings for predictable payloads
  • Use the object form of immediate when per-instance boot should derive from safe name/description envs without exposing secrets
  • Set reasonable maxInstances on resumable children