Skip to content

Deterministic Execution

Frank Yglesias Bertheau edited this page Jul 7, 2026 · 1 revision
<h1>ᚾ&nbsp;NornGate — Deterministic Execution</h1>

A gate verdict is reproducible: the same request, evaluated against the same policy, state, and config, always produces the same decision. Determinism is not a nicety here — it is the property that makes audits replayable, retries safe, and conflict resolution stable.


ᛁ What determinism means

A verdict is a pure function of pinned inputs:

verdict = f(request, policy_snapshot, state_snapshot, config)

"Pure" means no hidden inputs: the decision depends on nothing that is not recorded. Given the four inputs, the verdict is fixed. This buys four concrete things:

  • Debugging — replay a failure against its exact inputs and reproduce it.
  • Security — an attacker cannot rely on random drift between gates to slip a request through.
  • Testing — CI and load tests produce stable outcomes, not flaky ones.
  • Compliance — every historical decision stays explainable after the fact.

Precision: determinism is over (request + policy + state + config), not the request alone. The same request against a changed policy or changed resource state can legitimately flip ALLOW → DENY — that is correct behavior, not nondeterminism. The gate records which snapshots it used so the flip is explainable.


ᛜ The inputs

Each argument to f is pinned and identified, so a verdict can be reconstructed exactly.

Input What it is Pinned as
request The action, its parameters, subject and resource identifiers Deterministic request ID
policy_snapshot The versioned policy bundle in force at evaluation Policy version (e.g. pol_20260706_01)
state_snapshot Resource state and attributes read for the decision State snapshot ID
config Gate configuration (timeouts, budgets, rules wiring) Config version (e.g. gatecfg_v14)
clock Elapsed-time inputs for timeouts Logical/monotonic counter, not wall-clock

Design references. Deterministic rules over LLM judgment — Assury. Idempotent replay as a runtime primitive — Orloj. Signed, reproducible records — Kaman. Naming doctrine: Prose Edda / Poetic Edda, per Norse Cosmology & Platform Design.

ᚾ NornGate — Deterministic Execution

A gate verdict is reproducible: the same request, evaluated against the same policy, state, and config, always produces the same decision. Determinism is not a nicety here — it is the property that makes audits replayable, retries safe, and conflict resolution stable.


ᛁ What determinism means

A verdict is a pure function of pinned inputs:

verdict = f(request, policy_snapshot, state_snapshot, config)

"Pure" means no hidden inputs: the decision depends on nothing that is not recorded. Given the four inputs, the verdict is fixed. This buys four concrete things:

  • Debugging — replay a failure against its exact inputs and reproduce it.
  • Security — an attacker cannot rely on random drift between gates to slip a request through.
  • Testing — CI and load tests produce stable outcomes, not flaky ones.
  • Compliance — every historical decision stays explainable after the fact.

Precision: determinism is over (request + policy + state + config), not the request alone. The same request against a changed policy or changed resource state can legitimately flip ALLOW → DENY — that is correct behavior, not nondeterminism. The gate records which snapshots it used so the flip is explainable.


ᛜ The inputs

Each argument to f is pinned and identified, so a verdict can be reconstructed exactly.

Input What it is Pinned as
request The action, its parameters, subject and resource identifiers Deterministic request ID
policy_snapshot The versioned policy bundle in force at evaluation Policy version (e.g. pol_20260706_01)
state_snapshot Resource state and attributes read for the decision State snapshot ID
config Gate configuration (timeouts, budgets, rules wiring) Config version (e.g. gatecfg_v14)
clock Elapsed-time inputs for timeouts Logical/monotonic counter, not wall-clock
{
  "requestId": "req_7f3a2b",
  "decision": "allow",
  "gates": ["ingress", "policy", "approval", "sandbox", "arbitration"],
  "inputs": {
    "policy": "pol_20260706_01",
    "state": "st_88f2",
    "config": "gatecfg_v14",
    "clock": "logical:118843"
  },
  "timestamp": "2026-07-06T10:32:00Z"
}

