AI prompts
Re-voice every prompt the product injects into AI runs from one config module.
A run's system prompt comes from two surfaces. The agent persona is the assistant agent's own inline instructions (packages/api/src/mastra/agents/assistant/config.ts) - see Agents to re-voice it. Layered on top are the injected prompt strings this page documents: every one lives in packages/config/src/ai/prompts.ts (@repo/config/ai/prompts). Edit a value, restart, done - no other file defines injected prompt copy. The module is env-free, so it can be imported directly from any surface without the env-reading config index; backend packages consume it today.
The keys
aiPrompts is a flat record; each key is injected at exactly one seam.
| Key | Injected |
|---|---|
capability | Prepended to a run's system prompt when it can act: chat and scheduled runs when their toolset is non-empty, companion runs always. |
compactionSummary | System prompt for conversation compaction runs. |
mcpInstructions | Usage instructions the product MCP server advertises to connected agents on initialize. |
terminalPreamble | Opens the instructions of an interactive companion terminal session, before the system prompt: it tells the user's own CLI it is running inside the product and reaches the product's tools over MCP. |
How the system prompt is assembled
The agent always contributes its persona (its inline instructions). On top of that, one composer (packages/api/src/ai/compose-system.ts) adds the capability nudge - but only when the run actually has app tools. It is passed to the agent as the per-call system option: chat and scheduled runs include it when their toolset is non-empty; companion runs always include it. A run with no app tools adds no nudge, leaving just the persona. Because chat and scheduled runs share this exact path, a scheduled run carries the same persona and nudge as chat.
Built-in schedule prompts
A scheduled run's prompt is not one of these keys - each built-in schedule carries its own prompt in the schedules registry. See Built-in schedules.
Agents
Author, rename, and extend the assistant - a Mastra agent. Register in code, add AI SDK tools, give it MCP clients and inline skills, and re-voice its persona. Our seams only; Mastra's own docs cover the rest.
AI integrations
The shared integration catalog the web AI can act on, its entry anatomy, and how a connector attaches.