How to verify Termin's security claims

Security claims only matter if they can be verified. Termin's structural claims rest on five interlocking layers of defense-in-depth, each of which can be checked independently. This page describes the layers, how a reader can verify each one, and what is not yet proven.

The comparison many evaluators reach for is Rust. Rust can claim thread safety because it is a functional language with a formal ownership type system, and functional languages with ownership types cannot produce a data race — that is solid syllogistic reasoning backed by decades of formal work. Termin does not have a formal proof. What Termin has is a sequence of five independently verifiable layers, each of which closes a specific class of failure, and a behavioral conformance suite that exercises all five. The defense is cumulative. Each layer is weaker than a proof; the combination is meaningful.

The rest of this page describes the layers, how to verify each one, and what remains to be done.

The even-if chain

The short form of the argument. If you only read one thing on this page, read this.

  1. You cannot express something unsafe in the language. The grammar rejects it.
  2. Even if you did (ungrammatical Termin), the compiler would catch it and return an error. The analyzer rejects it.
  3. Even if it didn't (malicious IR that bypasses the compiler), the runtime enforces the security invariants and rejects malformed IR. The runtime's structural checks fire at load time.
  4. Even if it didn't (bug or flaw in the runtime), the conformance test suite would alert you to the non-conforming behavior. The suite runs against every conforming runtime.
  5. Even if it didn't (gap in behavioral testing), third-party audit and red-teaming would identify findings, which feed back into hardening the language, runtime, and conformance suite. This layer is a v1.0.0 goal, not a current reality.

Each step independently blocks a specific class of failure. An attacker — or a well-meaning agent generating Termin specifications — would have to defeat all five to introduce a structural vulnerability. The layers are not rhetoric. They are four working mechanisms plus one honest commitment.

The five layers

Layer 1 — Declarative grammar, non-Turing-completeness

The Termin DSL is declarative. You describe what the application does, not how to do it. The grammar does not provide constructs for:

Certain violations are not just rejected — they are inexpressible. There is no syntax for "SQL string plus user input." The language provides parameterized access and identity-scoped operations; it does not provide the machinery to produce injectable constructs. This is the strongest layer because it rules out entire classes of failure at the lexical level.

How to verify: Read the grammar. It is a PEG grammar (Parsing Expression Grammar). Walk through the production rules and observe that there is no rule for string concatenation into queries, no rule for shell execution, no rule for raw template output. The absence is the evidence.

Layer 2 — Compiler invariant enforcement

Even a well-formed specification can be semantically wrong. The compiler's analyzer enforces a set of invariants that the grammar alone cannot express:

The analyzer emits structured error codes (TERMIN-S020, TERMIN-S021, TERMIN-S030, …) with fuzzy-match suggestions, so authors see what went wrong and how to fix it.

How to verify: Read the analyzer source. Every SemanticError has a code and a message. Read the analyzer tests — the test suite covers each invariant with both a passing case and at least one failing case. Run the tests yourself (python -m pytest tests/test_analyzer.py); they pass against the public reference implementation.

Layer 3 — Runtime behavioral contract

The runtime reads the compiler's intermediate representation (IR) and serves the application. A conforming runtime is bound by a behavioral contract specified alongside the IR JSON Schema. The contract covers:

The runtime rejects IR that violates the schema. The runtime rejects callers whose identity does not carry the required scope. The runtime rejects transitions that are not declared. These behaviors are the contract, not an implementation choice — every conforming runtime enforces them.

How to verify: Read the Runtime Implementer's Guide. Clone the reference runtime and read termin_runtime/. Every guarantee on the guarantees page links to the specific enforcement point in the runtime plus the conformance test that validates it.

Layer 4 — Behavioral conformance suite

The conformance suite contains over 700 behavioral tests. The suite is runtime-agnostic: it takes any conforming runtime, drives it through a battery of positive and negative cases, and asserts that every structural guarantee holds. Examples of what the suite covers:

The suite exists so that a second or third conforming runtime — written in Rust, Go, TypeScript, or any other language — can be validated against the same behavioral contract. Pass the suite and your runtime inherits the Tier 1 structural guarantees.

How to verify: Clone the conformance suite. Read the tests — they are the plain-language version of the behavioral contract. Run them (python -m pytest tests/). They pass against the reference runtime. Read the suite's README to see how to point them at a different runtime.

The reference compiler has over 1,400 additional tests (compiler tests) covering the parser, analyzer, lowering, IR schema, and the reference runtime itself. These supplement the behavioral suite with white-box coverage of the compile pipeline.

Layer 5 — Third-party audit

Before v1.0.0, the compiler, runtime, and conformance suite will be audited by software security professionals and hardened based on their findings. Options being explored include sponsored audits from security firms with open-source practices, community-funded audits, and pro-bono reviews through professional networks. The audit is on the roadmap.

Today, this layer is a commitment. If you need Layer 5 before deploying, wait for v1.0.0.

How to verify: Watch the roadmap. When an audit is scheduled, it will be listed there. When one completes, the findings will be published. No claim on this site asserts a completed audit that has not happened.

An analogy: industrial robot safety

The technical description above is precise but abstract. An analogy that many readers find useful: how do we know that an industrial robot — humanoid or otherwise — is safe to operate around humans?

The first four layers are working mechanisms. The fifth is a commitment. The combination is what lets a factory floor manager allow robots and humans to share a workspace.

The honest Rust comparison

Rust can claim thread safety on the basis of a formal ownership type system and decades of applied academic work. A Rust program that compiles cannot produce a data race. That is a strong claim backed by mathematical proof.

Termin does not have that. Termin has an interlocking set of structural layers plus a behavioral conformance suite. Each layer is independently weaker than a formal proof. The combination is meaningful but not equivalent.

If you need the strength of a formal proof for your use case, Termin is not there yet and may never be there. Most enterprise evaluators find defense-in-depth plus behavioral verification sufficient for the properties Termin claims to enforce. Some do not. We are honest about which one you are.

Write your own runtime

A practical observation: the conformance suite is what makes cross-runtime verification possible. It defines the behavioral contract without reference to the reference implementation's code. If you want Rust-level assurance, you can write a conforming runtime in Rust, validate it against the suite, and benefit from the declarative grammar's Layer 1 protection plus Rust's memory-safety guarantees on the runtime itself. The suite and the IR schema are the things you would write against; the reference runtime is only one implementation.

This is the ecosystem design: the Termin specification is the contract. The reference runtime is the first conforming implementation. Other conforming runtimes in other languages with other trade-offs are anticipated, welcomed, and expected.

What this page does not claim

Where to go next