.prompt files inside a prompts/ folder — version-controlled, reviewable, and deployed with your code. No more strings scattered across your codebase or prompts locked in external dashboards.
generate_summary@v1.prompt
File Naming
Prompt files use the patternname@version.prompt:
generate_summary@v1.promptjudge_summary@v1.promptclassify_lead@v2.prompt
.prompt extension:
File Organization
Place prompt files in aprompts/ subfolder within your workflow directory:
prompts/ folder at a higher level.
Frontmatter
The YAML frontmatter configures the LLM call.Required Fields
| Field | Description | Example |
|---|---|---|
provider | LLM provider | anthropic, openai, azure, vertex, bedrock |
model | Model identifier | claude-sonnet-4-20250514, gpt-4o |
Optional Fields
| Field | Description | Example |
|---|---|---|
temperature | Randomness (0-2) | 0 for judges, 0.3 for summaries, 0.7 for general |
maxTokens | Max output tokens | 2000 |
providerOptions | Provider-specific config | See below |
max_tokens instead of maxTokens will fail validation.
Configuration Structure
Prompt configurations have two layers: 1. Top-level config — Standard AI SDK options:- Provider-specific options that aren’t standard across all providers
- Special AI SDK extensions like
thinkingororder(AI Gateway) - Multi-provider configurations (Vertex with multiple model types)
- Standard options:
temperature,maxTokens,topP, etc. - These go at the top level alongside
providerandmodel
Provider Options
UseproviderOptions for provider-specific configuration.
Anthropic-specific options:
| Provider | Option | Namespace | Description |
|---|---|---|---|
| Anthropic | effort | anthropic: | Reasoning effort: low, medium, high |
| OpenAI | reasoningEffort | openai: | Reasoning effort for o1 models |
| OpenAI | maxToolCalls | openai: | Maximum tool calls per turn |
| Vertex (Gemini) | useSearchGrounding | google: | Enable Gemini search grounding |
| Vertex (Claude) | effort | anthropic: | Claude models on Vertex use anthropic namespace |
| AI SDK | thinking | Top-level | Extended thinking (not under provider) |
| AI Gateway | order | Top-level | Provider routing order |
provider: vertex, the providerOptions namespace depends on the model:
- Gemini models → Use
google:namespace - Claude models → Use
anthropic:namespace - Vertex-specific options → Use
vertex:namespace
Message Blocks
Message blocks use XML-style tags to define the conversation structure.<system>
The system message sets the persona and constraints. It defines who the LLM is and how it should behave. This stays constant across requests.
<user>
The user message is the actual request — what you want right now. This typically contains your variables.
<assistant>
The assistant block is for conversation history or response prefilling. Use it when you want to prime the model’s response format:
<tool>
The tool block is for tool/function call results in multi-turn conversations:
name attribute identifies which tool was called, and id matches the original tool use request.
System vs User
A common mistake is putting everything in the user message. The split matters: System message (constant):- Who the LLM is (“You are a sales research assistant”)
- Behavioral constraints (“Never make up information”)
- Output format requirements (“Respond in JSON”)
- The specific request
- The data to process
- Dynamic instructions based on input
Using Prompts
Call prompts from your steps using the generate functions from@outputai/llm:
steps.ts
variables object maps to the {{ variable }} placeholders in your prompt. For dynamic content like conditionals and loops, see Templating.