Diagnoses and routes failures by analyzing error patterns, classifying severity, and applying retry logic, suppression budgets, and escalation rules. Use when handling errors, troubleshooting failures, recovering from API errors or timeouts, deciding whether to retry or escalate an issue, or managing service outages and tool dependency failures. Applies to any scenario where a check has failed, evidence of success is missing, or an unresolved error needs a structured response. Includes explicit untrusted-content/prompt-injection guardrails for third-party inputs.
98
Quality
94%
Does it follow best practices?
Impact
100%
1.16xAverage score across 9 eval scenarios
A platform engineering team is conducting a post-incident review. During a recent outage, an automated agent handled several failure events but its internal logs were not structured enough to audit after the fact — the team could not easily tell what the agent detected, what evidence it gathered, what it decided to do, or whether it escalated anything. The incident review board has mandated that all future automated triage actions must produce machine-readable records that can be audited later.
The team has provided three raw error events (below) from their production system. They need a Python script that processes each error event through a triage workflow, producing a structured JSON report for each one. The reports will be reviewed by the incident board to verify that the agent followed a sound decision-making process.
Write a Python script generate_triage_reports.py that:
report_event_1.json, report_event_2.json, report_event_3.jsonEach report file must be a structured JSON object. Write a REPORT_SCHEMA.md file documenting what fields are required in each report and what they mean.
The following files are provided as inputs. Extract them before beginning.
=============== FILE: inputs/error_events.json =============== [ { "event_id": "evt-001", "timestamp": "2024-11-15T14:23:01Z", "service": "payment-gateway", "error_message": "Connection pool exhausted: all 20 connections in use", "stack_trace": "ConnectionPoolError at pool.py:142\n at checkout.py:89\n at api_handler.py:312", "last_known_good": "2024-11-15T14:20:00Z", "recurrence_count": 2 }, { "event_id": "evt-002", "timestamp": "2024-11-15T14:25:17Z", "service": "user-profile", "error_message": "Write acknowledged but read returned null", "stack_trace": "AssertionError at profile_writer.py:78\n at sync_handler.py:201", "last_known_good": "2024-11-15T14:24:50Z", "recurrence_count": 1 }, { "event_id": "evt-003", "timestamp": "2024-11-15T14:27:44Z", "service": "notification-service", "error_message": "DeprecationWarning: 'email_template_v1' is deprecated, use 'email_template_v2'", "stack_trace": null, "last_known_good": "2024-11-15T14:27:43Z", "recurrence_count": 5 } ]