Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 5 of 7

Prompt templates and the prompt registry

8 min

Listen to this lesson

0:00 / 6:33

In a prototype, the prompt lives in code. In production, the prompt is a configuration item that changes more often than the code around it, and every change can alter behavior. SAP's prompt registry is the generative AI hub's answer: it manages "the life cycle of your prompts, from design to runtime" for both prompt templates and complete orchestration configurations.

Templates and placeholders

A prompt template is a set of messages with placeholders, for example a system message with the role and constraints and a user message with {{?idoc_status}}, {{?segment_extract}} and {{?runbook_context}}. At run time the application supplies the placeholder values and orchestration fills them. Templates can carry defaults, and SAP AI Launchpad's prompt editor lets designers try a template before it is stored.

Two interfaces: imperative and declarative

InterfaceHow it worksSAP's recommended use
Imperative APIFull create, read, update and delete operations; every iteration is tracked and visible in the history endpointDesign time: refining templates
Declarative APITemplates kept in a Git repository; commits synchronize automatically to the prompt registry through SAP AI Core applicationsRuntime use cases and CI/CD pipelines

The two prompt registry interfaces as documented on SAP Help.

Orchestration configurations can be stored too, as reusable, versioned assets with history and import and export. A stored orchestration config can reference a prompt template by ID or by name, scenario and version, and completion requests can reference the stored config instead of sending the whole configuration inline. SAP notes that orchestration configs are available through the imperative API and are managed at tenant level. Since August 2026, templates and configs can be listed in pages, which helps once a tenant holds many of them.

Contoso's prompt lifecycle: templates in Git, synchronized to the registry, tested before the application uses a new version.
The Sign-Off Table · thesignofftable.com/academy/sap-ai-203

Testing a prompt change

A prompt change is a code change without a compiler. Treat it like one: version it, review it, test it against a fixed regression set, then release it. Contoso keeps 40 representative failed IDocs (synthetic data built from CMQ test cases) with an expected classification and the key facts the explanation must contain. A change passes only if classification accuracy doesn't drop and every expected fact still appears. Changing the model version triggers the same run.

Prompt optimization

The hub can also improve a prompt for you. Prompt optimization takes a template from the prompt registry and a JSON dataset of desirable responses in an object store, and optimizes the prompt to maximize a metric you choose; metrics are tracked in the ML Tracking Service, and the optimized prompt is saved back to the registry. SAP's caveats are worth repeating: it is model-specific, runs can take "from minutes to multiple hours", they submit a large number of requests to the target model (with costs), and Mistral and DeepSeek models are not supported. Custom metrics are supported as LLM-as-a-judge metrics with numeric or Boolean output.

  1. TemplateHand-written template stored in the prompt registry
  2. DatasetJSON examples of desirable responses in a registered object store
  3. MetricBuilt-in or custom LLM-as-a-judge metric (numeric or Boolean)
  4. ExecutionOptimization run against one target model; minutes to hours; many billed requests
  5. ResultOptimized prompt saved to the registry; review and run the regression set before use
From hand-written prompt to optimized, registered version.
The Sign-Off Table · thesignofftable.com/academy/sap-ai-203

What would you do?

Theo changes one sentence in the IDoc Explainer's system message to make answers shorter. Users like the shorter answers. Two weeks later Maria notices the app no longer names an owner for master data errors. What process failure allowed this?

Key points
  • Prompt templates use {{?placeholders}} filled at run time; the prompt registry manages templates and orchestration configs.
  • Imperative API for design-time iteration with history; declarative API with Git sync for runtime and CI/CD.
  • Version, review and regression-test every prompt and model change before release.
  • Prompt optimization improves a prompt against a metric and dataset; it can take hours and cost requests, and still needs review.

Check your understanding · not graded

Lesson check

  1. 1. Which prompt registry interface does SAP recommend for runtime use cases and CI/CD?

  2. 2. What can a stored orchestration config reference?

  3. 3. Which models does SAP list as not supported for prompt optimization?

  4. 4. What should happen before an optimized prompt is used in production?