Dev.to Security 🔐 Cybersecurity 👁 0

A content check that stores the policy version with the decision

The part of moderation I got tired of rebuilding was the record, not the score. The flow I wanted looked like this: My app sends the post, and the name of the policy that should judge it. The API scores the content an

The part of moderation I got tired of rebuilding was the record, not the score.

The flow I wanted looked like this:

  1. My app sends the post, and the name of the policy that should judge it.
  2. The API scores the content and applies the thresholds I wrote in a YAML file.
  3. I get back allow, warn, flag, or block, plus a decision ID I can store on the post.

Vettly is that flow. A simplified policy looks like this:

name: marketplace-listings
version: "1"
rules:
  - category: scam
    threshold: 0.7
    action: block
  - category: spam
    threshold: 0.8
    action: flag

And the check, from the public TypeScript example:

import { createClient } from "@vettly/sdk";

const vettly = createClient(process.env.VETTLY_API_KEY!);

const decision = await vettly.check({
  content: post.body,
  policyId: "marketplace-listings",
});

if (decision.action === "block") {
  return reject(post);
}

Text, images, and video go through the same endpoint. The free plan is 15,000 decisions a month and does not need a credit card. There is a live playground at https://vettly.dev/ and docs at https://docs.vettly.dev/.

If you have already built an appeals queue, I would like to know what you would still need in the decision record.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.