Creating Your First Prompt
Creating prompts in the Playground is straightforward. Follow these steps:- Choose a Model from the dropdown menu
- Add System Message to define your model’s behavior and role
- Add User Message with your query or input
- Configure Parameters like creativity, response length, guardrails, or structured output
- Hit Run to test your prompt and see the response
- Save Your Prompt to capture all configurations as a reusable template

Saving Your Prompt
When you’re satisfied with the results, click theSave
button. Choose:
- ML Repo: Select where to store your prompt (ML Repos act as organized storage units)
- Name: Give your prompt a clear, descriptive name
- Commit Message: Add optional notes about this version


Working with Existing Prompts
Loading Saved Prompts
Instead of starting from scratch, you can load existing prompts that you have access to. This allows you to:- Build on previous work
- Collaborate with team members
- Continue from where you left off

model parameters, guardrails, structured output settings, variables,
and routing configurations
.

Understanding Prompt Versions
TrueFoundry automatically tracks every change you make to a prompt template. This versioning system lets you:- Experiment freely - try different variations without losing what works
- Maintain complete history - see how your prompts evolved over time
- Collaborate safely - work with others without conflicts
Finding Your Prompts
Access all your prompts through thePrompt Registry
, where you can view any prompt you have read or write permissions for.

versions and configuration details
. You can load any version directly into the playground for further editing.

Advanced Prompt Configuration
Enhance your prompts with powerful configuration options that make them more effective, safe, and intelligent.Guardrails - Add Safety Controls
Guardrails - Add Safety Controls
Guardrails help ensure your model responses stay appropriate and on-topic. Simply select the guardrails you want from the playground interface.Learn more: Guardrails and Security Overview



Routing Config - Smart Model Selection
Routing Config - Smart Model Selection
Routing Config enables you to apply routing policies at the gateway layer using which you can enable load-balancing, fallback and retries across the models.Learn more: Routing Configuration Overview



Structured Output - Consistent Formatting
Structured Output - Consistent Formatting
Get responses in specific formats like JSON or custom schemas. You can:
- Describe the format you want and let the agent create the schema
-
Paste your own schema for consistent, structured responses
MCP Servers - Extended Capabilities
MCP Servers - Extended Capabilities
MCP Servers extend your AI’s capabilities beyond text generation, allowing access to external tools, databases, and services for more powerful workflows.



Input Variables - Dynamic Content
Input Variables - Dynamic Content
Create reusable prompts with variables like
{customer_name}
or {product_type}
that change based on context. This makes your prompts:- Dynamic: Adapt to different scenarios
- Scalable: Handle multiple use cases with one template
-
Maintainable: Update once, apply everywhere
Your Complete Prompt Template
After adding configurations, your prompt becomes a comprehensive template with all your settings:
Using Prompts in Your Code
TrueFoundry automatically generates code snippets for each prompt version. Access these by visiting the prompt details page and switching to theUse in Code
tab.


Recommended: Use prompts via the TrueFoundry AI Gateway by passing the prompt version FQN in the request body. The Gateway takes care of rendering, and execution automatically.Alternative: Prompts can also be used by fetching the template and rendering it client-side before sending it to the model.