All pages

Docs / Build

Actions

Actions are what the assistant can do in your app for the person it is talking to: look up an order, propose a refund, change a setting. Each one is an endpoint of yours (or a tool of your MCP server) that Dezzi calls with the person your server signed in, never with someone the model names. You list them on the dashboard’s Actions page, in the draft, and people get them once you publish it.

An action

{
  "name": "refund_order",
  "description": "Refunds one of the person’s orders.",
  "input": { "type": "object", "properties": { "order": { "type": "string" } }, "required": ["order"] },
  "kind": "propose",
  "url": "https://api.example.com/support/actions",
  "fields": ["status"]
}

An app has at most 30 actions.

Kinds

KindWhat happensModes it is called with
readRuns whenever the assistant calls it.run
proposeYour app checks it first. It then waits in your inbox and runs only when you approve it.check, then execute
actRuns at once. Only for harmless changes you let the assistant make alone.run

The signed envelope

Dezzi calls an action’s url with a POST, whatever the action does, with these headers:

and this body:

{
  "action": "refund_order",
  "mode": "check",
  "user": { "id": "user-123", "email": "a@example.com", "name": "Ada" },
  "conversationId": "…",
  "proposalId": null,
  "input": { "order": "42" }
}

user is the person your own server signed the token for, never anything the model wrote, so you can trust it and must scope what the action does to that person: look the order up by its id and the user’s. input comes from the model, so check it like any form a person sends.

ModeYour answer
runAny JSON object. The model reads it (only fields, when you set them).
check{ "ok": true, "summary": "Refund $20 for order 42" } or { "ok": false, "reason": "…" }. Change nothing.
execute{ "ok": true, "message": "Your refund is on its way." } or { "ok": false, "reason": "…" }. The message is what the person is told.

Answer with a JSON object of at most 64 KB, within 10 seconds, with a 2xx status. Anything else counts as a failure.

Checking the signature

Check it on the raw body, before parsing, and refuse a call more than 5 minutes old. Compare in constant time. In Node (this is what verifyBody does in Dezzi’s own code):

import crypto from 'node:crypto';

