Template
A template is a Canvas — a piece of reusable prompt logic. Each template has:- A name and description — surfaced to agents in
list_templatesso they can pick the right one. - A key — a stable identifier (
user-templates/my-deal-readout,drafts/follow-up, or one of Deal Brain’s system keys likedaily-brief). Agents call templates by key. - A body — the structured content, written as blocks and variable tokens.
- A scope — who can see it.
- A status — whether it’s published.
Block
A block is a structural element inside a template body. Canvas supports the blocks you’d expect from any rich editor:| Block | When to use |
|---|---|
| Paragraph | Default. Free prose. |
| Heading (H1–H3) | Section the output. |
| Bulleted list / Numbered list | Enumerate items. Lists support nesting and auto-format on enter/backspace. |
| Blockquote | Pull-quote or callout. |
| Horizontal rule | Visual section break. |
enter to add a block below; backspace at the start of an empty block to merge with the one above.
HTML insertion (paste-from-web with formatting) is intentionally disabled in the current Canvas release pending a security review. Plain-text paste works as expected.
Variable token
A variable token is an inline placeholder. Type# anywhere in the editor to open the picker. Variables come in two flavors:
Data variable
A value pulled from your Deal Brain data layer at render time. Examples:
opportunity name, account name, current stage, last meeting summary, any custom field you’ve defined.Renders inline as a blue chip in the editor. At render time the chip is replaced with the live value.Instruction variable
A model directive — not data. Examples: “Write 3–5 sentences in a confident tone”, “Do not invent participants not present in the transcript”, “Limit to bullet points; no prose.”Renders as a chip with an instruction icon. At render time the chip becomes a hidden directive to the LLM, not literal output.
Scope
A template’s scope controls who can see and call it. There are three scopes, in precedence order:System (Preset)
Authored and maintained by Deal Brain. Shipped to every workspace. Read-only — you can clone a System template into your Organization or User scope to customize it, but you can’t edit the System version directly.Examples:
daily-brief, meeting-debrief, draft-follow-up.Organization (Team)
Authored by anyone in your organization. Visible to everyone in the org. Used to standardize how the team writes briefs, debriefs, and outbound — “every AE in our org uses this readout template.”An Organization template with the same key as a System template overrides the System version for everyone in the org.
generate_template by key, Deal Brain resolves the most-specific scope visible to that user.
Status
A template’s status controls whether it’s discoverable and callable:| Status | What it means |
|---|---|
Draft | Author-only. Invisible to list_templates. Cannot be rendered by agents. Use draft while you’re iterating. |
Active | Published. Visible to list_templates and callable by generate_template. |
How they fit together
A complete template combines all five:generate_template({ key: "user-templates/opportunity-readout-3p", opportunityId: "..." }), Deal Brain:
- Resolves the template (User > Org > System scope precedence).
- Verifies it’s
Active. - Binds the opportunity to the
datavariables. - Returns the system prompt plus the rendered body, ready to send to the model.
Variables, deep dive
Data variables, instruction variables, and the catalog.
Publishing & scope
The Draft → Active workflow and how scope precedence resolves.

