Skip to content

[Feature]: Context-Aware Adaptive Risk Scoring with Configurable YAML Policies #152

@varshini-nandula

Description

@varshini-nandula

Problem Statement

Eagle currently generates risk assessments based on detected behaviors and reasoning outputs. However, risk evaluation may not sufficiently account for contextual factors such as restricted zones, time of day, repeated approaches, dwell time, confidence levels, and other situational signals.

As a result, similar behaviors may receive comparable risk scores even when they occur in very different contexts. For example, loitering near a cafeteria may be normal, while the same behavior near a restricted server room could indicate suspicious activity.

A more context-aware risk scoring mechanism would improve alert prioritization, reduce false positives, and make generated alerts more meaningful for operators.

Proposed Solution

Introduce an Adaptive Risk Scoring Engine that dynamically calculates risk scores using multiple contextual signals instead of relying solely on static scoring logic.

Key ideas:

Evaluate contextual factors such as:

  • Restricted zone presence
  • Dwell time / loitering duration
  • Repeated approach behavior
  • Time-based conditions (e.g., after-hours activity)
  • Reasoning confidence score
  • Historical track behavior
  • Support configurable scoring policies through YAML configuration files.

Example:

risk_scoring:
  restricted_zone:
    weight: 0.30

  repeated_approach:
    weight: 0.25

  loitering:
    weight: 0.15

  after_hours:
    weight: 0.20

  high_confidence_reasoning:
    weight: 0.10

The system would combine these signals to produce a final normalized risk score that can be used for alert prioritization and future reasoning workflows.

Affected Component

LLM Reasoning (services/reasoning/llm.py), Backend API (FastAPI — apps/backend/), Temporal Memory (Redis buffer — services/memory/)

Estimated Difficulty

🟡 Intermediate — Requires understanding of one service

Alternatives Considered

  • Continue using static risk scoring rules.
  • Hardcode additional scoring conditions directly in the risk engine.

However, these approaches reduce flexibility and require code changes whenever risk policies need to be adjusted. A configurable policy-driven approach is more maintainable and aligns better with Eagle's architecture.

Additional Context

This feature aligns with Eagle's goal of moving beyond traditional rule-based surveillance toward more intelligent and explainable decision-making.

It would also complement existing reasoning, memory, and behavior-analysis components by providing a more nuanced method of prioritizing suspicious activity.

Potential future extensions:

  • Zone-specific risk policies
  • User-defined risk profiles
  • Adaptive weighting based on human feedback
  • Risk score explainability in the dashboard

Contribution

  • I would like to implement this feature and submit a PR.

Checklist

  • I have searched existing issues and this is not a duplicate.
  • I have read the CONTRIBUTING.md guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions