BAML
BAML is an open-source programming language designed for AI agents, featuring a sound type system, typed errors, green threads, and built-in LLM function primitives.
At a Glance
BAML is free and open source. Runs entirely on your machine and never calls BoundaryML servers.
Engagement
Available On
Alternatives
Updated Aug 2026
About BAML
BAML (Basically A Made-up Language) is an open-source programming language built by BoundaryML specifically for writing AI agent code. It is licensed under Apache 2.0, runs entirely on your machine, and is callable from Python, TypeScript, Go, C#, Java, and other languages via generated SDKs. The project has accumulated over 8,700 GitHub stars and is actively developed with nightly releases.
What It Is
BAML is a statically-typed, agent-first programming language that looks like TypeScript but enforces soundness at runtime — there is no any, no unsafe casting, and every type is what the code says it is. It is designed to prevent the class of bugs that emerge when AI agents write or consume code: silent type coercions, untyped exceptions, and context pollution from sprawling imports. The language compiles to a native runtime written in Rust and can generate typed SDKs for host languages so existing codebases can adopt it incrementally without a full rewrite.
Language Design Philosophy
BAML's design is guided by a set of explicit principles documented in BoundaryML Enhancement Proposals (BEPs):
- No
any, no unsafe casts — types persist at runtime; a value must be proven to match a type before it can be used as one. - Typed errors — every
throwsstatement is statically analyzed; the compiler tells you every error a function can produce, and warns when a catch arm is unreachable. - Match expressions on types or values — replaces the
typeof/instanceof/"key" in objgrab-bag with a single, exhaustivematchconstruct that supports destructuring and guards. - Colorless concurrency — green threads via
spawnandawaitwithout requiring functions to be markedasync; the site claims a 9× wall-clock speedup on a 38 GB log-scan benchmark when using 16 parallel shards. - Filesystem-as-namespace — directories prefixed with
ns_define namespaces; there are no imports, only fully qualified names, so an agent canlsa project and immediately understand its layout. - Local edits — changes are designed to stay local so agents don't drift across the codebase chasing transitive dependencies.
Agent-First CLI Tooling
BAML ships a CLI (baml) with several commands designed for both human developers and AI agents:
baml describe— an AST-based grep that returns a function's signature, dependencies, and every call site in one command, without requiring an LSP or IDE hover.baml run <function>— runs any function in the project as a CLI command; parameters become--flagsautomatically.baml run -e— evaluates inline BAML expressions without writing a file, useful for quick agent scripting.baml pack— compiles a BAML program into a self-contained binary; the site reports a 12.1 MB binary (5.7 MB gzipped) versus 63.1 MB for an equivalent Bun-compiled binary.baml agent install— sets up BAML skills for Claude Code, Codex, and other coding agents.
LLM Functions and Agent Harness Primitives
An LLM call in BAML is expressed as a regular function: the prompt is the body and the return type is the schema. BAML includes an error-correcting JSON parser that coaxes structured output from small language models. The built-in test and eval framework lets developers write tests anywhere in any file, generate test cases from CSV or S3 at collection time, and define custom test runners (retries, quorum passes, parallel execution) as plain BAML functions. A profiler with flame-graph output and a workflow graph view in VS Code are included for human observability.
SDK Generation and Incremental Adoption
BAML generates typed SDKs for Python (pydantic v2 models), TypeScript (typed classes), and Go (in progress), so teams can call BAML functions from existing codebases without migrating everything. The generated client includes both sync and async variants of every function. BoundaryML describes the model as similar to an OpenAPI client generator, except the contract carries real business logic rather than just data shapes.
Update: BAML Language 0.15.1-nightly (August 2026)
The repository's default branch is canary and the latest published release as of early August 2026 is BAML Language 0.15.1-nightly.20260731.a, published 2026-08-01. The project self-describes as pre-1.0 but production-ready, with a cloud offering (observability, team controls, governance) announced as coming later in 2026. BoundaryML runs live onboarding sessions every Thursday and is actively recruiting Rust engineers from its Seattle, WA headquarters.
Community Discussions
Be the first to start a conversation about BAML
Share your experience with BAML, ask questions, or help others learn from your insights.
Pricing
Open Source
BAML is free and open source. Runs entirely on your machine and never calls BoundaryML servers.
- Full BAML language and runtime
- SDK generation for Python, TypeScript, Go
- baml CLI (run, describe, pack, agent install)
- Built-in test and eval framework
- VS Code / Cursor IDE integration
Capabilities
Key Features
- Sound runtime type system with no `any` or unsafe casts
- Typed and statically-analyzed error handling
- Match expressions on types and values with destructuring
- Colorless green-thread concurrency via `spawn` and `await`
- Filesystem-as-namespace with no imports
- Native LLM function primitives with error-correcting JSON parser
- Built-in test and eval framework with custom test runners
- SDK generation for Python, TypeScript, and Go
- baml describe: AST-based grep for agents
- baml run: execute any function as a CLI command
- baml pack: compile to a self-contained binary
- baml agent install: sets up skills for Claude Code and Codex
- Workflow graph view and flame-graph profiler
- Function mocking and sandboxing primitives (coming soon)
- Recursive self-improvement via agent-tries-baml simulation
Integrations
Demo Video

