Phase A — Intake & ValidationPhase B — InvestigationPhase C — Resolution (Warnings / Hearing)Phase D — Post-Action
POST/disciplinaryai/analyze
Phase A — Intake & Validation
Manager sends a breach email. The system reads the email, finds which of the 29 breach scenarios it matches, pulls the employee's history, and saves everything to Qdrant for the next steps.
Step-by-step workflow: Fill Subject → Paste Email Body → Select Attachment → Click "Encode to Base64" → Click "Analyze Incident"
Analyzing...
Response
Done. Data saved to Qdrant. Move to Phase B.
Request Body — application/json
Field
Type
Required?
What to put here
Subject
string
Required
The email subject line. Usually starts with [Breach].
MailBase64Content
string
Required
The email body encoded in Base64. Use btoa() in JavaScript or the encoder helper on the Try It tab.
Attachment
string
Required
Supporting document (PDF, DOCX, TXT, EML, MSG, JPG, PNG) encoded in Base64 format. Must include filename and file type.
Upload an investigation document (Word, PDF, TXT) or a Webex meeting transcript. The system fixes spelling errors, then summarizes it into the standard 6-section investigation report. Missing fields are flagged automatically.
From Analyze — Case: — | Employee: —
Tip: You can upload the Webex meeting transcript from the hearing investigation. The AI will fix typos, translate any non-English text, and create a proper 6-section investigation report from it.
Analyzing document...
Response
Phase C — Choose Resolution Path
Based on the severity and breach type, choose the right next step:
Request — multipart/form-data
Field
Type
Required?
What to put here
file
File
Required
PDF, DOCX, DOC, or TXT file. Can be a Webex transcript or investigation notes.
{
"status": "success",
"case_id": "HRC-2026-001",
"employee_id": "99215",
"file_info": {
"filename": "investigation_notes.txt",
"file_type": "txt",
"file_size": 2048
},
"correction": {
"original_text": "raw extracted text from the file...",
"corrected_text": "spell-checked and cleaned text...",
"corrections_summary": {
"total_lines": 42,
"lines_corrected": 3,
"corrections_made": [
"line 5: 'recieved' → 'received'",
"line 18: 'unauthorzied' → 'unauthorized'"
],
"irrelevant_lines": []
}
},
"investigation_summary": {
"employee_name": "Alanna Richards",
"employee_id": "99215",
"incident_date": "2026-04-08",
"breach_scenario": "Clean Desk Breach",
"investigation_report": {
"section_1_metadata": "Employee: Alanna Richards | ID: 99215 | Dept: Amazon-LOB | Location: Mandeville",
"section_2_background": "Incident identified during scheduled floor audit on April 8 2026...",
"section_3_process": "Floor audit by Jennifer Loke and David Chen. IT logs reviewed...",
"section_4_findings": "Three handwritten sheets found under keyboard. Aggravating: deliberate concealment. Mitigating: no prior record.",
"section_5_conclusion": "Based on balance of probabilities the allegation is substantiated. Violates Section 3.7A.",
"section_6_signatures": "Investigator: [Placeholder] | HRBP Reviewer: [Placeholder]"
},
"missing_fields": ["Employee job title not stated", "Exact time of incident not recorded"],
"data_quality_score": "Medium",
"flags": ["Conduct allegation is informal – needs witness statement before proceeding"],
"summary": "Alanna Richards was found to have left customer PII visible at her workstation during a floor audit on April 8 2026."
}
}
POST/disciplinaryai/warning-outcome
Phase C — Progressive Discipline
Used for lower severity breaches. You only send the employee ID and the warning type. The system fetches the latest incident data and policy from Qdrant automatically and generates a complete formal warning letter.
From Investigation — Employee: — | Breach: —
BRD Rule — Document Upload:
Counselling, Verbal Warning, Final Warning → No document upload needed. AI generates content directly.
Written Warning, Final Written Warning → HRBP must upload a signed document using the defined template.
Generating...
Response
Generated Warning Document
Request Body — application/json
Field
Type
Required?
What to put here
employee_id
string
Required
The employee's ID. System fetches all incident data from Qdrant automatically using this ID.
{
"status": "success",
"data": {
"employee_id": "99215",
"employee_name": "Alanna Richards",
"warning_type": "written_warning",
"stage_label": "Written Warning",
"outcome_document": "SUTHERLAND JAMAICA\nDate: 08 April 2026\n\nEmployee Name : Alanna Richards\n...\nDear Ms. Richards,\n\nThis letter serves as a formal Written Warning...",
"key_points": [
"Violation of Clean Desk Policy Section 3.7A",
"Corrective action required immediately",
"Warning valid for 12 months from date of issue"
],
"validity_period": "12 months from date of issue",
"policy_sections_cited": ["Section 3.7A – Clean Desk Policy"],
"next_stage_if_repeated": "Final Written Warning",
"requires_employee_signature": true,
"requires_document_upload": true
}
}
Error Response
{
"status": "error",
"message": "No incident analysis found for employee 99215. Please run incident analysis first."
}
POST/disciplinaryai/verdict
Phase C Path 1 — Hearing & Verdict
The AI fetches the incident from Qdrant, reviews the evidence and history, and produces a verdict using the Balance of Probabilities standard. The Hearing Chair can Accept or Reject the recommendation.
From Investigation — Employee: — | Breach: —
How it works: You only send employee_id, breach_scenario, and chair_action. The system automatically fetches the incident data, policy text, and prior history from Qdrant — no need to re-enter them. Chair Actions: Accept = approve | Reject = reject with notes.
Generating verdict...
Response
Verdict generated. If the action is Termination or Suspension, proceed to Final Outcome.
Request Body — application/json
Field
Type
Required?
What to put here
employee_id
string
Required
Employee ID. System fetches incident + history from Qdrant automatically.
breach_scenario
string
Required
The breach type e.g. "Clean Desk Breach". System fetches policy from Qdrant using this.
{
"status": "success",
"data": {
"case_id": "HRC-2026-99215-001",
"employee_id": "99215",
"employee_name": "Alanna Richards",
"hearing_overview": {
"date_of_hearing": "2026-04-12",
"attendees": ["Jennifer Loke (Manager)", "Alanna Richards (Employee)", "HR Representative"],
"charges": "Scenario #12 – Clean Desk Breach (Repeated Offense)"
},
"key_findings": {
"management_case": "Three handwritten sheets with customer PII found under keyboard. IT logs show no system lag contradicting employee's claim.",
"employee_defense": "Employee claimed system latency forced her to write notes manually to meet KPI targets.",
"witness_testimony": "HR confirmed employee was previously counselled for same breach in February 2026."
},
"evidence_evaluation": {
"supporting_evidence": ["IT Audit Log shows 0ms lag", "Floor audit photos", "Signed counselling form Feb 2026"],
"inconsistencies": ["Employee claimed system lag – directly contradicted by IT Audit Log showing normal performance"]
},
"verdict": {
"decision": "Guilty",
"infraction_level": "Gross Misconduct",
"rationale": "Physical evidence confirmed. Employee defense contradicted by IT logs. Repeat offense aggravates the case.",
"policy_sections_cited": ["Section 3.7A – Clean Desk Policy"],
"recommended_action": "Termination"
},
"prior_history_applied": true,
"chair_action_applied": "Accept",
"approval_status": "Approved – Pending HRBP Sign-off",
"requires_hrbp_sign_off": true
},
"metadata": {
"case_id": "HRC-2026-99215-001",
"timestamp": "2026-04-12T11:30:00",
"chair_action": "Accept"
}
}
POST/disciplinaryai/final-outcome
Phase D — Post-Action
Generates the formal Termination or Suspension letter after the hearing verdict. System auto-fetches incident data and policy from Qdrant. Letter includes legal references, appeal rights, and a 7-day deadline link.
From Verdict — Employee: — | Action: —
What happens after this letter is issued:
• If Termination → System pings SuccessFactors every 4 hours. If not actioned in 24hrs → alerts Manager, HRBP, AM → after 3 alerts escalates to Geo HR Leader.
• Employee has 7 days to appeal via secure link (personal email + OTP, no SSO needed).
• Case archived to 7-year secure storage.
Generating letter...
Response
Outcome Letter
Post-action: System will ping SuccessFactors every 4 hours. Employee has 7 days to appeal via secure link.
Request Body — application/json
Field
Type
Required?
What to put here
case_id
string
Required
Unique case reference e.g. HRC-2026-001
employee_id
string
Required
Employee ID. System auto-fetches incident from Qdrant using this.
breach_scenario
string
Required
Breach type e.g. "Clean Desk Breach". System auto-fetches policy and history using this.
{
"status": "success",
"data": {
"case_id": "HRC-2026-001",
"employee_id": "99215",
"employee_name": "Alanna Richards",
"recommended_action": "Termination",
"outcome_letter": "SUTHERLAND JAMAICA\nDate: 09 April 2026\n\nEmployee Name : Alanna Richards\nEmployee ID : 99215\nDepartment : Amazon-LOB\n\nSubject: Notice of Termination of Employment\n\nDear Ms. Richards,\n\nFollowing a formal disciplinary hearing held on April 12 2026...",
"key_points": [
"Employment terminated effective April 9 2026",
"Violation of Section 3.7A Clean Desk Policy",
"Appeal must be submitted within 7 days via secure link"
],
"effective_date": "2026-04-09",
"appeal_deadline": "7 days from date of letter",
"policy_sections_cited": ["Section 3.7A – Clean Desk Policy"],
"requires_employee_signature": true,
"requires_sf_update": true,
"sf_status_to_update": "Terminated"
},
"metadata": {
"case_id": "HRC-2026-001",
"timestamp": "2026-04-09T09:00:00",
"recommended_action": "Termination",
"sf_ping_schedule": "Every 4 hours for 24 hours",
"escalation_path": "Manager → HRBP → AM → Geo HR Leader",
"archive_after": "Case closure – 7 year retention"
}
}
Configuration — Breach Scenarios Setup
One-time Setup
Upload the 29 breach scenarios and Sutherland policy documents into Qdrant. This needs to be done once during setup, or whenever the Employee Handbook is updated. All AI modules depend on this data.
Important: Run POST /disciplinaryai/breach-scenarios first (load scenarios into Qdrant), then POST /disciplinaryai/upload_policy (load policy documents). The /analyze endpoint will fail without this data.