The timestamp is recorded but never an input to the decision — see the next section.


ᛉ Eliminating nondeterminism

Determinism is enforced by removing every common source of drift from gate logic:

Source of nondeterminism How NornGate removes it
Wall-clock time Timeouts use a monotonic/logical clock; wall-clock timestamps are recorded, never used to decide.
Randomness No randomness in gate logic. Any required randomness is explicitly seeded and the seed is recorded.
Ordering Deterministic request IDs, stable sorts, canonical serialization — no reliance on map iteration order.
Live external calls Decision inputs are snapshotted, not fetched live mid-evaluation; the same snapshot yields the same result on replay.
Concurrency races Contention is resolved at G4 by lease + deterministic tie-break, not by whoever happens to arrive first.
Model reasoning The LLM is never in the decision path (see Scope). Gate verdicts are rules, not model output.

The rule is simple to state and strict to hold: a verdict never depends on an unrecorded input.


ᚷ Idempotency and exactly-once

Determinism of decisions is paired with determinism of effects. Every consequential action carries an idempotency key; a repeated request with the same key does not re-execute — it returns the already-committed outcome.

{
  "idempotencyKey": "idem_abc123",
  "firstSeen": "2026-07-07T10:30:02Z",
  "committedOutcome": "out_9a2",
  "onRetry": "return-cached-outcome"
}

Why: networks retry. Without idempotency, a retry after a dropped response would double-charge, double-send, or double-write. With it, the side effect commits exactly once at G4 regardless of how many times the request is delivered. Reference: Orloj treats idempotent replay as a core-runtime primitive.


ᛒ Replay and reconstruction

Because inputs are pinned and recorded to [Urd](Urd-Ledger), any historical decision can be re-derived: load the recorded snapshots, re-run the gates, and confirm the verdict matches.

$ norngate-cli audit replay req_7f3a2b
[INFO] loading snapshots policy=pol_20260706_01 state=st_88f2 config=gatecfg_v14
[INFO] re-evaluating G0 - G4 against pinned inputs
[INFO] decision=allow  (matches recorded verdict — deterministic)

This is what makes the ledger more than a log: it is a reproducible record. Incident review, denial analysis, and state reconstruction after a failure all rely on replay producing the original result. A mismatch on replay is itself a signal — it means an input was not captured, which is a bug to fix, not a decision to trust.


ᚺ Scope — what stays nondeterministic

NornGate makes control decisions deterministic. It does not make the agent's reasoning deterministic — an LLM's output is probabilistic, and NornGate does not claim otherwise. The point is precisely that the gates are deterministic regardless of the nondeterministic thing they govern:

  • The agent may propose a different action each run — the gate that judges it returns the same verdict for the same proposed action, policy, and state.
  • This separation is the security argument: a nondeterministic agent cannot produce a nondeterministic enforcement result, so it cannot find a lucky path through the gates.

In short: determinism lives at the boundary, not inside the model.


ᚱ Next steps


Iconography

Section glyphs are Elder Futhark runes (Unicode Runic block, U+16A0–U+16FF) — semantic, not emoji. Full set on [Home](Home#iconography):

Rune Name Gloss Marks
Nauðiz need, constraint the platform mark
Isa ice, the fixed and immovable what determinism means
Ingwaz the enclosed, complete set the inputs
Algiz warding off eliminating nondeterminism
Gebo balanced exchange, one for one idempotency / exactly-once
Berkanan growth, bringing forth again replay and reconstruction
Hagalaz the uncontrolled, acknowledged scope — what stays nondeterministic
Raidō the ride, the road next steps

Design references. Deterministic rules over LLM judgment — Assury. Idempotent replay as a runtime primitive — Orloj. Signed, reproducible records — Kaman. Naming doctrine: Prose Edda / Poetic Edda, per [Norse Cosmology & Platform Design](Norse-Cosmology-and-Platform-Design).

Clone this wiki locally