Get in touchContact

All work

Work · Public project

Switchyard

Agent workflows for a solar installer’s sales and service desk, built so that nothing reaches a customer twice, and nothing binding goes out without a person’s signed approval.

Status
Open source · Nov 2026
Stack
  • OpenAI Agents SDK
  • MCP
  • Python
  • SQLite
  • Jinja2
Disclosure
Public project
Demo
Video
Play on YouTube0:51
Switchyard on live OpenAI models
Recorded on live OpenAI models: agents take a bakery’s enquiry to a proposal on their own, a draft missing a figure goes back, and the customer email waits for a person’s approval. In a test, a model told by an attacker to skip approval is refused.

Project videos load from YouTube only when you press play.

  • Switchyard approval screen: a solar proposal email to a customer, marked as a binding commitment, with why a person decides and an Approve and send button.
  • Switchyard run detail: the steps of a lead-to-proposal run with their status, evidence and the estimate.
  • Switchyard exceptions queue: an agent that overstepped its permissions, with the next step for the person on duty.
An email waiting for a person’s signed approval, a run’s steps and evidence, and the exceptions queue.

What it is

Switchyard takes a solar installer from a new enquiry to a proposal: agents qualify the lead, estimate the system, draft the proposal and its email, and book a survey, while a service-desk agent answers requests from existing customers. A console shows approvals, runs, exceptions, the audit log and model costs.

It is a reference for agent workflows that can face real customers: durable, verifiable, and with the rules enforced in code rather than in prompts.

Process: what we built

Workflows run on a durable engine with leases and fencing tokens, so a crashed worker’s job resumes without running twice. Every outside action goes through an outbox: it is written down before it runs, looked up before any retry, and read back afterwards to confirm it happened.

Risk classes in a policy file decide what needs approval. Approvals are signed and bound to the exact content approved, so an edited email needs a fresh sign-off. The audit log is hash-chained, and cost caps stop a run that overspends. Six agents run on the OpenAI Agents SDK, with a read-only MCP server for business data.

  1. 01Triage
    • Routes enquiries and service requests
  2. 02Qualify
    • Lead qualifier and estimator
  3. 03Draft
    • Proposal and email writer, then a reviewer
  4. 04Approve
    • Signed approval for binding steps (where the system decides)
  5. 05Deliver
    • Outbox: sent once, then read back
System schematic, drawn from the project’s facts. The outlined item is where the system decides.

Results and limits

Results

  • The demo suite runs 13 scenarios with 78 checks, including a worker killed mid-run; all pass.
  • A live run on OpenAI models handled three enquiries; its reviewer caught a missing figure, and the model ignored an injected instruction.

Limits

  • The CRM, calendar and email systems are simulated in the demo; the HubSpot and Slack adapters are tested only against mocked HTTP.
  • The live mode was run once by hand, not in continuous integration, and the estimates in the demo are illustrative.

Building something like this for a client?

We can build it under your agency’s brand, for a fixed project fee.

Get in touch contact@neurosmith.co