---
title: "How Deterministic Controls Turn AI Output Into Reliable Prompt Templates"
description: "Salesforce’s Assistive Authoring aimed to reduce prompt-template creation from 25 minutes to under a minute by using Agent Graph. A router node dispatches natural-language requests to specialized sub-agents for creation, refinement, or clarification while state variables carry context. Deterministic controls prevent the LLM from corrupting routing, record identity, or structured output through guarded transitions and a server-side transpose layer. A discovery service normalizes available data fields into an allowlist, and the LLM can only select from validated references. A human-in-the-loop gate ensures the agent never saves or executes, presenting output as an accept-or-reject diff only."
---

# How Deterministic Controls Turn AI Output Into Reliable Prompt Templates

[Salesforce](https://yomu.fyi/company/salesforce) · Scott Nyberg · Sep 30, 2026

**Type:** Explainer

## Summary

Salesforce’s Assistive Authoring aimed to reduce prompt-template creation from 25 minutes to under a minute by using Agent Graph. A router node dispatches natural-language requests to specialized sub-agents for creation, refinement, or clarification while state variables carry context. Deterministic controls prevent the LLM from corrupting routing, record identity, or structured output through guarded transitions and a server-side transpose layer. A discovery service normalizes available data fields into an allowlist, and the LLM can only select from validated references. A human-in-the-loop gate ensures the agent never saves or executes, presenting output as an accept-or-reject diff only.

## Context

Salesforce’s Prompt Builder allows admins to create reusable prompts with dynamic placeholders grounded in CRM data. Building a template required expertise in merge fields and Jinja syntax, taking at least 25 minutes. The goal was to let admins describe a requirement in plain English and get a functional template in under a minute.

## Approach / What changed

The team used Agent Graph, an orchestration framework, to divide creation and refinement into focused nodes with deterministic routing, identity preservation, and structured output. A router node dispatches requests to specialized sub-agents. A discovery service normalizes available data into an allowlist. A transpose step wraps template metadata in sentinel tags for structured parsing. A human-in-the-loop review gate prevents the agent from saving or executing.

## Takeaways

- LLM should not control routing, record identity, or structured output; these must be handled deterministically by the orchestration framework.
- A discovery service that normalizes available data fields and reduces them to an allowlist based on user permissions is essential to prevent hallucinations.
- Human-in-the-loop safety with accept-or-reject diffs and sentinel tags ensures the agent only proposes drafts and never executes or saves.

## FAQ

### How does the system prevent LLM hallucinations?

It uses a discovery service that normalizes available data fields into a consistent shape and reduces them to an allowlist based on relevance and user permissions. The LLM is constrained to select from validated data only, preventing invented fields or references.

### What is the role of Agent Graph?

Agent Graph provides deterministic orchestration by routing requests to specialized sub-agents, controlling execution order, and managing state variables. It ensures the LLM only interprets intent while the graph governs transitions and tool calls.

### How does the human-in-the-loop safety work?

The agent generates templates wrapped in sentinel tags. The client extracts only the tagged JSON and parses it. The template appears as an accept-or-reject diff; the agent has no tool to save or execute, so the admin must approve manually.

**Tags:** [AI](https://yomu.fyi/topic/ai), [AI Agents](https://yomu.fyi/topic/ai-agents), [LLMs](https://yomu.fyi/topic/llm), [Prompt Engineering](https://yomu.fyi/topic/prompt-engineering), [Salesforce](https://yomu.fyi/topic/salesforce)

- Source: [Salesforce](https://engineering.salesforce.com/how-deterministic-controls-turn-ai-output-into-reliable-prompt-templates)
- Source URL: https://engineering.salesforce.com/how-deterministic-controls-turn-ai-output-into-reliable-prompt-templates
- Ingested by Yomu: 2026-10-01T15:00:09.679Z

[Read original post](https://engineering.salesforce.com/how-deterministic-controls-turn-ai-output-into-reliable-prompt-templates)
