Guard a Sume run's text output with a yes/no model before you post it

Read output from a completed Sume run, ask a small decision model whether it is safe to publish, and treat a degraded outcome or null output as a hard stop.

5 min readSume
All posts

Check the run first, then the content. Read outcome before anything else: ok means that you got usable output, degraded means that real artifacts exist but output is null, and error means that the run failed. Only on ok do you hand the text to a yes/no decision model that answers one question, such as whether the text may be posted. A model that approves bad output is still wrong, so keep a human path for the low-confidence cases.

Checks in order

The order below keeps the cheap, deterministic checks ahead of the model.

Publish gate order (read 2026-10-05)
OrderCheckOn failure
1outcome is okReview or retry
2output is not nullReview artifacts
3Decision model yes/noHuman review
4PostDone
def gate(event: dict, ask_model) -> str:
    if event.get("outcome") != "ok":
        return "stop: outcome " + str(event.get("outcome"))
    output = event["payload"].get("output")
    if output is None:
        return "stop: no output"
    return "post" if ask_model(str(output)) else "human review"


event = {"outcome": "ok", "payload": {"output": {"text": "hi"}}}
print(gate(event, lambda t: True))
print(gate({"outcome": "degraded", "payload": {}}, lambda t: True))

Do not post twice

Dedupe deliveries on the envelope request_id, since a webhook can be retried. A second delivery of the same run must not post twice.

Check the docs before you ship

Sume's limits and field names change faster than blog posts do. Read the linked docs pages for the current request fields before you ship, and send a dry_run or a low spend cap on your first real call.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume