Agent Mesh as Code with sam config plan and apply

I build agents in the UI when I’m exploring. Once something works, I want it in git. sam config gives you a Terraform-style loop for Solace Agent Mesh: describe agents, workflows, connectors, entrypoints, roles and evals in YAML, preview the diff, then apply it.

Everything hangs off a manifest:

kind: manifest
name: northwind-demo
target:
  name: desktop
resources:
  models: [claim-router]
  toolsets: [freight-rates, customs-compliance]
  connectors: [northwind-tms-db]
  agents: [Customer Support Agent, Shipment Tracker]
  workflows: [Shipment Exception Triage, Carrier Claim Router]
  entrypoints: [Carrier Invoice Intake]

desktop is a reserved target that resolves to the desktop app running on your machine, so there’s no port to hardcode. For a shared environment, swap it for a URL and a token read from SAM_PLATFORM_TOKEN. The rest of the repo stays the same.

The loop:

sam config plan  -m manifests/northwind-demo.yaml   # preview the diff
sam config apply -m manifests/northwind-demo.yaml   # create, update, deploy
sam config pull  -o exported/                       # export live state to YAML

plan prints a per-resource diff: + for create, ~ for update. apply deploys the agents, workflows and entrypoints it touches unless you pass --no-deploy. I seeded an entire demo tenant this way: 8 agents, 4 workflows, 6 entrypoints, 3 toolsets, roles and evals, all from one command.

Three things I wish I’d known on day one:

  1. Be careful with --prune. It deletes every resource of a listed kind that isn’t in your manifest, including the built-in Orchestrator and anything a teammate made in the UI. Plain apply never deletes.
  2. plan --detailed-exit-code exits 2 when changes are pending. That makes drift detection a one-line CI step.
  3. Secrets stay as references. Write ${DB_PASSWORD} and it resolves from your environment or a .env at apply time. pull exports secrets back as references too.

When you don’t remember a field, sam config schema example <kind> prints a starter file.

Docs:

Download the Solace Agent Mesh desktop app, build something in the UI, then sam config pull it and look at the YAML.

Are you running this from CI yet? I’d love to hear how you structure your config repo and promote changes between environments.

1 Like