# Agents An agent is an LLM-backed runtime entity: a named configuration that sets a model tier or an exact model ID, a set of builtin tools and callable [actions](actions.md), a system prompt, and optionally the subagents it may delegate to. The runtime assembles the system prompt from the shared agent charter, the agent's own identity, and runtime context. **Contracts:** - An agent definition declares a [local artifact name](apps.md#artifact-names-and-references). The name cannot contain `:`, and `main` is reserved for Rome Core. Its `actions` and `allowedSubagents` references use canonical `:` ids for both same-app and cross-app references. - An exact `actions` reference grants a public or explicit action. The `*` entry grants only public actions. - An agent can remain provider-agnostic by declaring `tier: large|medium|small`. The runtime maps the tier to an available provider and concrete model. - An agent whose behavior depends on a provider-specific capability may pin a provider. A provider-pinned tier resolves only on that provider and fails rather than falling back to another provider. - An agent that needs a specific model may declare `provider` with `modelId` instead of a tier. Rome requests that exact ID without tier mapping or automatic substitution. The provider and connected account must support the requested model. - Every agent's chat happens within a [session](sessions.md). There is no session-less agent turn. Explicit guardian selections and saved session pins take precedence over the agent's configured model. - Each subagent has a restricted capability set appropriate to its role. Delegation never widens capabilities. ## Model selection Use a tier when the app should run across providers. Add `provider: openai` or `provider: anthropic` to restrict tier resolution to one provider. Use `modelId` when a particular provider model is required: ```yaml name: fast_coding_agent description: Completes coding tasks with a specific model. provider: openai modelId: gpt-5.3-codex-spark reasoningEffort: high permissionMode: default tools: - Read systemPromptPrefix: Complete the requested coding task. ``` `modelId` is the provider's native model ID, not a WebChat selection key. For example, `gpt-5.6-terra` is a native ID and `openai/gpt-5.6-terra` is its selection key. The old `gpt-5-6-terra` token is accepted only as legacy input. IDs do not need to appear in Rome's WebChat catalog. Rome checks provider availability and known entitlements, and the provider validates IDs it receives. Declaring an ID does not grant access to that model. **Validation:** - `modelId` requires `provider: openai|anthropic` and a nonempty string containing no whitespace. Rome preserves the ID rather than trimming or rewriting it. - `modelId` cannot be combined with `tier`, legacy `model`, or `codeBacked: true`. - Without `modelId`, a tier is required. Legacy `model: opus|sonnet|haiku` remains accepted and normalizes to `large|medium|small`. - The same schema validates runtime agent loading and packed-app installation. Older Rome versions that do not recognize `modelId` reject it rather than silently ignoring the pin. An agent model pin supplies the default for a new session, not an instruction to migrate existing history. Changing the YAML affects new sessions. Existing sessions retain their [session model pin](sessions.md#model-pin) while it is on the agent's provider, unless the guardian explicitly selects another model. ## Agent policy A core or app agent may declare how a chat treats its turns in an optional `policy:` block. Each omitted field keeps the default, which is the behavior every chat had before the block existed. | Field | Values | Default | |---|---|---| | `finalText` | `deliver` sends the model's text to the chat. `private` keeps it, narration and final reply alike, in the trace, so the agent reaches the guardian only through its tools. A place can override it: on a connection the Concierge's text is the reply ([Concierge](../architecture/concierge.md#on-a-connection)). A `private` agent gets no Claude Code reminder to update the guardian, and `defer` does not ask it for a confirmation line. | `deliver` | | `autoTitle` | Whether the chat's first message names the chat. | `true` | | `loadMemory` | Whether a core agent's system prompt carries the memory index, project summaries, and runtime paths. | `true` for `main` only | | `freshSessionOnSetupChange` | Whether a session opened by continuity key is replaced by a fresh one when the agent's [setup](sessions.md#setup) changed since it opened. | `false` | | `handoffOnRenewal` | Whether a renewed session starts from a [handoff](sessions.md#handoff). | `false` | | `delegatesWork` | Whether the agent hands its work to other chats rather than doing it. Its system prompt then leaves out the command line tools and the runtime context beyond where memory and the docs are, and its sessions carry no `propose_routine`. | `false` | ## Own turns Deprecated, and to be removed: Rome is not keeping a way for an app to run its agent's turns. An app agent may declare `runsOwnTurns: true` when its own app runs its turns. On an account linked to it, Rome answers no message, so no [wake gate](../domains/participation.md#wake-gate) judges what the agent hears. Rome honours the field only for the first-party apps in `DEPRECATED_RUNS_OWN_TURNS_APPS` (`packages/core/src/app-host/deprecated-runs-own-turns.ts`) and ignores it on any other agent. Rome reads it as `deprecatedRunsOwnTurns`. The key keeps its name, so an app that sets it still loads on older Rome hosts. Its earlier name `unsafeTestOnlyBypassInbox` still loads too. ## Builtin tools A builtin tool is a tool the model provider runs itself, such as a file read or a shell command. An agent's `tools` list names the builtin tools it gets. Its actions, skills, and subagents are Rome tools, which `tools` does not control. Both providers use one set of names: `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`, `WebSearch`, `WebFetch`, `TodoWrite`, and `Task`. `ImageGeneration` names Codex's image generation tool, which Claude does not have. A provider ignores a name it does not provide. **Contracts:** - With `tools: []`, an agent cannot read or write files, run commands, or search the web on either provider. It acts only through Rome tools. - On Claude, each name is one tool, and the agent gets exactly the tools it lists. - On Codex, a name grants a Codex capability, and some capabilities are coarser than the names. The table below lists them. - Codex has one shell for reading files, searching, and running commands. Any of `Read`, `Glob`, `Grep`, or `Bash` gives the agent that shell, and the shell can write files. An agent that must not run commands on Codex declares none of the four. - Codex offers its patch tool on every thread. An agent with no `Write`, `Edit`, or shell name runs in Codex's read-only sandbox, which rejects every patch. - Some Codex models carry collaboration tools that spawn Codex agents, and no setting removes them. A spawned Codex agent gets the same builtin tools as the agent that spawned it. - Codex's plan tool stays on for every agent, because Rome renders plan updates from it. `TodoWrite` grants nothing on Codex. - ChatGPT's apps open web pages and reach the accounts linked in ChatGPT, so only `WebFetch` grants them. An agent that declares `WebSearch` alone gets Codex's search and none of the apps. - Codex's bundled skills are off, so an agent sees only Rome's [skills](skills.md). The exception is `imagegen`, Codex's guide to its image tool, which an agent that declares `ImageGeneration` gets too. | Declared on Codex | Codex capability | |---|---| | `Read`, `Glob`, `Grep`, or `Bash` | The shell, with write access to the filesystem | | `Read` | Viewing a local image | | `Write`, `Edit`, `Read`, `Glob`, `Grep`, or `Bash` | Patches that write files | | `WebSearch` | Web search | | `WebFetch` | ChatGPT's apps, which open web pages and reach the accounts linked in ChatGPT | | `Task` | Codex's multi-agent tools, on models without collaboration tools | | `ImageGeneration` | Image generation, and Codex's `imagegen` skill | ## Structured output An agent may declare `outputSchema` when every model turn must end with data rather than free-form prose. Rome admits only the portable JSON Schema subset that both supported providers accept unchanged, then passes the schema to the provider's native structured-output API. **Contracts:** - `outputSchema` applies to each provider turn, including forked turns. It is not a signal that a multi-turn conversation will eventually produce data. - The provider owns constrained generation, validation feedback, and its internal retry policy. Rome does not add a second model retry loop. - A successful terminal `result` carries the validated value in `structuredOutput`. `content` is that value's JSON serialization. Missing, invalid, or retry-exhausted provider output fails the turn. - An `outputSchema` turn may not park on an interaction. - The rule a turn's result must meet is `shapedResult` in [`packages/core/src/agent/domain/answer-shape.ts`](../../packages/core/src/agent/domain/answer-shape.ts), which checks the answer through the `AnswerShape` port. **Not to be confused with:** - **[Action](actions.md)** — an action is code that runs. An agent is the LLM-backed entity that decides to run it. - **[Session](sessions.md)** — the session is the durable boundary around a body of agent work. The agent is the configured entity doing the work. - **[Guardian](../design/access.md)** — the agent has its own identity (name, personality), separate from the human it serves. ## Agent hierarchy Agents form a hierarchy with one orchestrator: the **main agent** handles messages directly or delegates to role-restricted subagents (quick tasks, read-only exploration, building Rome apps). The coding agent builds and installs apps only, so the main agent does other coding work itself. The coding agent is a subagent, so the chat shows its progress while it runs, and a follow-up in the same chat continues its session. Routines, workflows, and agents that do not list the coding subagent start the same agent through the `coding:coding_task` [action](actions.md). The coding agent plans its own work before it edits code.