:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"allows_na": {
"default": false,
"description": "Whether the evaluation can return N/A for non-applicable generations.",
"type": "boolean"
},
"conditions": {
"description": "Optional trigger conditions to filter which events are sampled.",
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"output_config": {
"description": "Output settings used to validate the preview, including bounds, categories, and allows_na.",
"properties": {
"allows_na": {
"description": "Whether the evaluation can return N/A for non-applicable generations.",
"type": "boolean"
},
"decision_threshold": {
"anyOf": [
{
"maximum": 1,
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"description": "Boolean decision-model judges only. Minimum probability of true required for a true result, inclusive. Omit or set null to use 0.5. Applies to new runs; historical results are unchanged."
},
"max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Inclusive maximum numeric score. Omit for no upper bound. Required for numeric decision models and must exceed min."
},
"min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Inclusive minimum numeric score. Omit for no lower bound. Required for numeric decision models."
},
"options": {
"description": "Categorical output options. Keys identify stored results; labels are displayed to users.",
"items": {
"properties": {
"key": {
"description": "Stable category key.",
"maxLength": 128,
"minLength": 1,
"pattern": "^[a-z0-9]+(?:[_-][a-z0-9]+)*$",
"type": "string"
},
"label": {
"description": "Category display label.",
"maxLength": 256,
"minLength": 1,
"type": "string"
}
},
"required": ["key", "label"],
"type": "object"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"passing_rule": {
"anyOf": [
{
"properties": {
"operator": {
"description": "Pass at or above (gte), or at or below (lte), the threshold.",
"enum": ["gte", "lte"],
"type": "string"
},
"threshold": {
"description": "Finite passing threshold within any configured score bounds.",
"type": "number"
}
},
"required": ["operator", "threshold"],
"type": "object"
},
{
"properties": {
"categories": {
"description": "Passing category keys. With keys selected, results must be non-empty and contain only these keys. If no passing keys are selected, only an empty result passes.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": ["categories"],
"type": "object"
},
{
"type": "null"
}
],
"description": "Optional numeric or categorical passing rule. Null removes the rule; historical results use the current rule."
},
"selection_mode": {
"description": "Select one category or multiple categories. Multiple selection allows an empty result. Defaults to single.",
"enum": ["single", "multiple"],
"type": "string"
},
"step": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"description": "Optional positive input increment. Does not round evaluation results."
},
"true_is_failure": {
"description": "Boolean output only. Omit for numeric, categorical, and sentiment output. Whether a true result means the evaluation found a problem. False (the default) suits pass/fail evaluations, where a true result satisfied the criteria. Set it to true for detector-style evaluations, so a true result is counted and labeled as a fail.",
"type": "boolean"
}
},
"type": "object"
},
"output_type": {
"default": "boolean",
"description": "Expected output: boolean, numeric, or categorical. Sentiment is not supported by Hog.\n\n* `boolean` - Boolean (Pass/Fail)\n* `numeric` - Numeric\n* `categorical` - Categorical",
"enum": ["boolean", "numeric", "categorical"],
"type": "string"
},
"sample_count": {
"default": 5,
"description": "Number of recent $ai_generation events to test against (1–10, default 5).",
"maximum": 10,
"minimum": 1,
"type": "number"
},
"source": {
"description": "Hog source code to test. Return a boolean, finite number, or category keys matching output_type. Categorical single selection accepts one key or a one-item list; multiple selection accepts a list, including []. Return null only for allowed N/A. Output settings determine which boolean counts as a failure.",
"minLength": 1,
"type": "string"
},
"target": {
"default": "generation",
"description": "What the evaluation runs against: 'generation' samples individual generations, 'trace' samples whole traces, and 'session' samples whole sessions that have gone quiet. Each target runs against the same globals it would run against online.\n\n* `generation` - Generation\n* `trace` - Trace\n* `session` - Session",
"enum": ["generation", "trace", "session"],
"type": "string"
},
"target_config": {
"description": "Target-specific preview settings. For a trace target, set window_seconds between 10 and 7200.",
"properties": {
"quiet_period_seconds": {
"default": 3600,
"description": "For session samples: only sessions with no activity for this long are previewed, matching when a session evaluation would actually run.",
"maximum": 86400,
"minimum": 10,
"type": "number"
},
"window_seconds": {
"default": 1800,
"description": "Aggregation window for trace samples, in seconds.",
"maximum": 7200,
"minimum": 10,
"type": "number"
}
},
"type": "object"
}
},
"required": ["source"],
"type": "object"
}