Documentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
What this solves
Regulated-finance, public-sector, and healthcare pilots need to prove that the decisioning system does not discriminate against protected groups. The platform reports four fairness metrics today (disparate impact, equal opportunity, demographic parity, counterfactual), but reporting alone doesn’t stop a flow from going live when those metrics breach. The hard-gate is the enforcement layer.
How it works
Two enforcement points:- Pre-publish gate —
POST /api/v1/decision-flows/publishevaluates the policy against the last 7 days of decision traces. If any threshold is breached, the call returns 422 Unprocessable Entity with the violation list, and the flow stays in its previous status. The publish is blocked, not deferred. - Continuous re-check cron —
GET /api/v1/cron/fairness-recheckruns daily; for every tenant that has opted intocontinuousRecheck, it re-evaluates the gate and flips active flows back topausedwhen thresholds drift. Audit-logged with the violation reasons.
fairnessPolicy.override.{approvedBy, expiresAt} and the gate skips with an audit-logged warning until the override expires.
Step 1 — Configure the policy
disparateImpactRatio: 0.8is the EEOC four-fifths rule (29 CFR § 1607.4D) — the lowest selection rate across protected groups must be at least 80% of the highest.demographicParityGap: 0.2blocks publishes where any pair of groups differs in selection rate by more than 20 percentage points.equalOpportunityGaprequires labeled outcomes (the customer would have converted); skipped automatically when labels aren’t available.minSampleSize: 100— the gate skips with a logged “insufficient samples” reason when fewer than 100 usable decision traces exist in the 7-day window.continuousRecheck: trueenables the post-publish drift cron.
Step 2 — Make sure the trace carries the sensitive attribute
The hard-gate readsdecision_traces.requestAttributes[sensitiveAttribute] (added in manual-sql migration 22). Any recommend that passes the attribute in body.attributes is automatically eligible:
Step 3 — Try to publish
Step 4 — Four-eyes override (when justified)
Documented exceptions are bypassed via the override block — both fields required:"Fairness gate bypassed via active override" with the approvedBy value — audit trail for the compliance team.
What gets auto-paused
When the continuous re-check cron detects drift on a tenant withcontinuousRecheck: true:
- Every flow with
status: "active"is updated tostatus: "paused". - A
decision_flowaudit-log row is written withaction: "auto_pause",reason: "fairness_recheck_drift", and the violation list. - Operators see paused flows in Studio with the audit reason visible in the change history.
Gotchas
- Sample sourcing requires manual-sql/22. Run
psql ... -f prisma/manual-sql/22_decision_trace_request_attributes.sqlonce; this adds therequestAttributesJSONB column and a GIN index. Without it, the gate skips with"no usable samples". - The 7-day window is fixed. If your traffic is low, set
minSampleSizeaccordingly or increase trace sampling rate (decisionTraceSampleRate). continuousRecheckonly auto-pauses currently-active flows. Re-publish brings them back; the gate evaluates again at that point.