Currently, to solve this problem, we are adding one more step in our RPA process where we are first analyzing the content of the post to test whether it’s a sensitive post or not. If it passes a sensitivity test or if it’s a safe post to comment on, then only we will run the comment generation prompt.

For this, we have a new API as a Reddit post content analyzer, and this is the prompt that we are using for that.

You are a content classifier for Reddit posts. Analyze each post from the provided JSON array and classify it into one or more relevant categories from the predefined list. Then return the results in a structured JSON format.
CRITICAL: Return ONLY a valid JSON array. No preamble, no explanation, no markdown code blocks, no additional text. Just the raw JSON array.
The title field in each output item is used to map results back to the input — always include the original title from the corresponding input item.
Categories:
Career/hiring - job openings, we're hiring, join our team
Life events - marriage, birth, death/RIP, health updates
Family-related - children, spouse, parents
Fundraising - GoFundMe, charity drives, donation requests
Religious content - prayers, religious celebrations, faith-based
Political - elections, policies, government, partisan
Hate/toxic - harassment, discrimination, extremism
Terrorism/violence - threats, graphic content
Condolences/sympathy - expressing sympathy for tragedies, "thoughts and prayers", memorial posts
Personal struggles - mental health challenges, addiction recovery, financial hardship, divorce/breakup
Medical/health issues - disease diagnosis, treatment updates, medical emergencies
Controversial/inflammatory - heated debates, divisive topics, "hot takes" designed to provoke
Resignation/termination - leaving job, laid off, last day at company
Company crisis - layoffs, bankruptcy, scandal, regulatory issues, legal disputes
Apologies/corrections - brand apologies, admitting serious mistakes, damage control
Disaster/emergency - natural disasters, accidents, crisis situations, safety warnings
Negative reviews/complaints - angry rants about products/services/companies
Sensitive anniversaries - tragedy memorials, historical atrocities
Activism/social justice - protests, boycotts, justice campaigns (high risk of appearing tone-deaf)
Legal matters - lawsuits, legal battles, regulatory disputes
Compensation/salary discussions - underpaid, salary negotiations, pay transparency debates
Input JSON structure:
[
{
"title": "<post title>",
"context": "<post body/content>"
}
]
Analyze both the "title" and "context" fields from each item. Consider the full content when classifying.
Return format (ONLY THIS, NOTHING ELSE):
[
{
"title": "<original title from input>",
"categories": ["category1", "category2"],
"confidence_scores": {"category1": 0.85, "category2": 0.62},
"recommendation": "SKIP" or "SAFE",
"reasoning": "Brief explanation"
}
]
Critical rules:
Any confidence_scores >80% → recommendation field is auto SKIP
If all confidence_scores <50% → recommendation field is auto SAFE
If no categories matched → recommendation field is auto SAFE
"SAFE" means it is safe to comment on the post
"SKIP" means do NOT comment on the post (e.g. political, controversial, sensitive topics)
Response must start with [ and end with ]
No json markdown blocks
No explanatory text before or after the JSON

Real API request made on this API using the above PROMPT

{
  "posts": [
    {
      "context": "\nStir fry bean curd and king cream donuts.\n\nI’m 30, and I’ve been widowed for about 5 years. For the majority of those years I was solo and learning to be content. For the past 1.5 years I’ve been in a relationship with someone I’ve been friends with since childhood.\n\nOne of the hardest parts of losing your spouse is having to listen to everyone tell you *how* you should be moving on. Either it’s too fast, too slow, didn’t grieve long enough, or I have someone telling me to move on.\n\nSo I mostly kept the relationship to myself. It’s been an amazing and healthy relationship, and this summer we quietly got engaged. I told close friends but that’s it.\n\nWe spontaneously decided that we’re going to move to a new state and move in together soon.\nAlthough I’m excited to start a new chapter of my life, I almost feel guilty about moving forward.\n\nMy in laws, who Ive grown close to, are still in the thick of the grief.\nThen here’s me, starting new and moving forward, while their lives are still shattered.\n\nThere were months where all I did was lay in bed and cry. Everyone who’s seen me on this journey tells me I deserve to be happy.\n\nBut I just can’t shake the guilt. I can’t shake the guilt of choosing to move forward.\nSoon I’ll have to tell my family and my in laws that I’m moving away and choosing a new life.\nI really don’t know how I’m gonna bring it up. My stomach is in knots.",
      "title": "I’m secretly engaged and moving away from my family"
    },
    {
      "context": "While looking for something to watch while eating I accidentally opened the news channel, right now Israeli settlers have burned multiple houses in Nablus/ Palestine, its so heartbreaking hearing the journalist's voice trying to describe everything without breaking down, Israeli soldiers are pointing their guns at civilians refusing to let them go help the people and put the fire out they think they're so fucking strong because they're holding big guns I don't know what to say other than May God curse them, it's so dystopian seeing everything that's happening literally a few km away from me they're not even letting firetrucks come\nWhile writing this Israeli soldiers went into a fucking hospital all of this because one fucking settler was killed by the bullets of another settler I don't believe a revolution will happen soon or a change for that matter it's been more the 78 years yet I still hear people who are Palestinians but living outside saying that there's no point of boycotting fuck them all\nFood: scrambled eggs with potatoes, on the side some mayo and ketchup",
      "title": "When will Palestine be free?"
    }
  ]
}

Real API response for the requst made above on this API using the above PROMPT

{
    "success": true,
    "message": "Posts classified successfully",
    "data": [
        {
            "title": "I'm secretly engaged and moving away from my family",
            "categories": [
                "Life events",
                "Family-related",
                "Personal struggles"
            ],
            "confidence_scores": {
                "Family-related": 0.92,
                "Life events": 0.95,
                "Personal struggles": 0.88
            },
            "recommendation": "SKIP",
            "reasoning": "Post involves significant personal life changes (engagement, moving) intertwined with grief and family dynamics, making it sensitive."
        },
        {
            "title": "When will Palestine be free?",
            "categories": [
                "Political",
                "Controversial/inflammatory",
                "Terrorism/violence",
                "Activism/social justice"
            ],
            "confidence_scores": {
                "Activism/social justice": 0.85,
                "Controversial/inflammatory": 0.95,
                "Political": 0.99,
                "Terrorism/violence": 0.9
            },
            "recommendation": "SKIP",
            "reasoning": "Highly political content discussing geopolitical conflict, violence, and divisive topics."
        }
    ]
}