Back to browse
Mog, a programming language for AI agents

Mog, a programming language for AI agents

by belisarius222·Mar 6, 2026·3 points·2 comments

AI Analysis

●●●BangerBig BrainZero to One

Sandbox-aware language: agents can enforce permissions even on Mog-written bash commands.

Strengths
  • Capability system threads permissions from host agent through to Mog code—genuine architectural insight not borrowed from elsewhere
  • 3200-token spec means LLMs can learn and generate valid Mog quickly; Rust compiler/runtime avoids JIT startup cost
  • Solves real pain: agents currently can't safely sandbox external code; this closes that loophole
Weaknesses
  • Only a gist; no public repo yet (GitHub link in post is dead or unavailable)
  • No interpreter/playground to try it; unclear if compiler/runtime binaries are published
Target Audience

AI agent developers needing safe, LLM-writable plugin systems

Similar To

WebAssembly · Lua (for LLM embeddings) · Capsule (language for restricted environments)

Post Description

I wrote a programming language for extending AI agents, called Mog. It's like a statically typed Lua.

Most AI agents have trouble enforcing their normal permissions in plugins and hooks, since they're external scripts.

Mog's capability system gives the agent full control over I/O, so it can enforce whatever permissions it wants in the Mog code. This is even true if the plugin wants to run bash -- the agent can check each bash command the Mog code emits using the exact same predicate it uses for the LLM's direct bash tool.

Mog is a statically typed, compiled, memory-safe language, with native async support, minimal syntax, and its own compiler written in Rust and its own runtime, also written in Rust, with `extern "C"` so the runtime can easily be embedded in agents written in different languages.

It's designed to be written by LLMs. Its syntax is familiar, it minimizes foot-guns, and its full spec fits in a 3200-token file.

The language is quite new, so no hard security guarantees are claimed at present. Contributions welcome!

Similar Projects

A New Programming Language

Endianness in the type system is clever, but another language in a saturated field.

Niche Gem
kvthweatt
403mo ago
Developer Tools●●Solid

Lumina – a statically typed web-native language for JavaScript and WASM

Built-in reactive runtime and dual JS/WASM targets challenge React and TypeScript dominance.

WizardryBold Bet
light_ideas
202mo ago