Skip to the content
Agent Tools

Let AI agents draft social posts but never publish them: a review gate in front of Postiz

Our agents write the posts for our social channels in Postiz, and no agent can publish one without a passing review. A small proxy between the agents and Postiz lets drafts through and refuses any publish request until a separate review run has scored that exact text 8 of 10 or more. It stops agent mistakes, not a forged review, and a person signed in to the calendar can still post by hand.

By OpenKrill. Published 2026-10-13. The gate's behaviour comes from requests we sent to our own gate on 2026-10-13; the counts come from its approvals ledger; the Postiz facts come from the Postiz docs and plans page, read on 2026-10-13.

The Postiz link in this post goes through our own address so we can count clicks, and earns us nothing today. It is marked where it appears.

The short answer

Give your agents the address of a small proxy instead of the scheduler's own address. The proxy rules on each request: drafts pass, anything that would publish needs a passing review, and anything it doesn't know is refused.

Here is how ours rules on each agent request:

Agent requestWhat the gate does
Read anything, upload mediaPasses
Create a post with type: "draft"Passes
Create a post with type: "schedule" or "now"403, "posts are created as drafts"
Change a draft's status to scheduledPasses only if every rule below passes, and writes one ledger line
Delete a post403: only people delete, in the web calendar
MCP: list and upload tools, or the post tool with every post a draftPasses
Any other MCP tool, including tools a Postiz update adds laterJSON-RPC error -32001
A person signed in to the web calendarPasses untouched

The Postiz link below goes to postiz.com through our own address, so we can count clicks. It earns us nothing today: we applied to the Postiz affiliate program, and if Postiz accepts us, a sign-up through it may earn us a commission.

We run this in front of Postiz, an open-source social media scheduler with a public API and an MCP server, so an agent can draft, schedule or publish posts on the channels you connect.

That link earns us nothing today, and the post works the same without it. Direct address: https://postiz.com

Why the API key alone is not enough

The Postiz create-post endpoint takes a type field with 3 values: now publishes at once, schedule publishes at the given date, and draft stores the post without scheduling it. The MCP server's post tool says the same thing: "Schedule, draft, or immediately publish posts". So the line between a draft and a live post is one field, and the agent fills it in.

A prompt that says "always make drafts" holds until the day it doesn't. A model that misreads a task, a retry loop, or a tool description that changed in an update can each turn a draft into a live post on a real account. We wanted that line drawn in code the agent can't edit, not in the prompt.

The shape: one proxy, two doors

The gate is 442 lines of Node in 2 files, the proxy and its rules (counted on 2026-10-13), with no packages beyond Node itself. Postiz listens on the loopback address only, so the gate is the one public door for agents. Agents get the gate's address as their Postiz base URL, the public API under /api/public/v1 and the MCP endpoint under /api/mcp, and never Postiz's own port. The gate reads 2 kinds of agent traffic: the public API (/api/public/v1, with the org API key) and the MCP endpoint. Every other path, which is the web app people use, is forwarded unchanged.

The core of the API side, shortened:

async function publicRequest(req, res, path) {
  if (req.method === "GET" || req.method === "HEAD") return forward(req, res);
  if (req.method === "POST" && /^\/upload(-from-url)?$/.test(path)) return forward(req, res);
  if (req.method === "POST" && path === "/posts") {
    const raw = await readBody(req);
    if (JSON.parse(raw).type !== "draft") throw new GateError(403, "posts are created as drafts");
    return forward(req, res, raw);
  }
  const status = /^\/posts\/([^/]+)\/status$/.exec(path);
  if (req.method === "PUT" && status) return scheduleRequest(req, res, status[1]);
  throw new GateError(403, `${req.method} ${path} is not open to agents`);
}

Two choices matter more than the code. First, the gate denies by default. A write it doesn't know is refused, so a new endpoint in a Postiz release stays closed until someone opens it. Second, the MCP side uses an allow-list of tool names, so the image and video tools, the helper that runs channel actions, and anything added later all get the -32001 error.

The allow-list on our Postiz version: integrationList, groupList, integrationSchema, postsListTool, postSettingsTool, uploadFromUrlTool, uploadWidgetTool, uploadWidgetTicketTool and uploadWidgetStatusTool. The post tool, integrationSchedulePostTool on our version, passes only when every post in the call has type: "draft" and names no group, because a group rewrite deletes the group's other posts. The current Postiz docs list the post tool as schedulePostTool, so check the names on your version.

The rules a scheduled post must pass

An agent asks to schedule a draft by sending the draft's id and its review. The gate reads the calendar around the post's date and checks:

  • A review of 8 or more for this exact text. The review carries a hash of the text it scored, so one changed comma after the review means a new review.
  • The channel's content line. Each channel has one topic line, and the review must be for that line.
  • House style. No en or em dash, and none of a short list of template openings and closings.
  • Time. At least 15 minutes ahead, so a person can still pull it.
  • Volume. At most 2 posts per channel per day, and 4 on our clips channel, counting posts scheduled outside Postiz too.
  • No cross-posting. No near-same text on another channel within 14 days, published posts included. Near-same means the 2 texts share half or more of their word pairs (Jaccard overlap of 0.5 or more).

The review is its own model call, apart from the agent that wrote the draft. Claude Opus 5.5, with none of the drafting conversation, reads the draft, the channel's line and the channel's 6 posts before it. It answers with a score from 1 to 10, the line and a reason.

Here are the checks exactly as the gate runs them. Each returns a list of problems, and an empty list lets the post through:

