Project releases

PromptLang v2 compiles a typed spec into a reproducible model request

The September 10 revival replaces a speculative prompt language with something narrower and checkable: a typed JSON specification compiles into an exact set of messages with a deterministic SHA-256, and user content never leaves the user role.

GitHub activity: · Published:

What it does

PromptLang takes a typed JSON specification plus your data and produces a model request that is the same every time. It checks the input contract before compiling and the output contract after, and it never calls a model or executes content itself.

The types are strict in a useful way: exact fields, finite numbers, int64 bounds. A malformed spec fails at compile time rather than producing a plausible request that quietly does the wrong thing.

What changed

Commit c5ed4a1, merged as pull request #2 on September 10, revives a 2023 repository as a v2 alpha: the typed compiler, deterministic SHA-256 provenance over the compiled messages, a safety boundary that keeps user content inside the user message with no eval, exact primitive output validation, a CLI, an official SDK stdio MCP server and MetaHarness governance.

The README states plainly that this implements a typed compiler, not the speculative language described in the historical README, and makes no learned-model or state-of-the-art claim.

Get started

Python 3.11 or newer and Node 22.16 or newer:

git clone https://github.com/ruvnet/promptlang.git
cd promptlang
python -m venv .venv
. .venv/bin/activate
python -m pip install .
echo '{"spec":{"instruction":"Summarize","inputs":{"text":"string"},"outputs":{"summary":"string"}},"values":{"text":"Hello"}}' | python -m promptlang compile

Expected result: a compiled message set printed to stdout with a deterministic hash, and no network call of any kind.

The MCP server runs through the harness runtime:

npm ci --prefix .harness/runtime
node .harness/runtime/cli.mjs status
node .harness/runtime/cli.mjs mcp

MCP clients launch node with the absolute repository path to .harness/runtime/cli.mjs and the argument mcp. Set RUV_PYTHON to an absolute interpreter path if your Python environment lives elsewhere. Policy is at ruv://promptlang/policy.

Use it today

Practical case: a prompt that several people maintain and nobody trusts. Input is the spec plus values. Workflow is compile, record the hash in review, and compare hashes when someone edits the spec. Output is a diffable artefact instead of an argument about wording.

Acceptance test: compile the same spec and values twice. The hashes must be identical. Change one character of the instruction and the hash must change.

Push it further

Experimental commentary. Compiled hashes make prompt regressions reviewable in the same way code is: pin the hash in a test and let CI tell you when a prompt moved.

Limitation: separating message roles is not proof of injection resistance, and the README says so directly. Falsifiable test: put an instruction-shaped string in a user value and compile. It must remain inside the user message, never promoted into the instruction.

Read the original on GitHub commit

Commit c5ed4a1 — implement secure v2 with tested repository MCP, CLI and MetaHarness (#2)

promptlang repository

Back to the newsroom