- Twig Dev Notes
- Posts
- Agent Scripting Language
Agent Scripting Language
Voice Agents, ASL, Deterministic Agents
Voice Agents are now live, Check out a real voice conversation below.
Engineering Notes
Chunking Methods

What is Agent Scrpting Language (ASL)
Why we built ASL
Modern AI agents increasingly need to orchestrate multi-step workflows that span tool calls, conditional branching, state management, and recovery from partial failures — yet expressing these workflows in general-purpose code or raw prompts has proven brittle and hard to reason about. Imperative code forces engineers to manually wire up retries, context propagation, and tool routing for every new agent, while prompt-only approaches make control flow opaque and untestable. We built ASL (Agent Scripting Language) to give agent authors a purpose-built abstraction layer that treats tool invocations, model calls, and control flow as first-class primitives. By constraining the surface area to operations that actually matter for agent execution — declarative tool bindings, typed inputs and outputs, scoped memory, and explicit transition rules — ASL eliminates entire categories of bugs (stale context, lost intermediate results, ambiguous handoffs between steps) that plague hand-rolled orchestration code. The language is designed to be read top-to-bottom like a runbook, so the behavior of an agent is auditable by reviewers who do not need to trace through framework internals.
How ASL helps in practice
Operationally, ASL pays for itself in three places: authoring speed, observability, and safe iteration. Because the runtime owns execution semantics, an ASL script automatically inherits structured logging at every step, deterministic replay of past runs against new model versions, and uniform error handling — capabilities that would otherwise require bespoke instrumentation per agent. The DSL's static structure means we can lint scripts before deployment (detecting unreachable branches, missing tool credentials, or unbound variables), generate execution graphs for review, and diff behavioral changes across versions in a way that is impossible with free-form code. For developers, this turns agent engineering from a debugging-heavy craft into a more declarative workflow: describe the steps, declare the tools, and let the ASL runtime handle the mechanics of dispatch, context windowing, retry policy, and tool result validation. The result is that teams ship new agents in hours rather than days, and the resulting agents are easier to reason about, test in isolation, and evolve as underlying models and tools change.
Enterprise AI agents would create a "multi-trillion-dollar opportunity" for many industries, from medicine to software engineering.
About Twig
Ship Agents Faster
Twig lets you ship production ready voice, chat and email agents within days.
