Declarative language for reliable AI workflows
πŸš€ LAILA 0.1.0

LAILA

LAILA is a declarative language for defining AI workflows whose outputs must earn trust before they can be used. It brings verification, confidence, fallback, and safety boundaries directly into the language itself.

schema Answer {
  text: string
  citations: list<string>
}

fallback safe_answer = Answer {
  text: "I’m not confident enough to answer reliably."
  citations: []
}

workflow answer_user {
  input {
    question: string
  }

  infer draft: Answer from model "qa-model"
    using question

  verify answer from draft
    by vote 3
    require confidence >= 0.8
    else fallback safe_answer

  emit answer
}

Note: in a vote N strategy, confidence in a require clause is the agreement ratio across vote candidates β€” so >= 0.8 with vote 3 means unanimous agreement.

Get started

LAILA is open source under Apache 2.0. The language, checker, and runtime are all part of one Python package.

# Clone the repo
$ git clone https://github.com/InnoRealm-Systems/LAILA-LANG.git
$ cd LAILA-LANG
$ pip install -e .

# Try an example
$ laila check examples/02_verify_vote.laila
Program is valid

$ laila run examples/02_verify_vote.laila \
    --input inputs/basic.json

What you'll need

Python 3.12 or newer. The runtime falls back to a built-in simulated backend when no model endpoint is configured, so you can try every example without an API key.

To run against a live model, point the runtime at any OpenAI-compatible endpoint via RUNPOD_ENDPOINT and RUNPOD_API_KEY environment variables.

How trust flows through LAILA

LAILA treats model outputs as values that must earn the right to be used. Outputs begin unverified, can be promoted through verification and policy, and only then may flow into safe sinks such as user-visible responses or actions.

infer Unverified A model produces a structured output, but it is not yet safe to show or act on. verify Verified The output passes checks like voting, confidence thresholds, or evidence-backed validation. trust Trusted Higher-risk workflows can require stronger policy checks before an action is allowed. emit / act Safe sink Outputs can only flow into responses or actions if they meet the required trust level.
infer Unverified A model output exists, but it is not yet safe to use. verify Verified The output passes stability or policy-based checks. trust Trusted Higher-risk workflows can require stronger guarantees. emit / act Safe sink Only sufficiently trusted outputs can be consumed.
LAILA enforces trust boundaries both at design time and during execution through its runtime.

Why LAILA exists

In ordinary programming languages, engineers can call models directly, skip verification, ignore confidence, and accidentally let unsafe outputs drive real decisions. LAILA exists to make those mistakes harder β€” and eventually impossible β€” by construction.

AI outputs are not ordinary values

Model outputs can look plausible while still being unstable, low-confidence, or unsafe to consume. LAILA treats that as a core language concern.

Safety should be visible in code

Verification, fallback behavior, escalation, and trust boundaries should be explicit, inspectable, and auditable.

Unsafe workflows should fail early

LAILA is designed so invalid trust flows are rejected before deployment, instead of being discovered after a bad output reaches users or systems.

The LAILA runtime

LAILA workflows are not just defined β€” they are enforced. The runtime executes each step of a workflow and ensures that outputs meet verification and trust requirements before they are used.

Execution model

Every workflow follows a structured lifecycle: infer β†’ verify β†’ trust β†’ emit (or fallback). Outputs cannot skip steps or bypass checks.

Enforced reliability

The runtime applies voting, consensus rules, confidence thresholds, and basic policy checks. The policy system is intentionally minimal in 0.1.0 and will expand in future releases. If any step fails, fallback behavior is triggered safely.

LAILA does not assume outputs are correct β€” it enforces that they must be.

Core language ideas

LAILA is intentionally narrow. It is not a general-purpose AI language. It is a workflow and policy DSL focused on trust, verification, and safe action boundaries.

Structured outputs only

All meaningful model outputs are schema-typed. Untyped blobs are not the center of the language.

Inference starts unverified

infer produces model-derived values that are not yet safe to consume.

Trust must be earned

verify promotes a value to verified, which is enough to emit it. trust promotes a value further to trusted, which is required before any act can run.

Sinks enforce safety

User-visible outputs and real-world actions require different trust levels, and LAILA’s checker enforces those boundaries.

schema workflow infer verify trust fallback emit act compile-time safety

A workflow in LAILA

LAILA code is meant to read like a safety contract: what output is needed, how it is verified, and what happens if confidence cannot be earned.

schema Decision {
  action: string
}

fallback safe_decision = Decision {
  action: "escalate"
}

workflow decision_flow {
  input {
    question: string
  }

  infer draft: Decision from model "ops-model"
    using question

  verify reviewed from draft
    by vote 3
    require confidence >= 0.8
    else fallback safe_decision

  trust decision from reviewed
    require policy approval_policy_v1
    else escalate to human

  act apply_decision(decision)
}

The vision

LAILA aims to become a useful tool for ML engineers and AI system builders who need to define safe, inspectable, verifiable workflows with built-in verification, trust, and safety guarantees.

For ML engineers

Declare trust requirements, safe sinks, and fallback behavior without rebuilding the same safety logic in Python for every workflow.

For high-stakes systems

Move verification, escalation, and action boundaries into a language that can be checked before unsafe behavior reaches production.

For the future

Grow toward a full safety layer where workflow structure, trust progression, and runtime integrity work together cleanly.

LAILA makes unsafe AI workflows harder to write β€” and easier to detect before they run.

Latest release

LAILA 0.1.0 introduces the core language, CLI, and verification model. Workflows can now be defined declaratively and executed with real multi-call verification and fallback safety.