export function verifyDezzi(secret, header, rawBody, now = Date.now()) {
  const parts = Object.fromEntries((header ?? '').split(',').map((part) => part.split('=', 2)));
  const time = Number(parts.t);
  if (!Number.isInteger(time) || !/^[0-9a-f]{64}$/.test(parts.v1 ?? '')) return false;
  if (Math.abs(now / 1000 - time) > 300) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${time}.${rawBody}`).digest();
  return crypto.timingSafeEqual(expected, Buffer.from(parts.v1, 'hex'));
}

Idempotency

An execute carries the proposal’s id as Idempotency-Key (and as proposalId). Do the change once per key: if your app can’t be reached or times out, the proposal stays approved and you approve it again to retry, so the same key can arrive twice. Keep the keys you have done, with their answer, and give the same answer again.

An endpoint in Express

import express from 'express';
import { verifyDezzi } from './verify-dezzi.js';

const app = express();

// The raw body, as text: the signature covers the exact bytes Dezzi sent.
app.post('/support/actions', express.text({ type: 'application/json', limit: '100kb' }), async (req, res) => {
  if (!verifyDezzi(process.env.DEZZI_ACTION_SECRET, req.get('x-support-signature'), req.body)) return res.status(401).json({ error: 'bad signature' });
  const { action, mode, user, proposalId, input } = JSON.parse(req.body);

  if (action === 'get_order') {
    const order = await db.orders.find({ id: String(input.order), userId: user.id });
    return res.json(order ? { status: order.status } : { error: 'No such order.' });
  }

  if (action === 'refund_order') {
    const order = await db.orders.find({ id: String(input.order), userId: user.id });
    if (!order || order.refunded) return res.json({ ok: false, reason: 'That order can’t be refunded.' });
    if (mode === 'check') return res.json({ ok: true, summary: `Refund ${order.total} for order ${order.id}` });
    if (mode === 'execute') {
      const done = await db.refunds.once(proposalId, () => payments.refund(order));
      return res.json({ ok: true, message: `Your ${done.amount} refund is on its way.` });
    }
  }

  res.status(404).json({ error: 'No such action.' });
});

Importing from OpenAPI

On the Actions page, paste an OpenAPI 3.0 or 3.1 document as JSON (YAML isn’t read; convert it first). Dezzi shows a draft action for each operation and you choose which to add:

"/support/refunds": {
  "post": {
    "operationId": "requestRefund",
    "summary": "Refunds one of the person’s orders.",
    "x-dezzi-kind": "propose",
    "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Refund" } } } }
  }
}

The import only describes the actions: every call still arrives as the signed envelope above, a POST whatever method the document gives, with the input inside input. Point the actions at endpoints that take it.

MCP servers

An MCP server’s tools can be actions too. Add the server on the Actions page with its public https address and, if it needs them, headers (a token, say, one Name: value a line). Headers are kept encrypted and never shown again. Then open the server’s tools and choose which become actions, and their kind. An MCP action names the server and the tool:

Dezzi reaches the server with your headers, so a tool that doesn’t check who the call is for would do whatever the model asks, for anyone. Until you mark a server as checking dezzi/signature (and acting only for the person in dezzi/user, or needing no person at all), its tools can only be propose actions: your team approves each call. A tool on an unmarked server that is listed as read or act is refused, when you save it and when it is called.

{ "name": "refund_order", "description": "…", "input": { … }, "kind": "propose", "mcp": { "server": "<server id>", "tool": "refund" } }

Dezzi speaks Streamable HTTP: MCP 2026-07-28 first, and, when a server answers like an earlier one, the initialize handshake of 2025-11-25, 2025-06-18 or 2025-03-26, keeping the server’s Mcp-Session-Id. It reads both JSON and event-stream answers, follows no redirects, waits 10 seconds and reads at most 64 KB.

What a tool gets

The model’s input is the tool’s arguments. Who the call is for is in the request’s _meta, beside MCP’s own fields:

{
  "name": "refund",
  "arguments": { "order": "42" },
  "_meta": {
    "dezzi/user": { "id": "user-123", "email": "a@example.com", "name": "Ada" },
    "dezzi/conversation": "…",
    "dezzi/mode": "check",
    "dezzi/proposal": null,
    "dezzi/signature": "t=1796300000,v1=…"
  }
}

dezzi/signature is signed like the envelope’s header, with your action signing secret, over the canonical JSON of the four fields plus "dezzi/tool" (the tool’s name) and "dezzi/arguments" (the arguments): keys sorted at every level, no spaces, values written as JavaScript’s JSON.stringify writes them. Check it before you trust dezzi/user: anyone who can reach your server can put anything in _meta.

const canonical = (value) =>
  Array.isArray(value)
    ? `[${value.map(canonical).join(',')}]`
    : value && typeof value === 'object'
      ? `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonical(value[key])}`).join(',')}}`
      : (JSON.stringify(value) ?? 'null');

// params: the tools/call request's params.
export function dezziUser(secret, params) {
  const meta = params._meta ?? {};
  const signed = canonical({
    'dezzi/user': meta['dezzi/user'],
    'dezzi/conversation': meta['dezzi/conversation'],
    'dezzi/mode': meta['dezzi/mode'],
    'dezzi/proposal': meta['dezzi/proposal'],
    'dezzi/tool': params.name,
    'dezzi/arguments': params.arguments ?? {},
  });
  return verifyDezzi(secret, meta['dezzi/signature'], signed) ? meta['dezzi/user'] : null;
}

dezzi/mode works as in the envelope. A propose tool is called with check first and must answer { "ok": true, "summary": "…" } (or { "ok": false, "reason": "…" }) as structuredContent or as JSON text, and with execute once you approve, with the proposal’s id in dezzi/proposal as its idempotency key. A result with isError is { "ok": false, "reason": <its text> } for a check or an execute, and { "error": <its text> } for the model on a run. Otherwise the model gets structuredContent, or the text as JSON when it is a JSON object, or { "text": … }.