> ## Content Index
> Fetch the complete content index at: https://blog.chainsafe.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Daml's MCP safety layer: Daml Reason
- URL: https://blog.chainsafe.io/mcp-safety-layer-daml-reason/
- Published: 2026-11-04T13:06:00.000Z
- Updated: 2026-11-11T20:30:37.000Z
- Description: Daml Reason gives your AI assistant working Daml examples to follow, then checks your AI's work.
- Author: Evan Wells
- Tags: Canton Network, #Import 2026-11-04 06:17

> *Daml Reason gives your AI assistant traceable, compiler-validated patterns or an honest "not covered." Never confidently wrong Daml.*

Coding agents are becoming the largest developer community on Canton Network. They already write Daml that compiles. What they lack is the knowledge human developers build up over years: which patterns hold up, and which ones quietly break.

Daml is a safe-by-construction smart-contract language. The authorization model is explicit. Every choice, signatory, and observer is declared in the code.

The AI coding assistants people use to *write* Daml are the opposite of that. An LLM completes patterns, but doesn't verify what they mean for the business. Feed it enough Daml, and it will produce code that *looks* right: plausible choices, familiar structure, an authorization model that compiles cleanly and encodes the wrong economic or legal relationship. The industry already knows AI models can write Daml. What we now need is a way to decide whether the agent should proceed, and what evidence backs that decision.

Today, we're launching Daml Reason to close that gap. Daml Reason, the next version of Daml Autopilot built by the ChainSafe team, gives your AI working Daml examples to follow at the moment it writes, then checks your AI's work. It's one tool with two phases, one before any code exists and one after. It isn't a code generator. It's the check that tells an agent when to continue, when to fix, and when to hand the work back.

## How it works.

1. It all starts with your intent. Tell your AI what you want to build: "Build a contract where two parties swap tokens."
2. Daml Reason searches its library and gives your AI up to five similar pieces of code that are known to work.
3. Your AI writes the code using those examples as a guide.
4. Daml Reason compares the new code against the examples and tells your AI what to fix.

If at any point Daml Reason can't find a good enough example for your build, it tells you, rather than guessing at code that could break your contracts.

It plugs into Cursor, Claude Code, or any AI coding tool that supports MCP, and can also run in CI.

## The server retrieves. It doesn't generate.

Before any code exists, you describe what you want to build, and Daml Reason searches a fixed, versioned library of 1,461 Daml examples. Every example comes from one of three official projects (daml-finance, Splice and the Daml SDK) and builds without errors. You get back a short list of the closest matches, each with a link to its source and an explanation of which parts of your request it matched. If Daml Reason reworded your request to search better, it tells you.

With Daml Reason, enterprises and financial institutions unlock AI agents that build smart contracts with citations sourced directly from institutional memory, filtering out stale blog posts and unreliable training data. The first draft is grounded in named, versioned patterns your team can trace and build on.

## Abstention is the safety feature.

Most AI tools are optimized to always have an answer. Daml Reason optimizes for answering only when recall is confident.

Our corpus is curated, giving it an edge. Before answering, Daml Reason checks two things: how closely the best example matches your request, and whether it's a better match than the rest. When your intent is too vague, recall is weak, or the corpus simply doesn't cover what you're asking, Daml Reason returns delegate: a first-class outcome, not an error, that sends you back to sharpen the intent. No list of weak matches comes attached. The agent can't dress up uncertainty as guidance.

In regulated work, "I don't know, sharpen your intent" beats confident, wrong pattern completion.

## A versioned corpus, with drift detected loudly.

Daml Reason’s examples come from a fixed, versioned library. Each example is pinned to an exact version of its source. When daml-finance, Splice or the Daml SDK changes, an automated daily check flags it to our team, along with a report on how the change would affect search results. Nothing changes for your AI until a ChainSafe engineer reviews the update and releases a new version of the library.

## A verdict loop, with compile proof.

Daml Reason takes your business intent and draft and returns one of two verdicts: fail or ready to compile. You can go around as many times as you need (that's the point).

The server doesn’t compile. You build the code on your own machine (or in CI) and send Daml Reason the result: did it build, yes or no. If there is no clear “yes”, your code fails.

We'll be plain about where this stands: checking alignment between intent and code is still maturing, and Daml Reason doesn't prove your business logic correct. What it gives you today is a check you can run again and again, with one firm rule: no clean build = not ready to compile.

## One contract for your IDE and your CI.

Same tool, same outcomes, same bar for what counts as a match, whether the caller is an agent in Cursor or a merge gate in your pipeline. Governance teams get one verification contract to enforce, instead of IDE magic on one side and CI rules on the other. Daml Reason runs locally in your development environment or as an authenticated, hosted service.

## Why we built it this way.

Our design posture is deliberate. Daml Reason is a single-purpose MCP tool that does one job: it is the safety layer between LLM drafts and ledger code. Generation stays client-side in the developer's IDE; the server retrieves, gates, and renders verdicts. The intended loop is simple: orient on corpus patterns (or get told to sharpen your intent), draft locally, then run the verdict loop and compile when you're ready.

We're not optimizing for an autonomous code factory. We're building for how banks actually work: human accountability with AI acceleration, not replacement. And we don't think a company's entire codebase should be dependent on any single large-scale AI application.

💡

***Note** *: Daml Reason is a development assistant, not a substitute for independent review. All generated code must be reviewed and validated by your team before use.*

## Give your AI agent something to check against.

Daml Reason plugs into Cursor, Claude Code, or any MCP-compatible tool, and runs the same checks in your CI. Describe what you want to build and see what it finds, or what it tells you to sharpen.

[Daml Reason · Curated Daml and Canton context for AI agentsAn MCP server that provides your agent with canonical code references so it doesn’t have to guess.![](https://blog.chainsafe.io/content/images/icon/favicon-1187ed82-a188-4636-9456-0ab829efb67e.png)DamlReason](https://daml-reason.chainsafe.io/?ref=blog.chainsafe.io)

## About ChainSafe

ChainSafe is a leading blockchain research and development firm specializing in protocol engineering, infrastructure development & operations, and co-development.

ChainSafe creates solutions for developers and teams across web3\. As part of our mission to build accessible, improved tooling for developers, ChainSafe embodies an open-source, community-guided ethos to advance the future of the internet.

[Website](https://chainsafe.io/?ref=blog.chainsafe.io) | [Youtube](https://www.youtube.com/channel/UCpm0lKkxhEKWutbPt1hOgRg?ref=blog.chainsafe.io) | [Twitter](https://twitter.com/chainsafeth?ref=blog.chainsafe.io) | [Linkedin](https://www.linkedin.com/company/chainsafe-systems?ref=blog.chainsafe.io) | [GitHub](https://github.com/ChainSafe/?ref=blog.chainsafe.io)