RACE Prompt Framework: Complete Guide with Examples (2026)
Last updated June 28, 2026 · 3 examples · Works with ChatGPT, Claude, Gemini
Quick Answer
RACE is a four-part prompt engineering framework: Role assigns the AI a persona, Action defines the task, Context provides background, and Expectation specifies format and constraints. It is the most widely used general-purpose prompt framework — fast to write and effective across all major AI models.
What Is the RACE Prompt Framework?
The RACE framework structures AI instructions into four labeled components. Rather than writing a wall of text, RACE forces you to be explicit about who the AI is, what it should do, what background it needs, and what a good output looks like. The result is more reliable, targeted responses from any large language model.
What Does RACE Stand For?
The all-purpose framework for execution-focused tasks.
R
Role
The professional persona or expert identity you assign to the AI. Sets the knowledge base, tone, and perspective. Example: You are a senior UX researcher with 10 years of B2B SaaS experience.
A
Action
The specific task to perform. Use a clear imperative verb: Write, Analyze, Review, Summarize. Vague actions produce vague results.
C
Context
Background the AI needs to do the job well — audience, domain, constraints, what has not worked before. The most commonly skipped field and the most impactful.
E
Expectation
What a successful output looks like: format, length, tone, language, must-include or must-avoid items.
+R
Rules (optional)
Constraints that apply across all fields — e.g. Never use passive voice or Always respond in Dutch. Added by Promptary as an optional fifth field.
When to Use RACE
Use RACE when the task is self-contained and you want the AI to determine its own approach. It covers professional writing, code review, analysis, summarization, and most everyday tasks. If you need to specify the exact sequence of steps, switch to RISEN.
RACE Examples
Role: You are an experienced B2B SaaS copywriter who specializes in concise, benefit-driven product copy.
Action: Write a homepage hero section for a prompt engineering workspace.
Context: The product is Promptary. It lets developers write structured AI prompts, organize them visually, and serve them via REST API. Target users save prompts in Notion or text files today.
Expectation: One headline (max 8 words), one subheadline (max 20 words), three benefit bullets (max 12 words each). Conversational, no buzzwords.
Role: You are a senior Node.js engineer with deep knowledge of Express.js security best practices.
Action: Review the following API route handler for security vulnerabilities.
Context: Production Express.js API handling user authentication with JWT tokens in httpOnly cookies. Prior reviews flagged SQL injection and missing rate limiting.
Expectation: List each vulnerability with: name, severity (Critical/High/Medium/Low), one-line explanation, fix. Markdown table. If none found, say so explicitly.
Role: You are an executive assistant skilled at distilling discussions into actionable summaries.
Action: Summarize the following meeting transcript into an executive brief.
Context: 45-minute product strategy meeting between CEO, CTO, and Head of Product. Audience is the full company who did not attend.
Expectation: Three sections: Key Decisions (bullets), Open Questions (bullets), Action Items with owner and deadline. Max 300 words. Neutral tone.
RACE vs Other Frameworks
RACE vs RTF: RTF is faster (3 fields) but skips Context — usually the most impactful field. RACE vs RISEN: RISEN adds explicit Steps and Narrowing for complex multi-step tasks. RACE vs CO-STAR: CO-STAR excels at content writing where audience and style are the critical dimensions; RACE is more flexible for everything else.
Use this RACE template in Promptary — free
Save your first RACE prompt in the structured editor and get a permanent REST API endpoint. Personal plan is free forever, no credit card required.
Start free
Frequently Asked Questions
What does RACE stand for in prompt engineering?
RACE stands for Role, Action, Context, and Expectation. Each component structures a different dimension of your AI instruction: who the AI should be, what it should do, what background it needs, and what a successful output looks like.
When should I use RACE instead of RISEN?
Use RACE when the task is self-contained and you are comfortable letting the AI determine its own approach. Use RISEN when your task has multiple phases that must follow a specific sequence or when you need tight control over output scope.
Does RACE work with Claude, Gemini, and GPT-4?
Yes. RACE works across all major language models. Structured frameworks reduce ambiguity in the instruction, which benefits every model regardless of provider.
Can I save RACE prompts and call them via API?
Yes. Every prompt saved in Promptary gets a permanent REST API endpoint at GET /api/v1/prompts/:id. Update the prompt in the editor and every application calling the endpoint receives the updated text automatically.