Skip to content

Prompty Specification

The Prompty Runtime Specification defines the runtime behavior of Prompty — a markdown file format and execution pipeline for LLM prompts. It is language-agnostic: implementations in any programming language MUST conform to the behavioral contracts defined here.

This specification is intended for implementers building Prompty runtimes in any language. It defines the behavioral contracts that all implementations must satisfy. For user-facing guides on using Prompty, see the Getting Started section.

Version: 0.1.0-draft · Status: Draft

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

§TitlePage
1Overview & Architecture§1 Overview & Architecture
2File Format§2 File Format
3Tracing§3 Tracing
4Loading§4 Loading
5Rendering§5 Rendering
6Parsing§6 Parsing
7Wire Format§7 Wire Format
8Processing§8 Processing
9Agent Loop§9 Agent Loop
10Streaming§10 Streaming
11Registries & Plugin Discovery§11 Registries & Plugin Discovery
12Cross-Cutting Concerns§12 Cross-Cutting Concerns

Implementations MUST expose the following functions. Each function MUST have an async variant (e.g., load_async). Each function SHOULD have a sync variant.

FunctionSignatureReturnsSpec Section
load(path: string) → PromptAgentPromptAgent§4
render(agent, inputs) → stringRendered string§5
parse(agent, rendered) → Message[]Message list§6
prepare(agent, inputs) → Message[]Message list§5 + §6
run(agent, messages) → resultProcessed result§7 + §8
invoke(path, inputs) → resultProcessed result§4§8
invoke_agent(path, inputs, tools?) → resultProcessed result§4§8 + loop
process(agent, response) → resultExtracted result§8
validate_inputs(agent, inputs) → validated_inputsValidated dict§12

Async contract: All pipeline functions MUST have async variants. Implementations SHOULD also provide sync variants. When both exist, they MUST produce identical results for the same inputs.

This specification uses three conformance levels:

  • MUST — An absolute requirement. An implementation that does not satisfy a MUST requirement is non-conformant.
  • SHOULD — Recommended but not required. An implementation may omit a SHOULD requirement with good reason, but the implications must be understood.
  • MAY — Truly optional. An implementation may provide or omit a MAY feature freely.