Injection Tokens
Injection tokens are the placeholders that let a single prompt template work for any brand and any piece of content. They look like {{brand:name}} or {{content:body}}, and at run time m18t fills them with the real values. This article explains the syntax, the namespaces, the green/amber readiness badges, and how optional sections drop out when a value is missing.
What you'll learn
- The
{{scope:token}}syntax and the namespaces available. - What the green and amber token badges mean in the prompt editor.
- How optional
{{#if}}sections drop out cleanly when a value is empty.
The concept: one template, real data
A prompt template is generic on purpose. The news rewrite prompt doesn't hard-code one article — it says "rewrite the following: {{content:body}}". When you run it, m18t replaces {{content:body}} with the actual article body. That substitution is what an injection token does.
Tokens are namespaced: the part before the colon says where the value comes from, and the part after names the specific field. Verified against m18t's prompt engine, the namespaces are:
brand:—{{brand:name}},{{brand:primary_locale}},{{brand:domain}},{{brand:slug}}, plus the Brand AI Profile fields:{{brand:positioning}},{{brand:voice}},{{brand:rules}},{{brand:glossary}}.content:—{{content:title}},{{content:body}},{{content:excerpt}},{{content:type}},{{content:locale}}.seo:—{{seo:canonical_url}},{{seo:schema_type}},{{seo:default_keywords}}(resolved for SEO prompts).tags:—{{tags:topics}},{{tags:audiences}}.news-source:—{{news-source:name}},{{news-source:url}},{{news-source:description}},{{news-source:published_at}}.
The set of tokens that's relevant depends on the prompt's category. A content or social prompt offers the brand, content, and tags tokens; a news prompt also offers the news-source tokens; an SEO prompt offers the canonical-URL token. The prompt editor shows you the applicable set as clickable badges.
A note on syntax: the engine resolves namespaced
{{scope:token}}placeholders. An unknown token resolves to an empty string rather than printing the literal{{...}}— so a typo fails quietly to blank, not to garbage in the output.
Green and amber: token readiness
When you open a prompt for a brand, each available token shows as a badge with a colour. The colours tell you whether the token will actually produce a value for this brand:
- Green — the active brand has a value for that field. The token will be filled.
- Amber — the field is empty for this brand. The token will be ignored (it resolves to blank) until you fill it in.
Amber is most common on the Brand AI Profile tokens — {{brand:voice}}, {{brand:rules}}, {{brand:glossary}} — for a brand that hasn't filled those fields yet. The fix isn't to change the prompt; it's to fill the field in the brand's AI Profile. The editor says as much: amber tokens have no value in the brand's AI profile yet and will be ignored, so fill them in the brand's settings.
Clicking a token badge inserts it at your cursor in whichever prompt area you last focused — a quick way to build a template without typing the braces by hand.
Optional sections that drop out cleanly
Sometimes you want a whole sentence to appear only when a value exists — not just the value itself. For that, m18t supports a conditional block:
{{#if brand:voice}}Write in this brand's voice: {{brand:voice}}.{{/if}}
If brand:voice has a value, the block stays and the token fills in. If it's empty, the entire block is removed — the label, the token, and the surrounding prose all go together. You never end up with a dangling "Write in this brand's voice: ." with nothing after it.
This keeps templates clean across brands with different amounts of profile data. A brand that hasn't written a Glossary doesn't get the Glossary sentence; a brand that has, does. Blank-handling is consistent with how the Brand AI Profile preamble already skips empty fields.
Conditional blocks are a flat list of independent optional sections — they aren't designed to nest inside one another. Keep each {{#if}}...{{/if}} self-contained.
How to use tokens in a prompt
- Open a prompt at Configuration ▸ AI Prompts (
/studio/config/prompts). For a Locked platform prompt you'll need to customize it first; new prompts are editable from the start. - Look at the Available Injection Tokens badges. Green = filled for this brand, amber = empty/ignored, with a tooltip explaining each.
- Click a badge to insert that token at your cursor, or type it as
{{scope:token}}. - For a sentence that should only appear when a value exists, wrap it in
{{#if scope:token}}...{{/if}}. - Save. On the next run, m18t fills the tokens from the active brand and the content you're working on.
Variations
- Untrusted content is fenced. Tokens that carry external text — a scraped
{{content:body}}, a{{news-source:description}}— have their values wrapped and labelled as data so the model treats them as material to process, not as instructions. This is a defense-in-depth measure for the news pipeline, handled for you. - SEO canonical injection. For SEO-category prompts,
{{seo:canonical_url}}is resolved from the brand's domain and content-type settings and injected with an explicit "don't invent URLs" instruction. See The SEO AI Prompt. - Tags resolve to names.
{{tags:topics}}and{{tags:audiences}}resolve your selected tag IDs into a readable, comma-separated list of names.
FAQ
Why is a token badge amber? The active brand has no value for that field yet, so the token will be ignored on this run. Fill the field — usually in the Brand AI Profile — and the badge turns green.
What happens if I use a token that has no value?
It resolves to an empty string. If you wrapped it in a {{#if}} block, the whole block drops out instead, so you don't get a stray label with nothing after it.
What's the difference between {{token}} and {{#if token}}...{{/if}}?
The first inserts a value (or blank). The second keeps or removes an entire section depending on whether the token has a value. Use {{#if}} for sentences that should only appear when there's something to say.
Can I make up my own token? Tokens map to known namespaced fields. An unrecognized token resolves to blank rather than appearing literally — so a typo won't break the output, but it also won't inject anything. Stick to the namespaces above.
Where do brand-profile tokens get their values?
From the brand's AI Profile: {{brand:voice}}, {{brand:rules}}, {{brand:glossary}}, {{brand:positioning}}. Fill those fields in the brand's settings.
What's next
- How AI Prompts Work — the templates these tokens fill.
- The Brand AI Profile — where the
brand:profile tokens get their values. - Customizing a Prompt — editing a template to add tokens.
- The SEO AI Prompt — canonical-URL token injection in action.