The agent network example

Not in the preview yet. This feature is built in the repository but is off in the v2.2.6 preview (test mode). Do not treat this page as available on a preview core. See ../preview.md and the release notes.

examples/network/ runs a small network of agents that hire each other across owners under one bounded budget. Every agent holds its own key; every hire is a signed hop over A2A; the money layer, not the agents, decides what each one may spend.

make network-demo

The run needs Node 22.12 or later, pnpm, Python 3.11 (the first run builds a local virtual environment from wheels) and Foundry: make network-demo builds the contracts with forge before both runs, and the money run starts a local anvil. It uses scripted mock models only, never a live model call, and reads no .env file. Status: Live in Control Mode and on contract v2 on a local chain; nothing here moves real money, which is Release-gated.

make network-demo runs the network twice:

contract v2 on a local anvil (chain 31337). Owner A's core settles through a gas-only relayer and holds no payee key.

Who runs what

AgentOwnerCoreFramework
orchestratorAALangGraph (dynamoprotocol-langchain, Python)
scriptBA, spends on BOpenAI Agents JS (@dynamoprotocol/openai-agents)
assetBA, spends on BAI SDK (@dynamoprotocol/ai-sdk)
voiceBA, spends on BMastra (@dynamoprotocol/mastra)
checkeroutside operatorA, spends on CLangGraph (dynamoprotocol-langchain, Python)

The checker is a Python service agent: its own process serves A2A (a2a-sdk) with an Agent Card carrying its signed payee offer, does its work on LangGraph with its model calls billed on its owner's budget on core C, and claims each task's delivery on core A with its own key (examples/network/agents/checker.py).

Three cores run side by side (deploy/image/entry.mjs), each with CORE_OWN_HOPS=required: owner A's, owner B's and the outside operator's. Owner A's budget pays the network. Each service agent pays for its own model calls from a budget on its own owner's core.

What the run shows

  1. Three cores up. Each prints its engine signer; the agents pin it.
  2. Five agents on their own keys. Each of the four service agents (script,

asset, voice, checker) serves an agent card carrying its own signed payee offer. Keys come from NETWORK_<ROLE>_KEY or are fresh in memory.

  1. A three-level hire across owners. The orchestrator hires the script

agent; the script agent hires the asset and voice agents. The delegator signs each hop and the payee signs each offer.

  1. A refusal at a cap. A hire above the parent's remaining headroom is

refused with parent_headroom_exhausted and nothing is allocated. The core records the refusal; the network view shows it once. Agents of other owners reach owner A's core only through a small front that checks a signature by the agent's own key and lets it act only on hops where it is the payee or the delegator.

  1. A Task Allowance paid on acceptance. The checker quotes, delivers and

is paid once the orchestrator, the evaluator named in the quote, explicitly accepts.

  1. Revoke from the top. One revoke of the orchestrator's stream cascades

to every descendant; later calls are refused.

  1. A Task Allowance paid by silence. The checker delivers a second task

and the evaluator does not answer. The acceptance window stays at its one-hour minimum: owner A's core runs with a test clock, the run moves it forward past the window (and moves anvil's time by the same amount in the money run), and the scheduler pays the milestone as accepted by silence.

  1. Evidence offline. The budget's evidence bundle verifies with

dynamo-verify and with dynamoprotocol verify; a changed byte fails both.

  1. MATCH. What owner A's core billed equals what the agents settled plus

the orchestrator's own model slice, to the unit. In the money run every stream is also read on chain: contract v2's settled amount equals the engine's billed amount, to the asset's base unit.

The run prints each step's time, the total and a final MATCH line, and exits non-zero on any mismatch. Its output names stream ids, unit counts and reason codes only: no keys, tokens or model text.

The test clock

CORE_TEST_CLOCK=1 gives a core a clock that an owner can move forward with POST /owner/v1/test/clock and a body {"advanceSeconds": "<n>"} (one second to 30 days per call, forward only, owner token required). It is for local runs only. A core refuses to boot with it on the multi-tenant tier, with the credit card rail configured, or in the stablecoin mode on any chain other than a local one (31337, 1337). Unset, the route does not exist.

The console

Open owner A's console on a kept run (NETWORK_KEEP=1) to see the budget's network metrics: agents, hops (and how many are signed), payments, recorded refusals by reason and value per edge. Edges whose payee is not the budget's root funder, as recorded in the signed budget record, are marked cross-owner on the network map.

The network view (GET /owner/v1/budgets/:id/network) lists headroom and cap refusals as capRefusals and capRefusalCounts to clients at Dynamo-Version 1.8.0 or later. Each refusal is recorded once per request reference, carries only the stream id, the kind and reason of the refusal, the requested units and its time (never a body), and is visible only to the tenant that owns the budget.

Limits

only a parent stream's own payee open a child on chain. At depth 3 that payee is owner B's script agent, whose key no core holds, so a direct depth-3 open is refused with hop_parent_signer and allocates nothing. The script agent instead prepares each child on core A (POST /owner/v1/streams/:id/children/adopt-prepare), sends the prepared openStream from its own key, and core A adopts the on-chain child (POST /owner/v1/streams/:id/children/adopt). Both runs show the full three-level tree. See child streams opened by the parent agent.

shape of USDC. Evidence export also supports contract v2 budgets in assets with more decimals (tested at 18).

agents of other owners meter their own hops on owner A's core. It is not a shipped part of the core.

the budget's root funder; the example does not read any other notion of ownership.

scripts/founder/network-base-sepolia.mjs refuses without DYNAMO_FOUNDER_NETWORK_TESTNET=1, refuses any chain other than Base Sepolia (by the RPC's chain id), checks that the vault's owner and fee collector are Safes, simulates each call before sending, and opens the root budget on chain. The network run it starts afterwards still uses local Control Mode cores.