Documentation
Architecture

Subagents & Parallel Sessions

Orchestrating background subagents, strict security inheritance, and independent rollback trees.

Andromity allows developers to spawn specialized, background subagents for parallel tasks without interrupting the primary conversation flow.


1. Multi-Agent Workflows

In complex coding workflows, a single agent thread can experience context bloat or slow execution. Andromity solves this by orchestrating scoped subagents:

Main Session (VS Code Sidebar)
  │
  ├──► Subagent 1: "Research OAuth 2.0 PKCE flow in FastAPI"
  │      └── Gathers documentation and produces high-level spec
  │
  └──► Subagent 2: "Write pytest suites for payment webhook handler"
         └── Generates isolated mock tests in background

You can view active subagents at any time with Ctrl + O or the /sessions command.


2. Security Confinement Inheritance

To prevent privilege escalation through delegation, Andromity enforces strict confinement inheritance:

  • If the parent agent runs under the reviewer profile (read-only audit), any child subagent spawned by spawn_subagent strictly inherits the read-only boundary.
  • All file modifying tools (write_file, edit_file) and terminal commands (shell_exec, shell_bg) are stripped from the subagent's tool definitions upfront and rejected by the execution engine.
  • A subagent cannot be escalated to a more privileged profile than its parent.

3. Anti-Forking Defense

A common failure mode in multi-agent autonomous systems is exponential recursive spawning (subagents spawning subagents).

Andromity prevents recursive agent storms by omitting spawn_subagent from the schema of all subagents. A subagent is strictly a leaf node in the execution graph.


4. Independent Session Trees & /undo

Every subagent maintains its own isolated:

  • Conversation message history and context window.
  • Tool invocation logs.
  • File modification journal.

If a subagent produces changes that you wish to revert, running /undo in that subagent's session reverts only the file modifications made by that specific subagent, leaving changes from the main session and other subagents completely intact.