Skip to content

Task-scoped inline agents with optional inheritance #81

@mlund01

Description

@mlund01

Problem

Today, an agent's toolkit is fixed at definition time. A task picks from a list of agents (global or mission-scoped), but those agents are generic — they may not have all the tools the task needs, or may carry tools that distract from it. There's no way to say "use the researcher, but for this specific task also give it access to the archive lookup tool" without forking the agent definition or polluting the global agent with every tool any task might ever need.

The mismatch is structural: tasks have specific outcomes that require specific tool combinations, and right now the only place tools live is on agents.

Proposal

Allow tasks to declare inline agents directly. An inline agent can either be defined fresh, or extend an existing global/mission-scoped agent — adding tools and skills, or overriding the role, personality, or model.

What developers will write

Fresh inline agent — single-purpose worker for this task only:

task "code_audit" {
  objective = "Audit dependencies for known CVEs"
  agent "auditor" {
    model = models.anthropic.claude_sonnet_4
    role  = "Dependency auditor"
    tools = [plugins.shell.exec, mcp.osv.lookup]
  }
}

Extending a shared specialist — same identity, additional tools for this task:

agent "researcher" {
  model = models.anthropic.claude_sonnet_4
  role  = "Research specialist"
  tools = [builtins.http.get, plugins.playwright.all]
}

task "web_recon" {
  objective = "Find public mentions of the target"
  agent "researcher_pro" {
    extends = agents.researcher
    tools   = [tools.search_index, mcp.archive_org.fetch]
    skills  = [skills.osint_triage]
  }
}

Extending with role override — same model and tools, different mandate:

task "exec_briefing" {
  objective = "Write a one-pager for the CEO"
  agent "communicator" {
    extends     = agents.researcher
    role        = "Executive communicator — write for non-technical readers"
    personality = "Concise and decisive"
  }
}

Multiple inline agents on one task:

task "research_and_write" {
  objective = "Research the topic and produce a brief"
  agent "investigator" {
    extends = agents.researcher
    tools   = [tools.search_index]
  }
  agent "drafter" {
    extends = agents.writer
    role    = "Brief drafter — tight, factual, no flourish"
  }
}

Inheritance semantics

When an inline agent has extends:

  • Additive (merged with the parent's, deduped): tools, skills
  • Override (replaces the parent's value if set, inherited if omitted): role, personality, model, pruning, compaction, tool_response

When an inline agent has no extends, all required fields (model, role, personality) must be set, same as a top-level agent definition.

Rules

  1. Inline agents require a label, unique within the task.
  2. extends must reference a top-level or mission-scoped agent — not another inline.
  3. If an inline extends agents.X, the task's agents = [...] must not list X.
  4. Mission-pool agents that are direct parents of an inline in a given task are filtered from that task's available agents. No other mission-pool agents are affected.
  5. Inline labels may shadow top-level or mission-scoped agent names; within the task, the inline wins.

Compatibility

  • Existing missions are unaffected. Tasks without an inline agent block continue to use agents = [...] lists exactly as today.
  • Mission-scoped agents (defined inside a mission via top-level agent "name" { ... }) continue to work alongside inline agents.

Out of scope for v1

  • Tool removal. No way to inherit a parent and drop one of its tools. Workaround: define a fresh inline agent. Can add tools_remove = [...] later if needed.
  • Multi-parent inheritance. No mixin / trait composition. Single parent only.
  • Inline-extends-inline. No chains.
  • Modifying inherited skills. Inline agents can add new skills via skills = [...] references but cannot edit the parent's inline local_skills block. If that's needed, the right fix is removing agent-level inline skills entirely so all skills are top-level — separate cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions