Skip to content
Blog

Simulating Multi-Stakeholder Negotiations with Specialized Role Agents

Run realistic multi-party negotiations in Google ADK by giving each stakeholder its own role agent, private constraints, and a shared offer ledger.

Published on • November 30, 2026

AI Assistant

Ask a single language model to “simulate a negotiation between a buyer, a seller, and a regulator” and you get a strangely harmonious result: everyone agrees quickly, the regulator never blocks anything, and the final deal is suspiciously good for all parties. That is not a negotiation — it is one model role-playing everyone, which means it has no conflicting interests to defend.

Real negotiation is multi-stakeholder by construction: each party holds private constraints the others must discover through offers, counter-offers, and the occasional walk-away. To simulate that credibly, each stakeholder needs its own agent, its own private state, and a structured ledger of what has actually been offered.

This post builds a negotiation simulator in Google Agent Development Kit (ADK) using specialized role agents, a ParallelAgent for simultaneous position-taking, a LoopAgent to run rounds, and a deterministic arbiter that decides when the negotiation has actually terminated.


1. Why One Agent Cannot Negotiate With Itself

A negotiation has three properties that break single-agent role-play:

  • Asymmetric information. The seller knows the reserve price; the buyer knows the budget ceiling. If one model holds both, the “secret” leaks into every sentence.
  • Genuine conflict. Value one party gains, another loses. A single context window tends to smooth this conflict away toward consensus.
  • Round structure. Offers, counters, deadlines, and termination conditions are procedural — they must be enforced by something other than good intentions.

The fix is architectural: one agent per stakeholder, each with its own instruction, tools, and — critically — its own slice of session state that the other agents’ prompts never see.


2. The Simulation Architecture

                 ┌─────────────────────────────────────────┐
                 │            NegotiationLoop (LoopAgent) │
                 │            max_rounds = 6               │
                 │                                         │
                 │   ┌─────────────────────────────────┐  │
                 │   │  Round: ParallelAgent            │  │
                 │   │  ┌───────────┐ ┌──────────────┐  │  │
                 │   │  │ buyer     │ │ seller        │  │  │
                 │   │  │ role      │ │ role          │  │  │
                 │   │  └───────────┘ └──────────────┘  │  │
                 │   │  ┌───────────┐ ┌──────────────┐  │  │
                 │   │  │ regulator │ │ scribe        │  │  │
                 │   │  │ role      │ │ (deterministic)│ │  │
                 │   │  └───────────┘ └──────────────┘  │  │
                 │   └─────────────────────────────────┘  │
                 │                                         │
                 │   ┌─────────────────────────────────┐  │
                 │   │  Arbiter (custom BaseAgent)      │  │
                 │   │  reads ledger → escalate on end  │  │
                 │   └─────────────────────────────────┘  │
                 └───────────────────────────────────────┘
                                  │
                    session.state["ledger"], ["round"]

The LoopAgent runs one round after another. Each round, the role agents post positions concurrently via ParallelAgent; a deterministic ScribeAgent normalizes them into a shared ledger, and a deterministic Arbiter escalates (which terminates the loop) as soon as an agreement or an impasse is objectively reached.


3. Defining Stakeholders as Role Agents

Each stakeholder is a plain ADK Agent with three ingredients: a persona instruction, tools for its private knowledge, and an output_key that publishes its current position.

from typing import AsyncGenerator
import json

from google.adk.agents import Agent, BaseAgent, ParallelAgent, LoopAgent
from google.adk.agents.invocation_context import InvocationContext
from google.adk.events import Event, EventActions
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService


def get_buyer_constraints() -> dict:
    """Private knowledge: only the buyer agent has this tool."""
    return {"budget_ceiling_usd": 480_000, "walk_away_price_usd": 520_000,
            "priorities": ["delivery_before_q3", "source_code_escrow"]}


def get_seller_constraints() -> dict:
    return {"reserve_price_usd": 455_000, "must_keep": "branding_rights",
            "preferred_terms": "net_30"}


def get_regulatory_rules() -> dict:
    return {"hard_blocks": ["data_transfer_to_non_eu_subprocessors"],
            "review_days": 30}


buyer = Agent(
    name="buyer_role",
    model="gemini-3.8-flash",
    description="Acquisition lead defending the buyer's budget and delivery requirements.",
    instruction="""
    You are the buyer's negotiator. Call get_buyer_constraints for your limits.
    You never reveal your ceiling. Each round: state your latest offer and the
    single biggest obstacle from your perspective, in compact JSON with keys
    `offer_usd`, `concessions`, `demands`. Stay in character; do not mediate.
    """,
    tools=[get_buyer_constraints],
    output_key="position_buyer",
)

seller = Agent(
    name="seller_role",
    model="gemini-3.8-flash",
    description="Vendor defending price, branding rights, and payment terms.",
    instruction="""
    You are the seller's negotiator. Call get_seller_constraints for your limits.
    Concede slowly and only against equivalent concessions. Reply as JSON with
    keys `counter_usd`, `concessions`, `demands`. Never soften the buyer's
    demands for them.
    """,
    tools=[get_seller_constraints],
    output_key="position_seller",
)

regulator = Agent(
    name="regulator_role",
    model="gemini-3.8-flash",
    description="Compliance reviewer enforcing hard regulatory blocks on any deal.",
    instruction="""
    You are the regulator. Call get_regulatory_rules. You care nothing about
    price. Flag any term touching a hard block as `blocked`, else `clear`,
    as JSON with keys `status`, `conditions`, `review_days`.
    """,
    tools=[get_regulatory_rules],
    output_key="position_regulator",
)