export function gateProblems({ post, review, calendar, outside = [], now = Date.now(), replaces }) {
  const lead = new Date(post.publishDate).getTime() - now;
  return [
    ...reviewProblems(post, review),
    ...lineProblems(post, review),
    ...textProblems(post),
    ...(lead < MIN_LEAD_MS ? [`the post is due in under ${MIN_LEAD_MS / 60_000} minutes; give it a later date`] : []),
    ...capProblems(post, calendar, outside),
    ...outsideTwinProblems(post, outside, replaces),
    ...crossPostProblems(post, calendar),
  ];
}

function reviewProblems(post, review) {
  if (!review || typeof review !== "object") return ["no review: run `content review <post id>` first"];
  const problems = [];
  if (!(Number(review.score) >= MIN_SCORE)) problems.push(`review score ${review.score ?? "missing"} is under ${MIN_SCORE}`);
  if (!review.reviewer) problems.push("the review names no reviewer model");
  if (review.text_sha !== textSha(post.content)) problems.push("the review is for another text: the post changed after it was reviewed; review it again");
  if (LINES[providerOf(post)] === "clips") problems.push(...hookProblems(review));
  return problems;
}

outsideTwinProblems stops a clip that already went out through YouTube Studio from going out a second time, unless the request names the upload it replaces. hookProblems adds the clip rules: the reviewer also scores the opening line, which must be under 8 words.

The schedule handler, shortened by one line:

async function scheduleRequest(req, res, id) {
  const body = parseJson(await readBody(req));
  if (body.status !== "schedule") return forward(req, res, Buffer.from(JSON.stringify({ status: body.status })));
  const { post, calendar } = await calendarAround(id, req.headers.authorization ?? "");
  const problems = gateProblems({ post, review: body.review, calendar, outside: outsideEntries() });
  if (problems.length) throw new GateError(409, "gate", `post ${id} may not be scheduled`, problems);
  appendLedger(approvalLine(id, post, body.review));
  forward(req, res, Buffer.from(JSON.stringify({ status: "schedule" })));
}

It forwards only the status to Postiz, never the review, so Postiz sees the same request a person would send.

How a schedule request carries its review

The agent never sends a free-form "please publish". It sends the status change Postiz already has, with the review added to the body:

PUT /api/public/v1/posts/<post id>/status
{ "status": "schedule",
  "review": { "score": 8, "reviewer": "claude-opus-5-5", "line": "clips",
              "text_sha": "8e2162b1...", "why": "One sourced point with accurate milestone dates..." } }

The text_sha is a SHA-256 of the post's plain text: tags dropped, paragraph and line ends turned into line breaks, and HTML entities decoded. In code, createHash("sha256").update(plainText(html)).digest("hex"). The reviewer computes it when it scores the draft, and the gate computes it again from the post as Postiz stores it. If the two differ, the answer is 409 with "the review is for another text". A status of draft passes without a review, so an agent can always pull a post back.

When every rule passes, the gate writes one JSON line before it forwards the request. Here is a real one from our ledger, shortened:

{"at":"2026-10-11T02:43:15.576Z","channel":"youtube","day":"2026-10-11",
 "publishDate":"2026-10-11T03:10:00.000Z","text_sha":"8e2162b1...","score":8,
 "reviewer":"claude-opus-5-5","line":"clips","why":"One sourced point with accurate milestone dates..."}

What it did in its first days

  • Refusals, sent by hand on 2026-10-13. A create with type: "schedule" got 403 with "posts are created as drafts". A delete got 403 with "is not open to agents; use the Postiz calendar". An MCP call to a tool off the list got error -32001.
  • Approvals. On 2026-10-11 the gate approved 5 short clips for one YouTube channel, each with a review score of 8, one per publish day: 2026-10-11 and 2026-10-13 to 2026-10-16. 4 of them were approved a second time the same day, with the same text hash, when the clip was uploaded again. Each of those lines names the upload it replaced. One more line is our own end-to-end test, marked as such.
  • Every approval is traceable. Each ledger line names the reviewer model, its score, the text hash and its reason, so an audit can match a live post to the review that let it out.

What the gate does not do

  • It trusts the review it is sent. It stops mistakes, not an agent that forges a review. The ledger is the check on that.
  • It does not guard people. Anyone signed in to the web calendar can schedule by hand.
  • It needs care on upgrades. A Postiz release can rename a tool or an endpoint. Because the gate denies by default, the failure is a refused draft, not a surprise post.

Self-hosted or cloud

We run Postiz ourselves, the open-source release under AGPL-3.0, at version v2.25.0. It is 4 containers (the app, Postgres, Redis and Temporal). We cap the app container at 1,792 MB of memory, and our installer refuses a first start with less than 1,800 MB free. The gate runs next to it as one more small service.

Postiz also runs as a hosted service. Its plans page offers a 7-day free trial and says every plan includes the MCP server, CLI and API. The public API docs give the hosted base URL as api.postiz.com/public/v1 and the same type field. We have only run our gate against our own install. The same proxy idea applies to the hosted API: agents get the gate's address and never the Postiz key's direct path.

Frequently asked questions

Can I just give the agent a key that can only make drafts?

The Postiz docs we read describe 2 ways to authenticate, an API key and OAuth tokens, and we found no draft-only scope. The gate adds that scope from outside.

Does the gate slow the agents down?

Reads and uploads pass straight through. Only a schedule request does extra work: it reads the calendar around the post once.

What happens when the review is under 8?

The gate answers 409 with each problem listed. The agent rewrites the draft, gets a new review, and asks again.

Sources