Workshop 01 capstone · 120 min synthesis

Inbox Guardian: rule-based security scanner

Combine variables, string normalization, conditionals, loops, dictionaries, and functions into a command-line message scanner.

Scope note: rule-based heuristics vs machine learning

Inbox Guardian is a deterministic, rule-based Python application using conditional logic and string matching. Understanding explicit rules prepares you for later modules where statistical models learn thresholds directly from data.

Project milestones

Milestone 01: Core message analyzer

Define analyse_message(text, keywords). Normalize input with .lower() and check each keyword with a loop.

def analyse_message(text, keywords):
    cleaned = text.lower()
    matched = [kw for kw in keywords if kw in cleaned]
    return matched
Completion checklist
  • Case-insensitive substring matching
  • History stored as a list of dictionaries
  • Empty input handled without errors
  • Threat percentage computed accurately
inbox_guardian.py
Console
Click 'Run' to execute
Run code to view output