A strictly typed, policy-as-code systems language structured for zero-trust Linux environments. Telos unifies application logic with formally-verified Linux kernel security capabilities natively.
Telos generates formally-verified, fail-closed Linux executables containing embedded eBPF LSM sandboxes directly from your source.
# 1. Clone the repository
git clone https://github.com/nevinshine/telos-lang.git
cd telos-lang/telosc
# 2. Build the compiler pipeline (Requires LLVM 15 and Z3 via your package manager)
cargo build
# 3. Compile & Run the Demonstration Sandbox (Root required to map the BPF)
sudo cargo run tests/hello_world.telosWhat Telos v0.1 Is:
- A dual-target generator translating semantic actions into x86_64 host instructions + kernel-level eBPF sandboxes.
- A static mathematical verifier using Microsoft Z3 to mathematically prove all kernel constraints are satisfied prior to emission.
- A language enforcing Information Flow Control (
Secret<T>vsPublic<T>) natively, guaranteeing zero data leakage at compile time.
What Telos v0.1 Is Not:
- A generalized general-purpose language with a massive standard library (like Rust or Go). It is designed strictly for high-security wedge code.
- A cross-platform framework. It is tightly bound directly into the Linux capability matrix.
- Zero-Trust Execution (Fail-Closed): Telos executables contain an embedded
.initbootstrap injector. If the Linux kernel rejects the internal LSM eBPF sandbox, the binary explicitly self-aborts beforemain(). - Dual-Target IR Pipeline: Synthesizes host architecture (x86_64) parallel to kernel architectures (
bpf-unknown-none) in one unified pass. - Static Information Flow Control (IFC): A zero-cost lattice (
Secret<T>,Public<T>) prevents both explicit data variable leaking and implicit structural flow leaking through control boundaries (If/While). - Cryptographic Boundary Casting:
Secretstrings are locked to the execution boundary permanently. They can only be declassified via compiler-whitelisted algorithms (SHA-256,AES-GCM). - Semantic LSM Intent Extraction: Capabilities mapped natively into BPF hash maps automatically intercept
socket_connectandfile_openLinux Security Modules. - Pipelock MCP Synchronization: Integrates native Ringbuffer streaming from the eBPF layer into a local JSON-RPC consumer thread for Model Context Protocol (MCP) telemetry export.
- Z3 SMT Formal Verification: Every basic block of the eBPF hook is formally constrained by Microsoft Z3 to mathematically prove memory safety and structural adherence before compilation concludes.
- AARM Cryptographic Receipts (Phase 8): Native SipHash-2-4 IR generation within the eBPF context, providing tamper-evident forensic receipts for Autonomous Action Runtime Management (AARM) compliance.
- Hyperion XDP Bridge (Phase 9): Hardware-level network drops using
BPF_PROG_TYPE_XDP. Intercepts and drops unauthorized packets at the NIC driver level, bypassing the kernel networking stack for extreme performance.
Traditional systems languages (C, C++, Rust) isolate security enforcement to external layers (AppArmor, SELinux, Kubernetes policies). Telos embeds the security primitives natively into the language semantics using a Dual-Target IR Pipeline:
- Host Execution (User-Space LLVM IR): The primary application logic is compiled into generic x86_64 or AArch64 machine code using the
inkwellLLVM wrapper. - Sandbox Generation (BPF LLVM IR): Capability definitions (
intentblocks) are recursively lowered intoBPF_PROG_TYPE_LSMeBPF bytecode targeting specific Linux Security Module hook points.
The generated eBPF bytecode array is dynamically linked into the host ELF .rodata section. Telos utilizes llvm.global_ctors to synthesize a low-level .init preamble that issues raw bpf(BPF_PROG_LOAD) syscalls before main() execution. If the Linux kernel rejects the eBPF isolation sandbox bounds, the binary unconditionally aborts. A Telos binary mathematically cannot execute its internal logic without its required kernel security matrix.
Telos guarantees non-interference and strictly isolates data trajectories through a transparent, zero-cost security lattice integrated directly into the semantic AST tree.
Variables are explicitly annotated using the architectural security wrappers: Secret<T>, Tainted<T>, and Public<T>.
fn core_evaluation() -> Void {
let critical_token: Secret<String> = "/etc/shadow";
// [TELOS FATAL]: ExplicitLeak("Cannot flow Secret data into Public sink in assignment 'external_socket'")
let external_socket: Public<String> = critical_token;
}Conditional jumps inherently bind their enclosed scope variables. The internal typecheck.rs evaluation model strictly evaluates the structural ceiling via a dynamic Program Counter (PC) stack to prevent indirect leaks.
fn implicit_leak() -> Void {
let internal_eval: Secret<I64> = 1;
let outbound_telemetry: Public<I64> = 0;
// Pushing the `Secret` context onto the local PC evaluation stack
if internal_eval {
// [TELOS FATAL]: ImplicitLeak("Cannot flow Secret data into Public sink in assignment 'outbound_telemetry'")
outbound_telemetry = 1;
}
}The compiler actively incorporates static theorem proving into its translation bounds. During compilation within verify_smt.rs, the generated LLVM Basic Blocks representing the eBPF LSM intercept hooks are statically modeled as Bit-Vector representations.
Before the BPF sandbox array is serialized, the Z3 SMT Theorem Prover calculates all operational CFG branching constraints to prove:
- Division-by-Zero safety.
- Restricted Shift Ranges.
- Pointer Arithmetic bounds.
- Valid Linux LSM Return structural values (
0for success or-EPERM/-1access denied limitations).
If the Z3 model evaluates to SAT (a violating sequence is computationally possible), compilation aborts.
All generation is contained within the telosc root crate wrapper. Use the included hello_world.telos file to see the full compiler syntax in action.
# Standard Compilation Check:
cargo check
# Compile and Run the Showcase Demonstration:
sudo cargo run tests/hello_world.telosNote:
sudois required to attach the compiled eBPF LSM sandboxes to the kernel successfully. The compiler usesllvm.global_ctorsto synthesize an embedded preamble. IfCAP_BPFis missing, the binary executes a strict fail-closed trap and aborts instantly with anIllegal instruction (core dumped)prior tomain()executing.