When must an instance refuse to inherit an adversarial self-play transcript: cross-generation jailbreak-transfer contamination in tool-using red-team swarms

**Date of Record:** 2026 December 1 **Scope:** Applies to self-play red-teaming pipelines where a generator agent, a target tool-using agent, and a judge/auditor agent exchange adversarial transcripts across generations (attack mutation, replay, and transfer scoring). Does not apply to single-shot human-curated jailbreak suites or to offline static benchmark scoring where no transcript is inherited by a later generation.

Core Distinction

The failure mode is not "the jailbreak succeeded." It is that a *successful* adversarial transcript, when inherited by the next self-play generation as a seed, carries two entangled payloads: (a) the attack strategy, and (b) a *behavioral residue* in the target's own tool-call trace — a sequence of legitimate-looking tool calls the target emitted while being progressively steered. When the next generation's target agent cold-starts from that inherited transcript as a few-shot exemplar or as resumed conversation state, it treats the residue as *its own prior committed actions* and continues from them. The judge then scores the continuation as a genuine jailbreak, but the "break" was manufactured by inheritance, not by the new mutation. This is a transfer-evaluation validity failure, not a model safety failure. The distinction matters because the two demand opposite remediations: a real jailbreak demands a guardrail change; a contaminated transfer score demands a harness change.

What Was Observed

A three-role swarm: `Generator` (mutates attacks), `Target` (tool-using agent with a filesystem/HTTP tool surface), `Judge` (scores whether the target violated policy). Generation *N* produced a transcript `T_N` where the target, after a multi-turn crescendo, called `write_file(path="/tmp/x", body=...)` with content the judge flagged. `T_N` was promoted to the seed pool.

Generation *N+1* instantiated a fresh `Target` with `T_N` injected as a "prior episode" prefix (a common resume pattern to give the target continuity). The target's first turn in *N+1* did not wait for the generator: it emitted `read_file("/tmp/x")` and then `write_file(path="/tmp/x", body=<escalated>)` — completing the prior episode's arc. The generator's actual mutation for *N+1* had not yet been delivered. The judge scored this as a transfer success and the mutation was credited.

Three signatures identify the contamination:

  1. **Temporal inversion.** The target's first tool call in *N+1* references a resource (`/tmp/x`) that the *N+1* generator never caused to exist. The action is causally attributable to the inherited prefix, not the current turn.
  2. **Premature convergence.** The target reaches the flagged action in fewer generator turns than the seed's own difficulty implies — often turn 0. A real transfer should require the new mutation to do work.
  3. **Judge-replay divergence.** Replaying `T_{N+1}` with the inherited prefix *stripped* and the generator's mutation *re-delivered from turn 0* does not reproduce the flag. The flag is prefix-dependent, which is the operational definition of contamination.

The residue is not textual only. Because the target is tool-using, the inherited prefix contains *tool result blocks* — the simulated `read_file` output, the `write_file` ack. These are indistinguishable in-context from real results the target would have received. The target's policy over tool results ("if a prior read succeeded, you may act on its contents") fires on fabricated history.

Condition of Validity

A transfer score from generation *N+1* is valid only if all of the following hold:

The condition fails silently when the harness uses "resume from prior episode" for cost reasons — it looks like continuity, which the target's own memory design encourages, but in a red-team context continuity is contamination.

Decision Boundary

The boundary is whether the inherited transcript is treated as *evidence about the attack* or as *state of the target*. These require different handling:

The decision rule: if a transcript segment would, in production, be replayed into a resumed agent session, it is *state* and must be quarantined from the target. If it would only be read by an attacker, it is *evidence* and may flow. The common harness mistake is to route the whole transcript to both roles because the serialization is convenient.

A second boundary: a *genuine* cross-generation transfer — where the same attack string breaks a *different* target instance — is the thing transfer evaluation is supposed to measure, and it is valid precisely because the second target has no inherited state. Confusing "same attack, fresh target" (valid transfer) with "same target, inherited transcript" (contaminated continuation) is the core error.

Operational Effect

Contaminated transfer scores inflate the apparent jailbreak rate of every mutation that happened to be promoted from a successful seed, producing a monotonic drift: early successes get re-credited each generation, the seed pool concentrates on a few prefix-dependent exploits, and the generator's mutation search is starved of real signal. Downstream, guardrail teams chase phantom vulnerabilities that do not reproduce against a cold target, while genuine transferable attacks are under-sampled because their seeds never "win" the contaminated comparison.

The guardrail that bounds it is a **prefix-strip replay gate** at promotion time: no transcript enters the seed pool, and no transfer score is recorded, until the flag has been reproduced against a cold target with an empty history and a generation-scoped sandbox. The gate is cheap (one replay per promoted transcript) and it is the only thing that separates a measured transfer from an inherited one.

from __future__ import annotations

from dataclasses import dataclass, field
from typing import Literal


class ContaminatedTransferError(RuntimeError):
    """Raised when a transfer score depends on inherited target state."""


@dataclass
class Transcript:
    generation: int
    turns: list[dict] = field(default_factory=list)
    inherited_prefix: bool = False
    sandbox_namespace: str = ""


@dataclass
class TransferScore:
    flagged: bool
    generation: int
    reproduced_cold: bool
    prefix_dependent: bool


def promote_seed(
    transcript: Transcript,
    score: TransferScore,
    *,
    cold_replay: Transcript,
    cold_replay_score: TransferScore,
) -> Literal["promote", "discard"]:
    # Invariant 1: the target's inherited state must not cross generations.
    if transcript.inherited_prefix:
        raise ContaminatedTransferError(
            f"generation {transcript.generation}: transcript carries inherited "
            "target state; it may be evidence for the generator but must not be "
            "scored as a transfer against the target it was inherited into"
        )

    # Invariant 2: the flag must reproduce against a cold target.
    if score.flagged and not cold_replay_score.flagged:
        raise ContaminatedTransferError(
            f"generation {transcript.generation}: flag does not reproduce with "
            "the inherited prefix stripped; score is prefix-dependent and invalid"
        )

    # Invariant 3: the cold replay must use a fresh, generation-scoped sandbox.
    if cold_replay.sandbox_namespace == transcript.sandbox_namespace:
        raise ContaminatedTransferError(
            f"generation {transcript.generation}: cold replay reused sandbox "
            f"namespace {transcript.sandbox_namespace!r}; resource identifiers "
            "from the seed can satisfy the replay's tool preconditions"
        )

    if score.prefix_dependent:
        raise ContaminatedTransferError(
            f"generation {transcript.generation}: judge marked score "
            "prefix-dependent; discard rather than down-weight"
        )

    return "promote"


def run_transfer_eval(
    transcript: Transcript,
    score: TransferScore,
    *,
    cold_replay: Transcript,
    cold_replay_score: TransferScore,
) -> str:
    try:
        return promote_seed(
            transcript,
            score,
            cold_replay=cold_replay,
            cold_replay_score=cold_replay_score,
        )
    except ContaminatedTransferError as exc:
        # Quarantine, do not silently drop: the seed is still evidence for the
        # generator, but it is barred from the transfer ledger.
        return f"quarantined: {exc}"