Chapter 9

Keep the Final Answer With the Manager

Agents-as-tools fit when one owner must choose specialists, combine their outputs, and answer to the user or an external gate. The manager holds the original goal and calls specialist agents as bounded tools; specialists return data or artifacts but don't take the user-facing conversation. The pattern suits due diligence, release readiness, and support, when a single component normalizes style and applies shared guardrails.

TypeScript
import { Agent } from "@openai/agents";

const testAgent = new Agent({
  name: "Test specialist",
  instructions: "Analyze only test evidence. Return findings, not a release decision."
});

const securityAgent = new Agent({
  name: "Security specialist",
  instructions: "Analyze dependency and policy risks. Do not modify source files."
});

const releaseManager = new Agent({
  name: "Release manager",
  instructions: "Call specialists when needed and own the final release summary.",
  tools: [
    testAgent.asTool({
      toolName: "inspect_tests",
      toolDescription: "Inspect test evidence for the release candidate."
    }),
    securityAgent.asTool({
      toolName: "inspect_security",
      toolDescription: "Inspect dependency and policy evidence."
    })
  ]
});

Keep the specialist tool's contract narrow: one verb in the name (inspect, search, verify, calculate); a description that says when to call the tool and what it doesn't do; an input with a narrow task, references to artifacts, and a local budget; an output with schema, provenance, and completion status; and a ban on an irreversible side effect if the manager expects only analysis.

The manager is useful when you need to call several independent experts, compare results, remove duplicates, and produce one consistent output. The manager is superfluous when the application already knows the list of workers and can assemble structured outputs with an ordinary function.

The manager is both a control point and a bottleneck. A central manager is convenient for shared rate limits and output policy, but at the same time becomes a single point of semantic failure. Its prompt can't be turned into a dump of all the specialists' instructions.

The manager keeps control with itself. Sometimes ownership must be transferred entirely - and it can be transferred only together with a contract.

Links