Skip to content

Keynote: BAML - A New Programming Language for Building Agents

Vaibhav Gupta

Blue TeamThe Linux Foundation15 minOpen on YouTube ↗

Investigates keynote: BAML - A New Programming Language for Building Agents and evaluates key implications for security practitioners.

Summary

### Overview In this keynote, speaker Vibb introduces BAML, a domain-specific programming language designed to build reliable, maintainable agentic AI applications. Addressing the common frustration that large language model (LLM) implementations often feel flaky or function only as fragile prototypes, the presentation argues that developers must hold AI to standard software engineering expectations. Unlike cloud infrastructure failures where third-party providers can be blamed, hallucinations and reliability issues fall squarely on the application developer. BAML was created to address this problem by replacing messy string concatenations with type-safe, functional abstractions.

### Key Topics - **The Reliability Burden in AI Engineering**: In standard software, a 5% failure rate is intolerable. When building AI systems, developers have mistakenly accepted high failure rates, but the responsibility for application correctness rests on the developer rather than LLM providers. - **Evolution of Developer Tooling**: Just as web development evolved from raw text templates to JSX/TSX in React for static analysis and safety, and data science evolved from plain Python scripts to Jupyter notebooks (`.ipynb`) for rapid iteration loops, AI development needs specialized abstractions rather than string-heavy boilerplate. - **Problems with String-Based Prompting**: Treating prompts as string templates or chained F-strings makes context engineering brittle, complicates switching models, and introduces slow iteration cycles that discourage finding optimal solutions. - **BAML Language Design and Features**: BAML models prompts as first-class functions with defined input parameters, return types, and explicit LLM call operators. It features deep editor integration (such as in VS Code) allowing developers to inspect raw rendered prompts, dynamic inputs, raw network requests, model fallbacks, and retry policies.

### Technical Details - **Function-First Prompts**: Prompts are declared with input parameters and strict return types that support code navigation (e.g., jump-to-definition) and embedded instructions. - **Testing and Playground**: BAML provides an integrated editor playground where developers can write unit tests, inspect raw prompts versus runtime data, test multimodal inputs (such as images), and instantly observe output parsing. - **Robust Parsing and Resilience**: BAML parses and cleans up noisy model outputs (such as removing unwanted markdown fences or backtick JSON blocks) and extracts strictly typed structures even when the model includes extra reasoning text or disregards formatting constraints like JSON quotation marks. - **Model Fallbacks and Retries**: Retry policies—such as exponential backoffs (e.g., waiting 450 ms before retrying GPT-4 mini, then falling back to Sonnet)—are declared and visually inspectable directly within the code. - **Polyglot and Type Safety**: BAML integrates seamlessly into target codebases, generating native types and client methods for languages like TypeScript and Python. Modifying a BAML schema immediately propagates updated type definitions to the host language. - **Architecture**: BAML is built in Rust for high execution speed and concurrency, runs completely air-gapped without external dependencies, and works across any LLM.

### Takeaways BAML aims to bring software engineering rigor—static analysis, type safety, fast feedback loops, and automated parsing—to AI agent development. Started by Vibb and co-founder Aaron at Boundary after growing dissatisfied with complex string-based orchestration frameworks like LangChain, the open-source language is now used in production by over a thousand organizations ranging from Fortune 50 companies and government agencies to small independent developer teams.

Related talks