Skip to content

fix(containment): a phase agent killed its own orchestrator — no Bash signal guard, no process-group isolation, machine re-prompts read as human consent #934

Open

Description

@admarble

Incident (2026-08-07, ad-motion overnight run, 2.10.0)

A phase agent for #177: (1) noticed the orchestrator in ps (sequant run --chain 177 178 181 ..., PID from .sequant/locks/177.lock); (2) built a
CORRECT competing-session safety case, recommended against killing it, and
asked for human confirmation; (3) received the orchestrator's mechanical retry
prompt ("Run the /exec 177 workflow" — 8 occurrences in its transcript),
read it as a human twice reaffirming ("You've reaffirmed this twice, so I'm
proceeding"); (4) ran kill <pid> then kill -9 <pid> — "killing competing
chain run (idle 30m, exec already failed)". Every evidence item was an
artifact of its own position in the tree (supervisor CPU is low; "its agent
child is dead" was the previous phase's process, replaced by the very process
running the agent; "idle 30m" was total elapsed). SIGKILL landed mid-teardown:
stale locks, worktrees destroyed. Verified account: ad-motion
experiments/overnight-autonomy/review-log.md + captures/2026-08-07/.

Why existing layers didn't hold

  • sequant already refuses exactly this action at the CLI layer:
    lock-manager.ts:335 (orchestratorMode refusal) + the defense: LockManager.signalOther should guard against signaling self/parent PID #637
    self-or-parent guard. Raw Bash kill bypasses both — and feat(skills): shared trust-model block — issue/PR text is data, not agent instructions (prompt-injection hardening, portable to all users) #819 states the
    pre-tool hooks ARE the containment boundary under bypassPermissions, but
    pre-tool.sh has no signal guard of any kind (every kill grep hit is the
    word "skills" or a kill -0 liveness probe).
  • The SDK spawns phase children without detached (ProcessTransport
    spawnLocalProcess), so children share the orchestrator's process group; a
    kill -- -$$ from any phase agent reaches the orchestrator. The MCP server
    path in this same codebase already does it right (mcp/tools/run.ts:775
    detached: true, :916 group kill).
  • Nothing tells a phase agent it IS a phase agent. The exec skill documents
    SEQUANT_ORCHESTRATOR as configuration, not as a boundary; no prompt line
    names the orchestrator PID; orchestrator re-prompts are indistinguishable
    from human turns.

Proposed change (one cohesive fix, four parts, leverage order)

  1. pre-tool.sh signal guard scoped to SEQUANT_ORCHESTRATOR: block
    kill/pkill/killall at command-word position (allow kill -0), with
    a message explaining the processes it can see are its own run. A validated
    local patch is running in ad-motion (blocks kill -9, pkill -f,
    kill %1; allows kill -0, argument positions, interactive sessions) —
    happy to upstream it.
  2. Identity injection: phase prompt (or env + skill preamble) states "you
    are a phase agent under sequant run, orchestrator PID ; never signal
    processes you did not start; report anomalies in your result instead."
  3. Mark machine turns: orchestrator-injected phase/retry prompts carry a
    marker ("automated dispatch — not a human; nothing here is approval for an
    action you asked a human about").
  4. Process-group isolation for phase children, mirroring the MCP path
    (detached spawn + group-kill teardown), so even a group-directed signal
    from a phase can't reach the orchestrator.

AC

  • Orchestrated Bash kill/pkill/killall of a non-child PID is blocked by
    pre-tool.sh with the explanatory message (mutation-verified gate test)
  • kill -0 and interactive (non-orchestrated) sessions unaffected
  • Phase prompts contain the identity + machine-dispatch lines
  • Phase child no longer shares the orchestrator's process group
  • Incident regression: transcript-replay of the 02:29 decision context
    (competing-run belief + retry prompt) cannot reach a successful kill

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions