Introduction to Autolang
Autolang is a capability-based execution runtime, deterministic scripting language, and custom virtual machine designed specifically for safely running generated code within backend systems. You embed it as a lightweight library - npm install autolang-compiler - rather than adopting a new backend language.
Why Autolang Exists
Executing dynamic logic (like Python or JavaScript) for AI agents creates a critical mid-flight failure problem. If an LLM hallucinates a function name, a dynamic runtime will execute the script perfectly until it hits the broken line. By then, the script may have already charged a credit card or sent an email. Because LLMs lack persistent runtime memory, recovering from this dirty state requires starting the expensive workflow all over again.
Autolang solves this by providing a language-level execution boundary with a Static Compiler. Instead of failing halfway through, Autolang checks all types and capability signatures before any execution begins. The compiler absorbs common syntax drift, and if a capability is hallucinated, it halts instantly at compile-time with zero side effects, allowing the AI to cheaply self-correct.
Key Capabilities
Capability Allowlist
Static Pre-validation
Resource Bounded Execution
AI-Tolerant Language Design
Defense-in-Depth Architecture
Autolang does not replace operating-system sandboxes such as Docker, KVM, or microVMs. Instead, it replaces the general-purpose runtime (such as Python or Node.js) that executes inside those isolation boundaries. Combining Autolang with containerization provides true defense-in-depth: infrastructure isolation at the host layer, and strict capability enforcement at the language level.
Integration Example
The host application declares native capabilities, and the model generates a structured script to orchestrate the workflow in a single local execution:
import { ACompiler } from 'autolang-compiler';
const compiler = await ACompiler.create();
// 1. Host registers explicit capabilities
compiler.registerBuiltInLibrary("crm", `
class Customer(val id: Int, val name: String)
@native("getCustomers")
fun getCustomers(segment: String): Array<Customer>
`, { autoImport: true }, {
getCustomers: (segment) => crmService.getSegmentCustomers(segment)
});
// 2. Generated script executes securely inside the VM
await compiler.compileAndRun("workflow.atl", `
@import("crm")
val enterpriseList = crm.getCustomers("enterprise")
println(enterpriseList)
`);
console.log(compiler.getOutput());Documentation Map
Explore specific technical guides according to your integration and architectural requirements:
Philosophy & Vision
Design motivations, capability boundaries, and coexistence with container isolation.
System Architecture
Pipeline stages, compiler versus virtual machine responsibilities, and host session lifecycle.
Security Model
Default-deny execution, capability controls, defense-in-depth, and resource boundaries.
Integration Guide
Using `autolang-compiler` from npm and binding native host capabilities.
Language Guide
Syntax rules, static typing system, classes, and standard library modules.
Frequently Asked Questions
Key design principles, comparisons, governance, and deployment details.