Skip to content

Telos Lang Compiler

Telos Lang is a Rust-based compiler that translates high-level security intent declarations into Z3-verified eBPF bytecode. It uses Hoare Logic and BitVector analysis to mathematically prove policy safety before kernel deployment.


The compiler generates code for two targets simultaneously in a single compilation pass:

TargetArchitecturePurpose
x86_64 HostELF binaryUser-space policy loader and bootstrap
BPF KerneleBPF bytecodeKernel sandbox enforcement

  1. Parsing — Chumsky parser extracts intent blocks and IFC annotations from .telos files
  2. Type Checking — Static IFC lattice verification (Secret<T>, Public<T>, Tainted<T>)
  3. Z3 Verification — SMT solver proves all eBPF basic blocks are memory-safe
  4. Code Generation — LLVM inkwell backend emits dual-target IR
  5. Bootstrapllvm.global_ctors injector loads eBPF sandbox before main()

Terminal window
telosc new <name> # Create new policy environment
telosc check <file> # Static IFC typecheck without compiling
telosc verify <file> # Z3 formal verification
telosc build <file> # Full compilation to ELF + BPF

The Information Flow Control lattice defines how data flows between security levels:

Secret<T> ← highest security level
Tainted<T> ← elevated by sensitive operations
Public<T> ← default level, may flow to network

Data flows are only permitted downward in the lattice. A Secret<T> value cannot be cast to Public<T> without explicit cryptographic declassification (SHA-256 or AES-GCM boundary casting).