Skip to main content
Prompts in Output live in .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
A prompt file has two parts: YAML frontmatter (configuration) and message blocks (the actual prompt content).

File Naming

Prompt files use the pattern name@version.prompt:
  • generate_summary@v1.prompt
  • judge_summary@v1.prompt
  • classify_lead@v2.prompt
The version lets you iterate on prompts while keeping old versions around. When you reference a prompt in code, use the name without the .prompt extension:
Output searches recursively from your workflow’s directory to find the prompt file.

File Organization

Place prompt files in a prompts/ subfolder within your workflow directory:
The recursive search means you can also keep prompts alongside your workflow code if you prefer a flatter structure. For prompts used by multiple workflows, create a shared prompts/ folder at a higher level.

Frontmatter

The YAML frontmatter configures the LLM call.

Required Fields

Optional Fields

All fields use camelCase. Using max_tokens instead of maxTokens will fail validation.

Configuration Structure

Prompt configurations have two layers: 1. Top-level config — Standard AI SDK options:
2. providerOptions — Provider-specific and special options:
When to use providerOptions:
  • Provider-specific options that aren’t standard across all providers
  • Special AI SDK extensions like thinking or order (AI Gateway)
  • Multi-provider configurations (Vertex with multiple model types)
When NOT to use providerOptions:
  • Standard options: temperature, maxTokens, topP, etc.
  • These go at the top level alongside provider and model

Provider Options

Use providerOptions for provider-specific configuration. Anthropic-specific options:
OpenAI-specific options:
Vertex with Gemini (important namespace note):
Extended thinking (special top-level key):
Common Provider Options Reference: Vertex Provider Namespace Guide: When using 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:
The 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”)
User message (varies per request):
  • The specific request
  • The data to process
  • Dynamic instructions based on input
This separation makes prompts easier to maintain. When you need to change the task, you edit the user message. When you need to change behavior, you edit the system message.

Using Prompts

Call prompts from your steps using the generate functions from @outputai/llm.

With generateText

For single-shot LLM calls, use generateText:
steps.ts
generateText also supports skills for on-demand instruction loading:

With Agent

For multi-step tool loops and stateful conversations, use the Agent class:
steps.ts
Use generateText for single-shot LLM calls. Use Agent when you need multi-step tool execution, conversation history, or a reusable agent instance. See the Agents section for the full API. The variables object maps to the {{ variable }} placeholders in your prompt. For dynamic content like conditionals and loops, see Templating.