Prompt Hub
Prompt Hub is EvalGate’s organization-scoped registry for reusable message prompts. A prompt has a stable key, while every saved definition becomes a new immutable version with its own numericversionId, monotonically increasing version number, and SHA-256 contentHash.
Use Prompt Hub when the same prompt must remain exactly attributable across Playground tests, experiments, traces, deployments, evaluations, online evaluations, model calls, and Evals-as-Code.
An environment alias resolves one exact
versionId and contentHash. Production and staging never fall back to a draft or to the newest version.Permissions and entry points
Open Prompt Hub at/prompts. Select a prompt to open its version workbench at /prompts/{promptId}.
All reads and writes are organization-scoped. A prompt or version from another organization is not disclosed.
What a prompt version contains
The workbench treats the following fields as one content-hashed definition:- Ordered messages with stable IDs, roles, optional names, and template content
- Typed variables with required flags, descriptions, and JSON defaults
- JSON Schema input and optional output contracts
- Provider, model, or routing-key defaults resolved by the Model Gateway
- Generation parameters such as temperature, token limit, and seed
- Tool names, descriptions, strictness, and JSON Schema input contracts
- Response format, data policy, fallback policy, and tags
Author a complete definition
- Open
/promptsand choose New prompt. - Enter a stable lowercase key such as
support.answer, a display name, and the initial message template. - Open the prompt and use Messages to add, remove, or edit ordered message roles, IDs, names, tool-call IDs, and content.
- Use Configure to author variables, input/output schemas, tools, model defaults, parameters, response format, tags, and runtime policies.
- Resolve every
{{variable}}reference and correct every schema/configuration warning. - Choose Save as new version. The workbench records the selected version as the lineage parent.
json_schema block the save.
Secrets and custom endpoints
Do not place provider keys, bearer tokens, or other literal secrets in message or tool content. Prompt validation rejects common literal-secret patterns. Store provider credentials in Model Gateway configuration and refer to durable configuration keys. Provider, model, and routing fields do not accept URL values. Custom inference endpoints must be configured through the Model Gateway, which applies its egress and SSRF validation before a prompt can use them.Test an exact version
The Test tab accepts a JSON object that must satisfy the selected version’s input schema. A test:- Resolves defaults and fails if a required value remains unresolved.
- Renders the selected immutable message list.
- Sends the rendered messages, model/routing defaults, parameters, tools, and response format through the Model Gateway.
- Writes a model-call ledger record and a
playgroundprompt-usage link. - Returns the exact prompt
versionId,contentHash, resolved messages, model-call ID, status, latency, and cost attribution.
Compare, review, and approve
Use Compare to compare a version with its lineage parent. The semantic diff reports changed definition paths and message additions, removals, or edits. Approval warnings call out required-variable additions, type changes, variable/tool removals, model/routing changes, and output-schema changes. The lifecycle is:reviewRevision that you read. If another actor transitions the version first, the stale request fails with 409 instead of overwriting the newer state. Each transition appends a review-history event with actor, rationale, revisions, timestamp, and idempotency key.
Approval does not publish a version. It only makes the exact version eligible for a protected environment.
Publish to an environment
Use Deploy to inspect environment aliases. Publishing requires:- The exact target
versionId - The alias
expectedBindingVersionIdcurrently loaded by the client, ornullwhen unbound - The loaded
expectedBindingRevision - A unique idempotency key
staging, prod, and production are protected. They accept approved versions only. The alias move and append-only environment event are written atomically. A stale expected version or revision returns 409; no partial history event is written.
The Usage tab makes the current production and staging bindings visible with exact version IDs, full content hashes, and alias revisions. An unbound protected environment explicitly reports that no version resolves.
Roll back safely
Rollback changes only the environment alias; it never edits or deletes either prompt version.- Open Deploy and choose Rollback for a bound environment.
- Confirm the exact current and target version IDs in the dialog.
- Submit the loaded binding version and revision.
Resolve and render in an application
Resolve by prompt artifact and environment:404 ENVIRONMENT_UNBOUND; it does not return a draft.
Render with typed input:
versionId and contentHash and adds resolvedMessages. Invalid or unresolved input returns a validation error before model egress.
Cross-surface attribution
Every consumer records bothversionId and contentHash; a key or environment name alone is not sufficient evidence.
Usage insertion rejects a content hash that does not match the referenced immutable version. Repeating the same surface/resource/version identity is idempotent. The Usage view aggregates quality, attributed cost, unknown-cost samples, and latency per exact version rather than merging different versions under the stable key.
API workflow
Mutations that create versions or history accept an
Idempotency-Key header. Reusing a key for a different payload returns an idempotency conflict.
Failure behavior
Troubleshooting
- If save is disabled, inspect the validation panel in Messages and Configure. Fix invalid JSON before changing tabs.
- If render fails, compare the submitted object with the exact version’s input schema and required variables.
- If approval or publish is stale, reload the workbench and use the latest review or alias revision. Do not blindly retry with a changed expectation.
- If a test fails, open its model-call ledger link and inspect Gateway routing, provider health, budget/policy decision, and redacted provider error.
- If cost is unknown, confirm the selected model exists in the synchronized catalog with current pricing metadata.
- If production is unbound, approve a version and publish it explicitly. Creating or saving a newer draft will not change production.
tests/unit/prompts, tests/api/prompts, tests/integration/prompts, tests/dom/prompts, and e2e/prompt-hub-golden-path.spec.ts.