Skip to main content

defense_aware_plan

Function defense_aware_plan 

Source
pub fn defense_aware_plan(
    policy: DefensePlanningPolicy,
    planner: &AttackPlanner,
    snapshot: &KnowledgeSnapshot,
    subject: &EntityId,
    context: PlanningContext,
    signal: &ResourceDefenseSignal,
    classify: impl Fn(&AttackAction) -> DefenseInteractionClass,
) -> Result<AttackPlan, PlannerError>
Expand description

Produces the real plan, applying defense suppression only when enabled.

While the policy is disabled the result is byte-for-byte the plan AttackPlanner::plan_snapshot produces, with no defense influence. When enabled, actions the resource-scoped defense signal suppresses are excluded with crate::planner::ExclusionReason::DefenseSuppressed and never become plan steps, so a defense-denied action never reaches an executor. Defense never adds an action, raises utility, or reorders otherwise-eligible steps — it can only remove suppressed candidates.