AutolangDocs
Active Development

Introduction to Autolang

Autolang is a capability-based execution runtime, deterministic scripting language, and custom virtual machine designed specifically for executing AI-generated code.

Overview

When an AI agent executes multi-step workflows, passing control to an unconstrained general-purpose scripting environment exposes unbudgeted CPU, memory, and filesystem access. Autolang acts as a language-level sandbox between the AI agent and your host application systems.

Capability Allowlist

Host applications register explicit capabilities. AI scripts cannot reach unexposed APIs, filesystem handles, or network sockets.

Static Type Pre-validation

Types and symbol resolutions are verified at compile time before the script ever executes, eliminating runtime type crash loops.

Resource Bounded Execution

Opcode limit budgets and managed heap object quotas prevent infinite loops and runaway process memory consumption.

Low Memory Footprint

~0.5MB RAM per native instance and ~10ms cold start, allowing thousands of concurrent agent sessions without container boot overhead.

Quick Code Example

The host application exposes native capability functions, and the AI agent generates a structured orchestration script to execute them in one local pass:

import { ACompiler } from 'autolang-compiler'; const compiler = await ACompiler.create(); // 1. Host registers explicit capabilities compiler.registerBuiltInLibrary("crm", ` @native("getCustomers") fun getCustomers(segment: String): Array<Customer> `, { autoImport: true }, { getCustomers: (segment) => db.queryCustomers(segment) }); // 2. AI script executes securely inside VM sandbox await compiler.compileAndRun("workflow.atl", ` @import("crm") val enterpriseList = crm.getCustomers("enterprise") println(enterpriseList) `); console.log(compiler.getOutput());