Skip to main content

Version a prompt and ship it to production

What you'll build: a support-reply prompt with two committed versions, production pointing at the version you choose, and app code that renders it — so you can change the live prompt later without redeploying.

1. Create the prompt

On Prompts, click New prompt. A prompt is just a named container for versioned templates.

Empty Prompts list

Name it support-reply. The name is your SDK lookup key, so lowercase-with-hyphens works well.

New prompt dialog

2. Author and commit v1

In the Editor, add a system message and a user message. Use {{ variables }} where runtime input goes:

Prompt editor with system and user messages

system: You are a friendly, concise customer-support agent for {{ company }}.
Reply warmly and help the customer resolve their issue in 2-3 sentences.
user: {{ customer_message }}

Click Commit new version. Versions are immutable — this is v1. The first commit also auto-creates the production and staging aliases, both pointing at v1.

Versions tab showing v1

You can also create a prompt and commit a version over the API:

# Create the prompt
curl -X POST "$ACRUXCORE_BASE_URL/prompts" \
-H "Authorization: Bearer $ACRUXCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"support-reply","description":"Drafts a friendly support reply"}'

# Commit a version
curl -X POST "$ACRUXCORE_BASE_URL/prompts/support-reply/versions" \
-H "Authorization: Bearer $ACRUXCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role":"system","content":"You are a friendly, concise customer-support agent for {{ company }}. Reply warmly and help the customer resolve their issue in 2-3 sentences."},
{"role":"user","content":"{{ customer_message }}"}
]
}'

3. Commit v2

Edit the system message — say, add "Always end with a clear next step." — and Commit new version again. You now have v1 and v2. Note that committing v2 did not move production: both aliases still point at v1. A commit never silently changes what's live.

Versions tab showing v2 and v1

4. Promote v2 to production

On v2, click → production. Acrux Core confirms the change, because it takes effect immediately for anything reading the production alias.

Promote-to-production confirmation dialog

Confirm. production now points at v2 while staging stays on v1 — so you can keep testing v1 (or a future v3) on staging without touching production.

Production alias now on v2

Promotion is also one API call:

curl -X POST "$ACRUXCORE_BASE_URL/prompts/support-reply/aliases/production/promote" \
-H "Authorization: Bearer $ACRUXCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"version_number": 2}'

5. Render it from your app

Your app asks for the prompt by name and alias and gets back rendered messages. Because it reads production, promoting a new version changes the output with no code change.

curl -X POST "$ACRUXCORE_BASE_URL/prompts/support-reply/production/render" \
-H "Authorization: Bearer $ACRUXCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"variables":{"company":"Acme","customer_message":"Where is my order #123?"}}'
{
"messages": [
{"role":"system","content":"You are a friendly, concise customer-support agent for Acme. ... Always end with a clear next step."},
{"role":"user","content":"Where is my order #123?"}
],
"tools": []
}

What's next