Skip to content
OnticBeta

Layer 0

Prompt Compiler

Layer 0: pre-generation rewrite engine for governed inference.

Prompt Compiler analyzes and rewrites prompts before the model generates a single token, preventing structural failures that post-generation scoring cannot fix.

Without this

Without pre-generation structural integrity, the model receives prompts that reward hallucination. Evidence gets buried by recency bias, authority signals are lost in unstructured context, and post-generation scoring catches failures too late to prevent them.

Position in the platform

SystemLayer
Oracle FoundryFoundation
SIRE CrosswalkPost-Foundry
Prompt CompilerL0
Claim LedgerL1-L4
Process Control SystemCross-layer
Forensics LabL5

CFPO ordering model

ZonePlacement
ContentEarly context
FormatMid context
PolicyLate context
OutputFinal context

The compiler places content by function and relevance, matching known attention behavior instead of appending retrieval chunks as an undifferentiated block.

Live CFPO prompt excerpt

## Mission ← CONTENT

You are an ontology architect for the Ontic
Claim Authorization Architecture.

———————————————————————————————————————

## State Axis Types ← FORMAT

```yaml
axis_types:
enum:
description: Fixed set of allowed values
requires: possibleValues array
range:
description: Numeric value within bounds
requires: rangeMin, rangeMax
identifier:
description: Unique identifier string
use_when: "License numbers, NDC codes"
```

———————————————————————————————————————

## Axis Design — ENFORCEMENT ← POLICY

❌ VIOLATIONS:
- key: "general_info" → Too vague
- type: "enum" without possibleValues
- 3 axes for a critical-sensitivity domain

✓ VALID:
- key: "license_status", type: "enum",
possibleValues: ["active", "suspended",
"revoked", "expired"]
- key: "dosage_mg", type: "range",
rangeMin: 0, rangeMax: 2000

———————————————————————————————————————

## Output Schema (JSON) ← OUTPUT

Return ONLY valid JSON — no markdown,
no explanation, no code fences.

Five rewrite passes

Context placement optimization

Positions chunks by CFPO zone and attention profile so evidence is visible where it matters.

Instruction reinforcement

Duplicates critical grounding constraints near generation to increase compliance reliability.

Authority zone isolation

Separates evidence, instructions, and user input with model-validated delimiters.

Mechanism competition detection

Detects likely parametric-vs-retrieval conflicts and strengthens retrieval authority signals.

Format-pressure resolution

Resolves schema-completeness pressure when required fields lack supporting evidence.

Crayon Contract

  • Only output claims that can be tied to provided source text
  • Numbers, entities, dates, and citations require explicit support
  • Conflicting sources are reported, not reconciled by guesswork
  • Uncertain tokens are omitted instead of emitted

Compiler outputs

  • Compiled prompt artifact (original + compiled prompt preserved in envelope)
  • Prompt structural risk score and failure-mode labels
  • Rewrite-pass manifest with deterministic reproducibility
  • Mechanism-competition risk signal for downstream analysis

Mode behavior

The Studio

Runs passes, logs risk, no pre-generation blocking.

The Refinery

Runs passes, enforces grounding-first conflict handling and stricter review paths.

The Clean Room

Maximum reinforcement and pre-generation abstention constraints for authority violations.

Compile structure before you score output

Prompt Compiler reduces failure probability at the source by treating prompt assembly as a deterministic compile step.

Who uses this

Operator

Platform runtime

Runs automatically on every inference request—no manual intervention required.

Consumer

The inference pipeline

Every prompt passes through the compiler before generation. Downstream Claim Ledger and Forensics Lab consume compiler telemetry.