> ## Documentation Index
> Fetch the complete documentation index at: https://myna.cx/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Anatomy of the Myna Runtime

Proprietary agent harnessChecked before and after every replyStops when your team takes over

## **What is a runtime?**

A runtime is the software that runs an AI agent. The AI model understands language and decides what to do, but on its own it can't send a message, book an appointment or follow a rule every time. The runtime handles everything around the model: it receives each message, checks it, gives the model the information it needs, runs the tools the model asks for, checks the reply and sends it.

![The Myna Runtime around the AI model: messages arrive from any channel, pass pre-gates, the model reads context modules and runs tools that return evidence, and post-gates check the reply before it sends](https://mintcdn.com/myna-8262a91b/3t_eYnQvqYhK9mic/images/runtime/runtime-overview.png?fit=max\&auto=format\&n=3t_eYnQvqYhK9mic\&q=85\&s=11249f6906dffc27c9e40f9af3e6fd71)

Every Myna agent runs on the Myna Runtime. There is nothing to install or set up. The instructions, persona, tools and knowledge you set in Workflow Studio all run inside it, the same way on every channel.

## Building the runtime

Explore how you can set up the Myna Runtime directly from the platform.

### **Inbound: a message arrives**

A customer sends a message on any connected channel. The runtime records who sent it, what they wrote and which channel it came through, so every stage after this one starts from the same facts.

<table>
  <colgroup>
    <col width="200" />

    <col width="500" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Channels**\
      Agent → Channels</td>
      <td>Where the agent can respond, in order of priority</td>
    </tr>

    <tr>
      <td>**Assignments**\
      Agent → Assignments</td>
      <td>Which contacts this agent works with, and on which channels</td>
    </tr>

    <tr>
      <td>**Direction**\
      Agent → Channels</td>
      <td>Who starts the conversation</td>
    </tr>

    <tr>
      <td>**Response Delay**\
      Agent → Reply Settings</td>
      <td>How long the agent waits before starting a workflow</td>
    </tr>

    <tr>
      <td>**Tracing**\
      Agent → Show logs</td>
      <td>What happened on each inbound message</td>
    </tr>
  </tbody>
</table>

### **Pre-gates: checked before any model runs**

Before any AI model runs, the runtime checks the message against a set of rules written in code. If a check fails, the message is blocked or deferred, and no model is involved at all.

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Opt-Out**\
      Contacts → status</td>
      <td>Contacts who asked to stop or unsubscribe</td>
    </tr>

    <tr>
      <td>**Channel compliance**\
      Settings</td>
      <td>Rules that apply per channel, such as A2P 10DLC compliance for SMS</td>
    </tr>

    <tr>
      <td>**Takeover**\
      Conversations</td>
      <td>User takeover enabled to stop AI replies</td>
    </tr>

    <tr>
      <td>**Message Cap**\
      Agent → Channels</td>
      <td>Checks if message count is below the set limit</td>
    </tr>

    <tr>
      <td>**Agent Reply Schedule**\
      Agent → Reply Settings</td>
      <td>When the agent is allowed to reply</td>
    </tr>
  </tbody>
</table>

### **Context: assembled in modules**

Your instructions never become one giant prompt. Objective, persona, tool policies, channel guidance, knowledge and corrections are separate modules, and each stage reads only what it needs.

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Instructions**\
      Studio → Agent node</td>
      <td>The agent's overall system instructions, objectives, tool references and variables</td>
    </tr>

    <tr>
      <td>**Persona**\
      Agent → Persona</td>
      <td>The agent's tone and writing style</td>
    </tr>

    <tr>
      <td>**Tool policy**\
      Studio → Tools</td>
      <td>Tool-specific settings, input/output vars, and policies</td>
    </tr>

    <tr>
      <td>**Channel policy**\
      Studio → Composer</td>
      <td>How replies are formatted on each channel</td>
    </tr>

    <tr>
      <td>**Knowledge**\
      Agent → Memory Hub</td>
      <td>What data is accessible by the agent</td>
    </tr>

    <tr>
      <td>**Business Context**\
      Settings → Business Profile</td>
      <td>Your business details</td>
    </tr>

    <tr>
      <td>**Contact Fields**\
      Agent → Contact Fields</td>
      <td>What contact fields the agent can see and edit</td>
    </tr>

    <tr>
      <td>**Conversation History**\
      Agent → Contact</td>
      <td>Previous messages including timestamps and channels</td>
    </tr>

    <tr>
      <td>**Live state**\
      Agent → Contact</td>
      <td>Where a contact currently lives in a workflow</td>
    </tr>
  </tbody>
</table>

### **Planner: reasons, then calls its tools**

The planner is the part of the agent that thinks. It reads the context, works out what the customer needs and calls tools by name. After each tool returns, it reads the result and decides what to do next.

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Tools**\
      Studio → Agent Node</td>
      <td>Which tools the planner can call</td>
    </tr>

    <tr>
      <td>**Gates**\
      Studio → Tools</td>
      <td>Tools that are disabled until certain conditions are met</td>
    </tr>

    <tr>
      <td>**Planner model**\
      Studio → Models</td>
      <td>The AI model that decides which tools or skills to call</td>
    </tr>
  </tbody>
</table>

### **Tool evidence: tools return evidence**

When the planner calls a tool, the tool fills in its own inputs from the conversation and the contact record, runs, and returns structured output. That output is evidence of what actually happened, not a message for the customer. It goes back to the planner for its next decision, and then to the composer once no more checks are required.

Here is a booking as data:

```json Input · what the tool filled in theme={null}
{
  "source_text": "Tuesday at 10 works for me",
  "appointment_time_iso": "2026-12-01T10:00:00-05:00"
}
```

```json Evidence · what the tool returned theme={null}
{
  "ok": true,
  "summary": "schedule_appointment outcome=booked",
  "data": {
    "outcome": "booked",
    "appointment_datetime_iso": "2026-12-01T10:00:00-05:00",
    "calendar_name": "Cleaning",
    "duration_minutes": 60
  }
}
```

> [!NOTE]
>
> Tools that change data, such as booking an appointment or updating a contact, run one at a time. Only one of them can run per step, and if a call has already succeeded, running it again returns the first result instead of booking twice.

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Extractor model**\
      Studio → Models</td>
      <td>The AI model that converts natural language and context into tool inputs</td>
    </tr>

    <tr>
      <td>**Inputs and outputs**\
      Studio → Tools</td>
      <td>What each tool is allowed to receive and return</td>
    </tr>
  </tbody>
</table>

Native tools available today:

compose replysearch memoryask qualificationupdate contactchange statusupdate tagsadd noteturn off aioffer appointmentschedule appointmentmodify appointmentcreate ticketupdate tickethand off to humansend call to actionsend gif

**Custom tools:** You're able to connect webhooks, MCP tools and custom integrations to give your agents additional tools and skills.

### **Composer: one composer writes the reply**

Once the planner is done, a single composer writes the reply, using confirmed evidence only. Its voice comes from your persona settings. The length, formatting and layout come from the channel policy, so the same answer can be a short text on SMS and a fuller message by email.

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Persona**\
      Agent → Persona</td>
      <td>The agent's tone and personality</td>
    </tr>

    <tr>
      <td>**Writing Style**\
      Personas → Writing Style</td>
      <td>Spelling, slang, punctuation and emoji</td>
    </tr>

    <tr>
      <td>**Channel policy**\
      Studio → Composer</td>
      <td>How replies are formatted on each channel</td>
    </tr>

    <tr>
      <td>**Corrections**\
      Playground → Feedback</td>
      <td>Wording fixes you approved during training</td>
    </tr>

    <tr>
      <td>**Composer model**\
      Studio → Models</td>
      <td>The AI model that writes the reply</td>
    </tr>
  </tbody>
</table>

### **Post-gates: checked again before it sends**

Before anything is sent, a second set of checks written in code compares every claim in the reply with the tool evidence. They catch replies that claim something no tool proved, such as a booking, a ticket, a handoff or a contact update. A reply that fails gets one repair pass. If it still fails, the runtime sends a safe line or nothing at all.

Here is a booking that failed, and the reply that claimed it anyway:

```text Draft reply theme={null}
You're booked for Tuesday at 10:00!
```

```json Post-gate result theme={null}
{
  "action": "request_composer_repair",
  "reasons": ["appointment_confirm_without_tool"],
  "repair_hints": [
    "Remove appointment confirmation language unless booked/modified evidence exists."
  ]
}
```

```text Repaired reply theme={null}
Tuesday at 10:00 was just taken. Would 11:00 work instead?
```

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Hand Off to Human**\
      Agent → Hand Off to Human</td>
      <td>Checks that a handoff really happened before the reply says so</td>
    </tr>

    <tr>
      <td>**Tools**\
      Studio → Agent Node</td>
      <td>Which actions a reply is allowed to claim</td>
    </tr>

    <tr>
      <td>**No reply**\
      Studio → Composer</td>
      <td>When the agent may leave a message unanswered</td>
    </tr>
  </tbody>
</table>

### **Send: reply and update state**

Only the runtime sends messages, and only after the post-gates approve. In a workflow with multiple stages, the contact then lands on the right next step. Routing uses deterministic conditions, and the workflow graph is verified so it can always run.

<table>
  <colgroup>
    <col width="240" />

    <col width="460" />
  </colgroup>

  <thead>
    <tr>
      <th>**Setting**</th>
      <th>**What it controls**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Send from**\
      Agent → Channels</td>
      <td>The number or address the reply goes out from</td>
    </tr>

    <tr>
      <td>**Split Texting**\
      Agent → Reply Settings</td>
      <td>Sends a longer reply as separate texts</td>
    </tr>

    <tr>
      <td>**Conditions**\
      Studio → Agent Node</td>
      <td>Where the contact goes next</td>
    </tr>

    <tr>
      <td>**Billing**\
      Settings → Billing</td>
      <td>What each reply costs</td>
    </tr>
  </tbody>
</table>

## **One Agent Node or several?**

Each **Agent Node** is one set of instructions working with the tools you select. An agent's workflow can have one Agent Node or **several**, connected by workflow steps. Workflows with several Agent Nodes are available on request.

> [!TIP]
>
> Only switch on the tools your agent's job needs. Fewer tools make your agents more accurate. For more complex workflows, multiple Agent Nodes and Condition nodes are better.

## **Why not just write one big prompt?**

Many AI agents out there are built on **a single long prompt that holds everything at once:** the personality, the business rules, the tool instructions, the prices and the formatting. But with this strategy as a business adds rules and edge cases, the prompt keeps growing, and problems start to show.

> [card] **Rules collide**
>
> Instructions like “keep replies short” and “explain every service in detail” can sit side by side, and the model decides which one wins.

> [card] **Stronger wording doesn't fix anything**
>
> Writing a rule in capital letters doesn't guarantee the model follows it. It is still one instruction weighed against hundreds of others.

> [card] **Critical rules get buried**
>
> A rule such as never confirming a booking before it happens sits in the same text as a rule about emoji, and to the model, both are just lines of text with the same weight.

> [card] **Mistakes are hard to trace**
>
> When everything lives in one document, it's hard to tell whether a problem came from the instructions, the knowledge or a conflicting rule. The usual fix is one more sentence.

Myna splits that work apart. Your agent’s setup is kept in separate modules for instructions, persona, tool rules and knowledge. The rules that must always hold are written into the software itself, outside the prompt. This is the difference between an AI Agent tool and an award-winning harness.

## **What the runtime promises**

These eight rules hold on every turn, on every channel, for every agent.\


> [card] **Tools never send**
>
> Only the runtime sends messages, and only after the post-gates approve. A tool built to send messages can't even be registered.

> [card] **One change per step**
>
> Only one booking, ticket or handoff runs per step, and a call that already succeeded returns its result instead of running twice.

> [card] **A bounded loop**
>
> Planning runs for a small, capped number of steps. Any tool failure ends it, and the customer still gets an honest reply.

> [card] **A fixed order of priority**
>
> Truth comes first, then safety and your policies, then the conversation and your instructions, then the persona's voice. The channel decides how the reply is delivered.

> [card] **Tools can be removed**
>
> Each layer can only narrow the tools on offer. A tool that isn't enabled for the current turn is refused, even one that only reads data.

> [card] **No false confirmations**
>
> A failed booking, move or handoff can never be reported as done. A reply can only claim what a tool proved.

> [card] **Takeover means silence**
>
> When someone on your team takes over, the agent stops before any model runs. Incoming messages still reach your team.

> [card] **Facts come from records**
>
> Contact fields, answers, appointments and tickets are read from structured records every turn, not remembered from the transcript.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.