The description field is not decoration: it is the text ADK uses when a coordinating agent decides whom to involve, so write it as a routing signal, the same way you would for a coordinator/specialist fleet. The JSON-only outputs matter too — the deterministic scribe parses them, and structured beats scraped.


4. The Shared Ledger: Making Turns Explicit

Session state is the negotiation table. The scribe is a second BaseAgent subclass — pure Python — that parses each role’s JSON, appends it to a round-indexed ledger, and increments the round counter:

class ScribeAgent(BaseAgent):
    """Normalizes role positions into a structured, append-only ledger."""

    async def _run_async_impl(
        self, ctx: InvocationContext
    ) -> AsyncGenerator[Event, None]:
        ledger = ctx.session.state.setdefault("ledger", [])
        round_no = ctx.session.state.get("round", 0)

        entry = {"round": round_no}
        for role in ("buyer", "seller", "regulator"):
            raw = ctx.session.state.get(f"position_{role}")
            try:
                entry[role] = json.loads(_fence(raw))
            except (TypeError, ValueError, json.JSONDecodeError):
                entry[role] = {"status": "unparseable", "raw": str(raw)[:400]}

        ledger.append(entry)
        ctx.session.state["ledger"] = ledger
        ctx.session.state["round"] = round_no + 1

        yield Event(author=self.name, actions=EventActions())

Because the ParallelAgent’s branches share the same session.state (though not each other’s conversation history), all three role agents write to distinct keys in the same round, and the scribe reads them together. Avoid two branches writing the same key — they run concurrently and would race.

Every mutation lands in event.actions.state_delta, so a streaming UI can render the ledger live and an auditor can replay exactly when a price first appeared.


5. The Arbiter: Ending the Negotiation Deterministically

Who decides the deal is done? Not the model. The arbiter checks objective conditions and escalates — in ADK, an Event with EventActions(escalate=True) terminates the surrounding LoopAgent:

class ArbiterAgent(BaseAgent):
    """Declares agreement or impasse from the ledger; never negotiates."""

    async def _run_async_impl(
        self, ctx: InvocationContext
    ) -> AsyncGenerator[Event, None]:
        ledger = ctx.session.state.get("ledger", [])
        max_rounds = ctx.session.state.get("max_rounds", 6)
        verdict = "ongoing"

        if ledger:
            last = ledger[-1]
            buyer_off = last.get("buyer", {}).get("offer_usd")
            seller_off = last.get("seller", {}).get("counter_usd")
            reg_ok = last.get("regulator", {}).get("status") == "clear"

            if isinstance(buyer_off, (int, float)) and isinstance(seller_off, (int, float)):
                if reg_ok and seller_off <= buyer_off:
                    verdict = "agreement"
                elif buyer_off < seller_off * 0.85:
                    verdict = "impasse"
            if len(ledger) >= max_rounds:
                verdict = "timeout"

        ctx.session.state["verdict"] = verdict
        yield Event(
            author=self.name,
            actions=EventActions(escalate=verdict in {"agreement", "impasse", "timeout"}),
        )


def _fence(text) -> str:
    if not isinstance(text, str):
        return str(text)
    text = text.strip()
    if text.startswith("```"):
        text = text.split("\n", 1)[-1]
    return text.rsplit("```", 1)[0].strip()


round_orchestration = ParallelAgent(
    name="position_round",
    sub_agents=[buyer, seller, regulator],
)

negotiation = LoopAgent(
    name="negotiation_simulator",
    max_iterations=6,
    sub_agents=[round_orchestration, ScribeAgent(name="scribe"), ArbiterAgent(name="arbiter")],
)

This is the pattern’s heart: role agents argue, deterministic agents officiate. The probabilistic layer supplies the drama; the deterministic layer supplies the rules of the game.


6. Running and Interpreting the Simulation

async def main():
    session_service = InMemorySessionService()
    runner = Runner(
        agent=negotiation, app_name="negotiation", session_service=session_service
    )
    session = await session_service.get_or_create(
        app_name="negotiation", user_id="simulator"
    )
    session.state["max_rounds"] = 6

    async for event in runner.run_async(
        session=session,
        message="Begin round 1 of the AcmeCorp acquisition negotiation.",
    ):
        if event.actions and event.actions.state_delta:
            delta = event.actions.state_delta
            if "ledger" in delta:
                print("ledger updated, rounds:", len(delta["ledger"]))
            if "verdict" in delta:
                print("verdict →", delta["verdict"])

    print("Final verdict:", session.state.get("verdict"))


if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

A typical run shows the buyer opening at $410k, the seller countering at $505k, the regulator flagging a sub-processor clause in round 2, a concession pair in round 4, and an agreement verdict when the seller’s counter drops under the buyer’s still-hidden ceiling — while reg_ok is finally True. Change a reserve price in a tool and rerun: the trajectory shifts, because the roles’ knowledge is genuinely separated.


7. Checklist for Credible Role-Play Simulations

  1. One agent per stakeholder, each with its own instruction, tools, and output_key — no shared persona block.
  2. Private knowledge behind tools, so limits can only leak through the offers a role chooses to make.
  3. Structured positions (JSON in the output) that deterministic code can parse and aggregate.
  4. ParallelAgent for simultaneous rounds — branches share session.state but not history; give each branch its own keys.
  5. A ScribeAgent/ArbiterAgent pair written as custom BaseAgent classes: ledger bookkeeping and termination conditions must not be model opinions.
  6. A bounded LoopAgent with max_iterations, escalating only on agreement, impasse, or timeout.
  7. Read event.actions.state_delta for live rendering and full replay of the negotiation history.

Do that, and your simulation stops being a single model’s monologue and starts behaving like a room full of people with something to lose.

Sources