Canonical format: .mold.dal only. File naming:
*.mold.dal. This format is DAL-native and not plain JSON,
so molds are more resistant to copying without the DAL tooling. Legacy
.mold.json is still accepted when loading; new molds should
use .mold.dal and dal agent mold create
scaffolds .mold.dal.
mold/,
mold/samples (see dal agent mold list).
.mold.dal files are listed before
.mold.json.*.mold.dal (e.g.
my_agent.mold.dal). Use
dal agent mold create <name> to scaffold.Line-oriented block syntax. Comments: // to end of
line.
mold "name" "version"
Name and version are required; version defaults to "1.0"
if omitted. Both can be quoted strings or unquoted identifiers.
agent
type AI
role "Role description with {{param}}"
capabilities "read" "write"
memory_limit "256MB"
learning true
communication true
coordination true
trust_level standard
AI, System,
Worker, or custom:<name>. Default
AI if omitted.{{param}} for create-time substitution."256MB",
"2GB".true or
false.lifecycle
on_create "evolve::append_log(agent_id, \"created\")"
on_evolve "evolve::append_summary(agent_id, evolution_data)"
// Fraud detector mold
mold "fraud_detector" "1.0"
agent
type AI
role "Detect fraud with {{env}}"
capabilities "read" "analyze" "report"
memory_limit "512MB"
learning true
lifecycle
on_create "evolve::append_log(agent_id, \"created\")"
on_evolve "evolve::append_summary(agent_id, evolution_data)"
Content that starts with { is still parsed as JSON
(legacy .mold.json). Prefer creating and editing
.mold.dal for new molds.
Trust (shell execution) and evolve path (context file) are always from the process (agent.toml, env), never from the mold. See COMPREHENSIVE_AGENT_AND_MOLD_PLANS.md §3–4.
Use --param k=v (CLI) or the optional third argument to
mold::spawn_from (DAL). Params are merged into agent
metadata and substituted for {{key}} in role
and capabilities.