When the Answer Sneaks In

Availability at prediction time is the rule

Target leakage occurs when an input directly or indirectly reveals the answer. Temporal leakage occurs when an input uses information from after the prediction moment. Both produce impressive offline results because the model receives clues it could never possess during real use.

goal: predict at 09:00 whether a ticket breaches its SLA by 17:00
valid: priority, queue length, customer tier known at 09:00
leaked: final_resolution_time, breach_notification_sent

A worked example makes the danger concrete. Suppose breach_notification_sent is 1 only after a breach is confirmed. A tree learns if notification_sent == 1, predict breach and scores 99%. At 09:00 every new ticket has 0 because no notification exists yet, so the learned shortcut collapses.

Scenario: A churn dataset includes an exit-survey score. The survey is completed only after cancellation. Removing it lowers validation accuracy from 97% to 76%; that drop is not damage to the model, but removal of false confidence.
Tip: For every feature, write its available_at time and ask whether it exists, in that exact form, before the decision. Feature names alone rarely reveal hidden timing.