Category: Normalization & Validation · Execution Model: Deterministic, Stateless, Idempotent
The Sanitize Agent is responsible for transforming raw, untrusted JSON payloads produced by LLMs and scraper agents into a normalized, economically-evaluated, and schema-safe format suitable for downstream scoring, scheduling, and launch decisions. It acts as the system’s primary integrity gate — enforcing defaults, validating structure, computing financial viability, and preventing malformed or hallucinated data from propagating through the Whook pipeline.
object
(required)
array
(required)
{
"success": "boolean",
"message": "string",
"savedCount": "number"
}
Writes NormalizedEvent documents to events_normalized collection
Rejects malformed chunks with 400-level validation errors
If required schema fields are missing or validation fails, the sanitizer returns a 400 response with explicit error messages and does not persist any data. Unexpected runtime failures return a 500 response and log errors without partially writing invalid state.
{
"persistence": [
"events_normalized"
],
"guarantees": [
"All persisted events conform to normalized schema",
"All numeric economics are deterministically computed",
"No malformed items reach downstream agents"
]
}
curl -X POST https://api.whook.ai/v1/agent/sanitize/run \
-H "Content-Type: application/json" \
-d '{
"meta": {
"region": "Los Angeles County, CA",
"assumptions": "Supply scraper ingestion"
},
"items": [
{
"title": "Outdoor Power Yoga",
"about": "Intense 90-minute yoga session outdoors.",
"recommendedCreditsRequired": 2,
"estimatedSessionCostBreakdown": {
"instructorCost": 50,
"venueCost": 20
}
}
]
}'