The problem
AI agents reason non-deterministically and usually communicate in free-form text or loosely structured output. Their work can be hard to check, review, reproduce, and hand to the next agent or tool.
The idea
Give the agent a precise language to work in. Its reasoning is still non-deterministic, but its output lands in a form that machines can check and experts can read, review, and approve in the domain's own terms.
The pattern
Agents propose changes in the DSL. Machines check encoded rules; experts assess intended meaning.
- A well-defined domain language. A DSL with explicit grammar and semantics, designed for the domain rather than for general programming.
- Agents that read and write DSL documents. Inputs may include natural-language requirements, but results are not communicated only as free-form text.
- Formal validation. Parsers, type checks, and constraint checkers verify every agent-produced document. Passing establishes conformance to encoded rules, not that the document meets the intended requirements.
- Human review where appropriate. The DSL is designed for domain experts to read and assess directly, in language workbenches, IDEs, or web editors.
- Deterministic downstream processing. Transformations, compilers, and generators turn validated documents into deliverables, producing the consistent outputs from the same declared inputs.
Worked example: a laboratory protocol
Request: Make a six-point two-fold dilution series of sample S1 in a 96-well plate, add the developing reagent, incubate for 15 minutes at 37 C, and read absorbance at 450 nm.
What it is not
Not a language for governing agents
DSLs can also be defined that constrain what an agent may do. Those languages guard the agent. Here, the DSL is what the agent writes: a document describing the domain itself.
Not just structured output
Valid JSON or schema conformance is not enough. The language must express domain concepts with explicit semantics and rules, in a notation experts can read, review, and edit directly.
Not agents writing arbitrary general-purpose code
Code can be a downstream product of the process, but it is not the shared medium.
Get involved
Open questions
- How should a DSL be designed so agents can use it reliably?
- What is the right division of labor between agent, validator, and human reviewer?
- How should DSLs evolve safely when agents propose extensions to the language?
- How do you measure whether such a system is more reliable than a free-form one?
Join the conversation
Examples, critiques, and related work are welcome.
Email:
Use the term
"DSL-mediated Agents" is free for anyone to use, with no permission needed. Hashtag: #DSLMediatedAgents. A reference back to this page is appreciated.
Cite
Steve Livengood. "DSL-mediated Agents: A Definition." 2026. https://doi.org/10.5281/zenodo.23587494
@misc{livengood2026dslmediated,
author = {Livengood, Steve},
title = {{DSL-mediated Agents: A Definition}},
year = {2026},
month = oct,
publisher = {Zenodo},
doi = {10.5281/zenodo.23587494},
url = {https://doi.org/10.5281/zenodo.23587494}
}