Skip to main content

Template Management

A template is written in the delta mandate template language, which defines what fields the user must provide in their intent, what evidence must be extracted from the agent's proposal, and the rules they must satisfy. See Template Authoring for how to write one, and the Language Reference for the full DSL.

Submitting

The operator submits a template source file to the orchestrator, which compiles it server-side and stores the compiled bytecode:

mandate-orchestrator templates submit my_template.template

On success, the response contains the template_id — the SHA-256 hash of the compiled bytecode, base58-encoded. Users reference the template by this ID in their intents:

{
"template_id": "3mJr7AoLXfFj..."
}

Submission is idempotent: re-submitting the same source returns the same template_id. If the source fails to compile, the orchestrator returns a 400 describing the compilation error and nothing is stored.

Validating without storing

POST /templates/validate performs the same compilation validation as submission without creating a template ID or storing anything — useful for checking a template in CI or while authoring:

curl -X POST "$ORCHESTRATOR_URL/templates/validate" \
-H "Content-Type: text/plain" \
--data-binary @my_template.template

A 200 means the template compiles; a 400 carries the compilation error, exactly as submission would report it.

Deleting a template

Registered templates can be removed by their template_id:

mandate-orchestrator templates delete --template-id <template_id>