Mold format (canonical: .mold.dal)

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.

File location and naming

.mold.dal syntax

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 block

agent
  type AI
  role "Role description with {{param}}"
  capabilities "read" "write"
  memory_limit "256MB"
  learning true
  communication true
  coordination true
  trust_level standard

Lifecycle block (optional)

lifecycle
  on_create "evolve::append_log(agent_id, \"created\")"
  on_evolve "evolve::append_summary(agent_id, evolution_data)"

Example

// 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)"

Legacy JSON

Content that starts with { is still parsed as JSON (legacy .mold.json). Prefer creating and editing .mold.dal for new molds.

Principal vs mold

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.

Create-time parameters

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.