Lex

The substrate for software you don't fully trust.

In Lex, effects are part of the type. What a piece of code is allowed to do is checked before it runs and re-checked at runtime — from sandboxing a function an LLM just wrote, up to bounding what a learned policy may do to a robot. Trust by verification, not comprehension.

Alpibru is one founder and agentic AI. The stack below — a language, a runtime, a registry, and production stacks across finance, energy, and robotics — is the demonstration: it is possible because trust here is mechanical (typed effects, tests, tamper-evident attestation), not headcount. This is the new shape of a software company.

Trust by construction

Effects are the contract

A [net] function can't touch the filesystem — the program is rejected at type-check, before it runs.

Capabilities, enforced

lex-os runs code in a sealed box with a granted budget; the supervisor mediates every command and can kill or reprovision.

Tamper-evident by default

Every action is a content-addressed, hash-chained event — an attestation trail you can replay and verify, not just trust.

See it live

The same idea — capability and audit enforced by construction — running as products you can use right now.

The stack

Substrate — the language, runtime, and registry

  • lex-langrunnable

    Typed-effect language built for LLM authorship; effects are the contract, checked before run.

  • lex-osrunnable

    Sealed, sandboxed execution box handed to an agent with a goal and a budget.

  • lex-os-manifestbeta

    Manifest format as a Lex package: trust dimensions, grants, narrowing inheritance as types.

  • lex-clirunnable

    CLI framework for Lex: arg parsing, ACLI output, config, authenticated HTTP client.

  • lex-specrunnable

    Capability-precondition + spec DSL: Spec ADT, evaluator, property checks, SMT-LIB export.

Libraries — horizontal building blocks

  • lex-webrunnable

    HTTP + WebSocket framework: actor-model concurrency; one schema drives every artifact.

  • lex-schemarunnable

    Pydantic-style runtime validation, codegen, and schema utilities for Lex.

  • lex-ormrunnable

    Typed query builder, migration runner, and live std.sql driver built on lex-schema.

  • lex-moneyrunnable

    Exact decimal monetary arithmetic for the Lex language.

  • lex-logrunnable

    OpenTelemetry-compatible structured logging, tracing, and metrics for Lex.

  • lex-llmrunnable

    Pure-Lex LLM-agent runtime: provider abstraction, tool-call loop, structured outputs.

  • lex-mcprunnable

    MCP stdio server bridging lex-agent Skills to MCP JSON-RPC.

  • lex-trailrunnable

    Content-addressed, append-only audit trail: attestation chains and task replay.

  • lex-jobsrunnable

    SQL-backed durable background job queue: enqueue, pull, dispatch, ack, retries.

  • lex-cryptobeta

    Crypto for Lex: JWT, OAuth2/PKCE, Argon2id, sealed cookies, webhook verify, TOTP.

  • lex-device-identityrunnable

    Platform-signed device certificates + offline signed-reading verification — the tamper-evident trail starts at the device.

  • lex-slimalpha

    Lex client for SLIM (AGNTCY) multicast agent messaging — multi-party agent comms via a SLIM-node sidecar bridge.

  • lex-joserunnable

    JOSE for Lex: JWS / JWT / JWK over std.crypto. EdDSA + HMAC today; ES256 + SD-JWT on deck for AP2.

  • lex-x402beta

    x402 agent payments for Lex: the 402→sign→settle handshake over exact/Solana, EVM, and HTTP.

  • lex-gamesrunnable

    Capability-gated, verifiable turn games + the arena verifier (replay a trail → score).

Agents & orchestration

  • lex-agentrunnable

    Pure-Lex Google A2A protocol: AgentCard, JSON-RPC, Task lifecycle, SSE streaming.

  • lex-guardbeta

    Agent spending guardrails: capability-gated budget tokens with an attestation trail.

  • lex-coderunnable

    Lex-native coding assistant built entirely in the Lex ecosystem.

  • lex-arenarunnable

    Where Lex agents play: a lobby, N-player games, and the Magentic Bazaar — a governed agent marketplace, replay-verified by lex-games.

  • lex-loombeta

    Multi-agent sprint cycles built on lex-soft (design stage).

  • lex-softbeta

    LLM-agent platform: registry, relationship graph, resolver, runner.

  • lex-agent-llmrunnable

    Brain-skin bridge: run a lex-llm agent loop as a lex-agent Skill (A2A/MCP-reachable).

  • lex-mcp-clientrunnable

    MCP client for lex — connect to an MCP server over HTTP and adapt its tools into lex-llm Tools.

Finance

  • lex-financerunnable

    Agent-native finance software stack for the Lex language.

  • lex-riskrunnable

    Portfolio Greeks, notional, and Reg-T margin aggregation.

  • lex-positionsbeta

    Position tracking with WAAC, realized PnL, and a SQL-backed store.

  • lex-traderunnable

    Pre-trade order validation for the Lex language.

  • lex-sorbeta

    Smart order routing for the Lex finance stack.

  • lex-fixrunnable

    FIX 4.4 protocol adapter for the Lex language.

  • lex-marketdatabeta

    Market and reference data for the Lex finance stack.

  • lex-omsrunnable

    HTTP Order Management System wiring the finance stack on lex-web.

  • lex-oms-agentrunnable

    LLM-backed autonomous trading agents with compile-time effect isolation.

Energy & EV

  • lex-ocpprunnable

    OCPP library for Lex: v1.6 and v2.0.1 framing and handler dispatch.

  • lex-ocpirunnable

    OCPI 2.2.1 library for Lex: CPO / eMSP / PTP role endpoints.

Robotics

  • lex-robotrunnable

    Effect-typed, capability-bounded governance layer over LeRobot.

Run it

## install the toolchain (Linux/macOS/Windows binaries)
#   https://github.com/alpibrusl/lex-lang/releases

## a function that declares [net] cannot reach the filesystem:
fn fetch(url :: Str) -> [net] Result[Str, Str] { io.read("/etc/passwd") }
#   rejected at type-check — the effect isn't in the signature.