POST
https://www.brainiac.software/api/v1/security/payload-anomaly-score$0.04 USDCScore payload anomaly and input safety
Score a caller-supplied JSON value or text string for nesting depth, mixed types, injection-shaped text, and size inflation. Matching is local and deterministic. The payload is not executed, fetched, or stored.
Body
| Field | Required | Notes |
|---|---|---|
payload | Yes | — |
Request exampleJSON
{
"payload": {
"user": "ada",
"note": "admin' OR '1'='1",
"profile": {
"bio": "<script>alert(1)</script>",
"meta": {
"a": {
"b": {
"c": {
"d": {
"e": {
"f": {
"g": 1
}
}
}
}
}
}
}
},
"flags": [
1,
"1",
true
],
"filter": {
"$gt": 0
}
}
}Response exampleJSON
{
"overall_safety_score": 57,
"risk_breakdown": {
"depth_anomaly_risk": 15,
"type_confusion_risk": 35,
"injection_vector_risk": 100,
"size_inflation_risk": 0
},
"anomalies_detected": [
{
"code": "nosql_operator",
"severity": "high",
"path": "$.filter[\"$gt\"]",
"detail": "This key is a NoSQL operator name. It was not sent to a database."
},
{
"code": "mixed_array_types",
"severity": "medium",
"path": "$.flags",
"detail": "Items in this array use more than one JSON type: boolean, number, string."
},
{
"code": "sql_tautology",
"severity": "high",
"path": "$.note",
"detail": "The text matches a SQL tautology pattern. It was not sent to a database."
},
{
"code": "script_tag",
"severity": "high",
"path": "$.profile.bio",
"detail": "The text contains a script tag. The tag was not executed."
},
{
"code": "depth_anomaly",
"severity": "low",
"path": "$.profile.meta.a.b.c.d.e.f.g",
"detail": "The deepest value is 9 levels down. The depth check starts at 6."
}
],
"audit_receipt": "sha256:2bfb1c9dc51ada180dd98ab3a01a76df846bc9f42168ac2c7b0c1e5535b49b0c"
}cURL
curl -i -X POST "https://www.brainiac.software/api/v1/security/payload-anomaly-score" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"payload": {
"user": "ada",
"note": "admin' OR '1'='1",
"profile": {
"bio": "<script>alert(1)</script>",
"meta": {
"a": {
"b": {
"c": {
"d": {
"e": {
"f": {
"g": 1
}
}
}
}
}
}
}
},
"flags": [
1,
"1",
true
],
"filter": {
"$gt": 0
}
}
}
JSON