CySafe
I built a Flask API that creates accounts, verifies credentials, and uses signed tokens to control access to protected actions.
CySafe is a prototype for helping creators understand potentially harmful engagement on their posts. It brings together comment collection and risk assessment, with the goal of presenting a confidence indicator that helps creators decide whether a comment needs their attention. Any response remains at the creator’s discretion.
I wanted to apply what I’d learned about collecting and processing data to a problem where context matters. A comment’s meaning can depend on the conversation, the relationship between people, and the community around it. I designed CySafe around giving creators more information while keeping them in control of what happens next.
/flag-restore • Save assessment history and clear working data
Saves the reviewed comments and their final ranks to assessment history, preserving the original rank wherever no override was made. It then clears the working table for the next assessment
Example request body
{
"assessment_id": "a001",
"comments": [
{
"comment_id": "c002",
"old_rank": 4,
"new_rank": 2
}
]
}
/read • Collect comments
Collects comments from a selected post on the creator’s own public account and assigns each comment a unique ID
/risk-assessment • Assess potential risk
Assigns each collected comment a risk rank from 0 to 5 and calculates the average rank across the collection
/flag-fill • Store flagged comments for review
Stores comments ranked 3 or higher in a local working table, keeping each comment’s ID, text, and risk rank available for review
Example request body
{"assessment_id": "a001"}
/support • Support creator judgement
Example request body
{
"post_id": "post_001"
}
Example response body
{
"comments": [
{
"comment_id": "c001",
"text": "This is a risky comment"
},
{
"comment_id": "c002",
"text": "This comment is risky."
}
]
}
{
"assessment_id": "a001",
"average_risk": 2.5,
"comments": [
{"comment_id": "c001", "risk_rank": 1},
{"comment_id": "c002", "risk_rank": 4}
]
}
Example request body
{
"comments": [
{
"comment_id": "c001",
"text": "This is a risky comment"
},
{
"comment_id": "c002",
"text": "This comment is risky."
}
]
}
Example response body
Example response body
{
"assessment_id": "a001",
"flagged_comments": [
{
"comment_id": "c002",
"text": "Nobody wants you here. Leave.",
"risk_rank": 4
}
]
}
Lets the creator view comment counts by risk rank, inspect individual comments, and override a comment’s stored rank based on their own judgment
Example saved record
{
"assessment_id": "a001",
"comment_id": "c002",
"text": "Nobody wants you here. Leave.",
"risk_rank": 2
}
Example response body
{
"assessment_id": "a001",
"counts_by_rank": [
{"risk_rank": 4, "comment_count": 1}
]
}
{
"assessment_id": "a001",
"risk_rank": 4,
"comments": [
{
"comment_id": "c002",
"text": "Nobody wants you here. Leave."
}
]
}
{
"assessment_id": "a001",
"comment_id": "c002",
"old_rank": 4,
"new_rank": 2
}
Current scenario
Creator views comment counts by risk rank
Creator reviews comments at a selected risk rank
Creator overrides a comment’s risk rank