Incident Response

security

Incident Response

Definition

Incident Response (IR) is a structured, systematic methodology for detecting, analyzing, containing, eradicating, and recovering from security incidents across information systems. It defines organizational roles, communication protocols, escalation paths, evidence preservation procedures, and post-incident review processes designed to minimize damage, reduce recovery time and cost, and capture lessons learned to prevent recurrence. A mature incident response capability transforms security events from unpredictable crises into manageable operational procedures with documented playbooks, rehearsed workflows, and measurable response metrics.

The discipline is governed by established frameworks -- NIST SP 800-61 (Computer Security Incident Handling Guide), SANS Incident Handling Process, ISO 27035 (Information Security Incident Management), and ENISA guidance for EU member states. These frameworks share a common lifecycle model: preparation, detection and analysis, containment-eradication-recovery, and post-incident activity. The distinction between a security event (any observable occurrence) and a security incident (an event that violates security policy or threatens information assets) is fundamental to effective triage, preventing both under-reaction to genuine threats and over-reaction to benign anomalies.

Modern incident response has evolved from a purely human-driven process to a hybrid approach combining automated detection and initial response with human analysis for complex incidents. Security Orchestration, Automation, and Response (SOAR) platforms execute predefined playbooks for common incident types, while human analysts focus on novel threats and strategic decisions. This automation-first approach is essential for platforms operating at scale, where the volume of security events exceeds human processing capacity.

Overview

The incident response lifecycle consists of four primary phases, each with distinct objectives, activities, and deliverables:

Phase 1: Preparation

Preparation establishes the organizational foundation for effective incident response before any incident occurs. This includes defining roles and responsibilities, creating and maintaining playbooks, deploying detection infrastructure, conducting training exercises, and establishing communication channels. Preparation quality directly correlates with response effectiveness -- organizations that invest in preparation consistently demonstrate faster mean time to detect (MTTD) and mean time to respond (MTTR).

Phase 2: Detection and Analysis

Detection involves identifying potential security incidents through monitoring, alerting, and threat intelligence correlation. Analysis determines whether a detected event constitutes an actual incident, assesses its severity and scope, and establishes initial containment priorities. This phase demands the highest analytical rigor, as misclassification wastes resources (false positives) or allows threats to escalate (false negatives).

Phase 3: Containment, Eradication, and Recovery

Containment prevents the incident from spreading, eradication removes the threat from affected systems, and recovery restores normal operations. Containment strategies range from network isolation (short-term) to system rebuilding (long-term). Evidence preservation during containment is critical for both forensic analysis and potential legal proceedings.

Phase 4: Post-Incident Activity

Post-incident reviews analyze what happened, why it happened, what worked in the response, and what must improve. Root cause analysis identifies systemic vulnerabilities, and lessons learned feed back into the preparation phase, closing the improvement cycle. Post-incident reports serve as institutional memory, preventing the same incident type from requiring the same response effort twice.

Security Incident Taxonomy

Incident Types & Characteristics

Modern incident response must handle a diverse array of security incidents, each requiring tailored detection and response strategies:

CategoryExamplesDetection MethodTypical Impact
MalwareRansomware, trojans, rootkitsSignature + behavior analysisSystem compromise, data encryption
PhishingEmail, SMS, voice attacksUser reporting, email filteringCredential theft, initial access
DDoSVolumetric, protocol, application layerTraffic analysis, performance monitoringService disruption
Data BreachUnauthorized access, exfiltrationDLP, network monitoring, anomaly detectionConfidentiality loss, regulatory impact
Insider ThreatMalicious/negligent insider actionsBehavior analytics, privilege monitoringVarious, often high impact
Supply ChainThird-party compromiseThreat intelligence, vendor monitoringWidespread impact potential
Quality DegradationCode quality drops, architectural violationsQuality Floor Guardian, automated analysisPlatform reliability risk
Configuration DriftUnauthorized changes, misconfigurationsConfiguration monitoring, compliance scanningSecurity posture weakening

Advanced Threat Patterns

The Prismatic Platform's epistemic security approach enables detection of sophisticated attack patterns that traditional security tools miss:

PatternDescriptionDetection SignalsPlatform Response
Epistemic AttackTruth distortion, confidence manipulationNABLA axiom violations, contradiction preservation failuresTrinity Gate enforcement, Purple Team analysis
Slow-burn CompromiseGradual privilege escalationQuality score drift, behavior baseline changesQuality Floor Guardian escalation
Cascade ExploitationChain of small compromisesPattern correlation across domainsCASCADE detection algorithms
Source PoisoningContaminated intelligence sourcesSignal plurality violations, confidence scoring anomaliesOSINT source isolation, alternative routing

Technical Implementation Framework

Automated Detection Pipeline

defmodule PrismaticSafety.DetectionEngine do
  @moduledoc """
  Multi-stage detection pipeline implementing graduated
  confidence scoring and automated triage.
  """

  use GenServer

  alias PrismaticSafety.{SignalProcessor, ThreatCorrelator, ConfidenceScorer}

  @type detection_stage :: :preprocessing | :correlation | :classification | :triage
  @type detection_result :: %{
    confidence: float(),
    severity: atom(),
    indicators: list(String.t()),
    metadata: map()
  }

  @spec process_event(map()) :: {:ok, detection_result()} | {:error, term()}
  def process_event(raw_event) do
    raw_event
    |> preprocess_signals()
    |> correlate_with_threat_intelligence()
    |> classify_incident_type()
    |> score_confidence()
    |> triage_for_response()
  end

  defp preprocess_signals(event) do
    # Normalize event format, extract indicators, enrich with context
    %{
      timestamp: normalize_timestamp(event.timestamp),
      source: validate_source(event.source),
      indicators: extract_indicators(event),
      context: gather_contextual_data(event)
    }
  end

  defp correlate_with_threat_intelligence(processed_event) do
    # Cross-reference with threat intelligence feeds
    threat_matches = ThreatCorrelator.find_matches(processed_event.indicators)

    %{processed_event |
      threat_intelligence: threat_matches,
      external_confidence: calculate_external_confidence(threat_matches)
    }
  end

  defp classify_incident_type(correlated_event) do
    # Machine learning classification + rule-based categorization
    ml_classification = MLClassifier.predict(correlated_event)
    rule_based = RuleEngine.classify(correlated_event)

    %{correlated_event |
      incident_type: resolve_classification_conflict(ml_classification, rule_based),
      classification_confidence: min(ml_classification.confidence, rule_based.confidence)
    }
  end

  defp score_confidence(classified_event) do
    # NABLA-compliant confidence scoring with multiple signals
    confidence_components = %{
      source_reliability: ConfidenceScorer.assess_source(classified_event.source),
      indicator_strength: ConfidenceScorer.assess_indicators(classified_event.indicators),
      classification_agreement: classified_event.classification_confidence,
      threat_intelligence: classified_event.external_confidence,
      historical_accuracy: ConfidenceScorer.historical_performance(classified_event.incident_type)
    }

    overall_confidence = ConfidenceScorer.weighted_average(confidence_components)

    %{classified_event |
      confidence: overall_confidence,
      confidence_breakdown: confidence_components
    }
  end

  defp triage_for_response(scored_event) do
    # Determine response urgency based on confidence and potential impact
    severity = compute_severity(scored_event)
    response_actions = determine_response_actions(severity, scored_event.incident_type)

    {:ok, %{
      confidence: scored_event.confidence,
      severity: severity,
      incident_type: scored_event.incident_type,
      indicators: scored_event.indicators,
      response_actions: response_actions,
      metadata: scored_event
    }}
  end
end

Forensic Evidence Management

defmodule PrismaticSafety.ForensicManager do
  @moduledoc """
  Automated evidence collection and chain of custody management
  with cryptographic integrity guarantees.
  """

  @type evidence_item :: %{
    id: String.t(),
    type: atom(),
    source_system: String.t(),
    collected_at: DateTime.t(),
    hash: String.t(),
    collector: String.t(),
    metadata: map()
  }

  @spec collect_evidence(String.t(), atom()) :: {:ok, evidence_item()} | {:error, term()}
  def collect_evidence(incident_id, evidence_type) do
    with {:ok, raw_evidence} <- gather_raw_evidence(evidence_type),
         {:ok, evidence_hash} <- compute_cryptographic_hash(raw_evidence),
         {:ok, evidence_path} <- store_evidence_securely(raw_evidence, incident_id),
         :ok <- record_chain_of_custody(evidence_path, evidence_hash) do

      evidence_item = %{
        id: generate_evidence_id(),
        type: evidence_type,
        source_system: determine_source_system(evidence_type),
        collected_at: DateTime.utc_now(),
        hash: evidence_hash,
        collector: get_collector_identity(),
        metadata: %{
          incident_id: incident_id,
          storage_path: evidence_path,
          collection_method: evidence_collection_method(evidence_type)
        }
      }

      {:ok, evidence_item}
    end
  end

  @spec verify_evidence_integrity(String.t()) :: {:ok, :valid} | {:error, :tampered}
  def verify_evidence_integrity(evidence_id) do
    with {:ok, evidence} <- retrieve_evidence_record(evidence_id),
         {:ok, current_hash} <- recompute_evidence_hash(evidence.metadata.storage_path) do

      if current_hash == evidence.hash do
        {:ok, :valid}
      else
        {:error, :tampered}
      end
    end
  end

  # Specialized evidence collection methods
  defp gather_raw_evidence(:memory_dump) do
    # Capture complete system memory state
    system_info = System.info()
    processes = Process.list()

    memory_state = %{
      system_info: system_info,
      processes: processes,
      ets_tables: :ets.all() |> Enum.map(&ets_table_snapshot/1),
      application_state: Application.started_applications(),
      node_info: Node.self() |> node_diagnostic_info()
    }

    {:ok, memory_state}
  end

  defp gather_raw_evidence(:log_snapshot) do
    # Collect relevant log entries with timestamp correlation
    time_window = incident_time_window()

    logs = %{
      application_logs: collect_application_logs(time_window),
      system_logs: collect_system_logs(time_window),
      audit_logs: collect_audit_logs(time_window),
      telemetry_events: collect_telemetry_events(time_window)
    }

    {:ok, logs}
  end

  defp gather_raw_evidence(:network_metadata) do
    # Network connection state and recent activity
    network_state = %{
      active_connections: :inet.getstat(),
      port_bindings: :ranch.info(),
      recent_requests: collect_recent_network_activity(),
      dns_cache: get_dns_cache_state()
    }

    {:ok, network_state}
  end
end

Technical Details

Incident Severity Classification

Effective triage requires a consistent severity classification system that drives response urgency and resource allocation:

SeverityDescriptionResponse TimeEscalationExample
Critical (P0)Active exploitation, data breach, system compromiseImmediate (minutes)Executive notificationActive data exfiltration, ransomware deployment
High (P1)Confirmed threat, potential for significant damage< 1 hourSecurity lead notificationSuccessful credential theft, persistent backdoor
Medium (P2)Suspicious activity requiring investigation< 4 hoursTeam notificationUnusual access patterns, policy violations
Low (P3)Minor policy violation, informational finding< 24 hoursTicket creationFailed brute-force attempt, misconfiguration

Detection Methods

MethodLatencyCoverageFalse Positive RateExample
Signature-basedReal-timeKnown threatsLowIDS/IPS signature match
Anomaly-basedNear real-timeUnknown threatsMedium-HighBehavioral baseline deviation
HeuristicReal-timeVariant threatsMediumRule-based pattern matching
Threat intelligenceMinutes-hoursKnown indicatorsLowIoC feed correlation
Human reportingHours-daysSocial engineeringVariablePhishing report, insider report
Quality monitoringContinuousCode/config driftLowQuality Floor Guardian alerts

Evidence Chain of Custody

Forensic integrity requires maintaining an unbroken chain of custody for all evidence collected during incident response:

StepActionDocumentationTool
1Identify evidence sourceSystem ID, location, timeInventory log
2Collect and preserveForensic image, hash verificationdd, sha256sum
3Transport securelyEncrypted transfer, access logGPG, audit trail
4Store securelyTamper-evident storage, access controlsEvidence locker
5Analyze without modificationWork on copies onlyAnalysis workstation
6Report findingsDetailed timeline, methodologyIR report template

Implementation in Prismatic Platform

The Prismatic Platform implements automated incident response through the Blue Team defensive agents, the Quality Floor Guardian, and the SEADF self-healing framework:

defmodule PrismaticSafety.IncidentResponse do
  @moduledoc """
  Automated incident response engine implementing graduated
  response levels aligned with the NM/ND doctrine.
  """

  use GenServer

  alias PrismaticSafety.QualityFloorGuardian
  alias PrismaticSafety.ViolationProtocol

  @type severity :: :critical | :high | :medium | :low
  @type incident :: %{
    id: String.t(),
    severity: severity(),
    source: atom(),
    description: String.t(),
    detected_at: DateTime.t(),
    evidence: list(map())
  }

  @spec detect_and_respond(map()) :: {:ok, incident()} | {:error, term()}
  def detect_and_respond(event) do
    with {:ok, classified} <- classify_event(event),
         {:ok, incident} <- create_incident(classified),
         :ok <- execute_containment(incident),
         :ok <- notify_stakeholders(incident) do
      {:ok, incident}
    end
  end

  @spec classify_event(map()) :: {:ok, map()} | {:error, :not_incident}
  defp classify_event(event) do
    severity = compute_severity(event)

    if severity != :informational do
      {:ok, Map.put(event, :severity, severity)}
    else
      {:error, :not_incident}
    end
  end

  defp compute_severity(%{quality_score_drop: drop}) when drop > 5 do
    :critical
  end

  defp compute_severity(%{quality_score_drop: drop}) when drop > 2 do
    :high
  end

  defp compute_severity(%{violation_level: level}) when level in [:l3, :l4] do
    :critical
  end

  defp compute_severity(%{violation_level: level}) when level in [:l1, :l2] do
    :medium
  end

  defp compute_severity(_event), do: :low

  defp execute_containment(%{severity: :critical} = incident) do
    QualityFloorGuardian.enter_emergency_mode()
    ViolationProtocol.block_commits()
    broadcast_alert(incident, :all_channels)
    :ok
  end

  defp execute_containment(%{severity: :high} = incident) do
    QualityFloorGuardian.trigger_auto_evolution()
    broadcast_alert(incident, :security_team)
    :ok
  end

  defp execute_containment(incident) do
    log_incident(incident)
    :ok
  end
end

Response Orchestration Framework

Multi-Team Coordination

The Prismatic Platform's color-team architecture enables sophisticated incident response coordination:

defmodule PrismaticSafety.ResponseOrchestrator do
  @moduledoc """
  Coordinates response across color teams based on incident
  characteristics and required capabilities.
  """

  alias PrismaticTeams.{BlueTeam, RedTeam, PurpleTeam, WhiteTeam, GrayTeam}

  @type team_assignment :: %{
    team: atom(),
    role: atom(),
    priority: integer(),
    estimated_duration: integer()
  }

  @spec orchestrate_response(map()) :: {:ok, [team_assignment()]}
  def orchestrate_response(incident) do
    assignments = []

    # Blue Team: Always involved for defensive response
    assignments = [blue_team_assignment(incident) | assignments]

    # Red Team: Involved for attack simulation and hypothesis testing
    if requires_adversarial_analysis?(incident) do
      assignments = [red_team_assignment(incident) | assignments]
    end

    # Purple Team: Required for synthesis and closure validation
    if incident.severity in [:critical, :high] do
      assignments = [purple_team_assignment(incident) | assignments]
    end

    # White Team: For formal verification and contract validation
    if requires_formal_verification?(incident) do
      assignments = [white_team_assignment(incident) | assignments]
    end

    # Gray Team: For boundary exploration of novel incidents
    if incident.incident_type == :unknown or incident.confidence < 0.7 do
      assignments = [gray_team_assignment(incident) | assignments]
    end

    {:ok, assignments}
  end

  defp blue_team_assignment(incident) do
    %{
      team: :blue,
      role: :primary_responder,
      priority: 1,
      estimated_duration: estimate_blue_response_time(incident),
      tasks: [
        :evidence_collection,
        :containment_execution,
        :impact_assessment,
        :stakeholder_notification
      ]
    }
  end

  defp red_team_assignment(incident) do
    %{
      team: :red,
      role: :attack_simulation,
      priority: 2,
      estimated_duration: 120, # 2 hours for attack path analysis
      tasks: [
        :attack_vector_analysis,
        :lateral_movement_assessment,
        :privilege_escalation_testing,
        :persistence_mechanism_evaluation
      ]
    }
  end

  defp purple_team_assignment(incident) do
    %{
      team: :purple,
      role: :synthesis_and_closure,
      priority: 3,
      estimated_duration: 180, # 3 hours for comprehensive analysis
      tasks: [
        :red_blue_synthesis,
        :gap_analysis,
        :closure_validation,
        :lessons_learned_compilation
      ]
    }
  end
end

Automated Playbook Execution

defmodule PrismaticSafety.PlaybookEngine do
  @moduledoc """
  Executes incident response playbooks with human oversight
  and automated checkpoint validation.
  """

  @type playbook_step :: %{
    id: String.t(),
    description: String.t(),
    automation_level: :automated | :assisted | :manual,
    prerequisites: [String.t()],
    success_criteria: [String.t()],
    timeout: integer()
  }

  @spec execute_playbook(String.t(), String.t()) :: {:ok, map()} | {:error, term()}
  def execute_playbook(incident_id, playbook_id) do
    with {:ok, playbook} <- load_playbook(playbook_id),
         {:ok, execution_context} <- prepare_execution_context(incident_id),
         {:ok, results} <- execute_steps(playbook.steps, execution_context) do

      post_execution_analysis = analyze_playbook_effectiveness(results)

      {:ok, %{
        incident_id: incident_id,
        playbook_id: playbook_id,
        execution_results: results,
        effectiveness_analysis: post_execution_analysis
      }}
    end
  end

  defp execute_steps(steps, context) do
    steps
    |> Enum.reduce_while({:ok, []}, fn step, {:ok, acc} ->
      case execute_single_step(step, context) do
        {:ok, result} ->
          updated_context = update_context(context, step, result)
          {:cont, {:ok, [result | acc]}}

        {:error, reason} = error ->
          Logger.error("Playbook step failed", step: step.id, reason: reason)
          {:halt, error}

        {:requires_human, checkpoint} ->
          # Pause execution for human decision
          human_result = request_human_intervention(step, checkpoint)
          updated_context = update_context(context, step, human_result)
          {:cont, {:ok, [human_result | acc]}}
      end
    end)
  end

  defp execute_single_step(%{automation_level: :automated} = step, context) do
    # Fully automated execution with validation
    with :ok <- validate_prerequisites(step, context),
         {:ok, result} <- run_automated_action(step, context),
         :ok <- validate_success_criteria(step, result) do
      {:ok, %{step_id: step.id, result: result, execution_time: DateTime.utc_now()}}
    end
  end

  defp execute_single_step(%{automation_level: :assisted} = step, context) do
    # Automated with human verification checkpoints
    with :ok <- validate_prerequisites(step, context),
         {:ok, automated_result} <- run_automated_action(step, context),
         {:ok, human_verification} <- request_human_verification(step, automated_result) do

      if human_verification.approved do
        {:ok, %{step_id: step.id, result: automated_result, verified_by: human_verification.approver}}
      else
        {:requires_human, %{reason: human_verification.rejection_reason, step: step}}
      end
    end
  end

  defp execute_single_step(%{automation_level: :manual} = step, context) do
    # Human execution with system assistance
    assistance_data = prepare_assistance_data(step, context)
    {:requires_human, %{step: step, assistance: assistance_data}}
  end
end

Quality-Integrated Response

Platform-Specific Incident Types

The Prismatic Platform's unique architecture enables detection and response to incidents that traditional security tools cannot address:

defmodule PrismaticSafety.PlatformIncidentHandlers do
  @moduledoc """
  Specialized incident handlers for platform-specific threats
  and quality degradation scenarios.
  """

  @spec handle_quality_degradation(map()) :: {:ok, map()}
  def handle_quality_degradation(incident) do
    %{quality_score: score, degradation_rate: rate} = incident

    containment_actions =
      case {score, rate} do
        {s, _} when s < 95 ->
          # Emergency response: block all commits, trigger auto-evolution
          [:block_commits, :emergency_mode, :trigger_autoheal, :notify_supreme]

        {s, r} when s < 98 and r > 1.0 ->
          # Critical response: enhanced monitoring, targeted evolution
          [:enhanced_monitoring, :targeted_evolution, :notify_architects]

        {s, r} when s < 99 and r > 0.5 ->
          # Warning response: investigation, root cause analysis
          [:investigate_root_cause, :quality_analysis, :notify_team]

        _ ->
          # Monitor and log
          [:log_incident, :continuous_monitoring]
      end

    execute_containment_actions(containment_actions, incident)
  end

  @spec handle_epistemic_attack(map()) :: {:ok, map()}
  def handle_epistemic_attack(incident) do
    %{attack_vector: vector, confidence_distortion: distortion} = incident

    case vector do
      :truth_distortion ->
        # Activate source verification, cross-reference multiple signals
        [:verify_all_sources, :activate_truth_checking, :enhance_signal_plurality]

      :confidence_manipulation ->
        # Recalibrate confidence scoring, audit recent decisions
        [:recalibrate_confidence, :audit_recent_decisions, :activate_trinity_gate]

      :signal_poisoning ->
        # Isolate compromised sources, activate alternative channels
        [:isolate_sources, :activate_alternatives, :source_credibility_audit]

      :cascade_induction ->
        # Break cascade patterns, isolate affected domains
        [:break_cascades, :domain_isolation, :impact_assessment]

      _ ->
        # Unknown epistemic attack: full defensive posture
        [:full_defensive_posture, :comprehensive_analysis, :expert_consultation]
    end
    |> execute_epistemic_containment(incident)
  end

  @spec handle_color_team_compromise(map()) :: {:ok, map()}
  def handle_color_team_compromise(incident) do
    # When a color team itself is compromised or shows unexpected behavior
    %{compromised_team: team, anomaly_type: anomaly} = incident

    isolation_actions = [
      {:isolate_team, team},
      {:activate_backup_team, backup_team_for(team)},
      {:audit_team_decisions, time_window: hours(-24)},
      {:verify_team_outputs, verification_method: :independent_analysis}
    ]

    recovery_actions = [
      {:reset_team_state, team},
      {:reload_team_configuration, team},
      {:verify_team_integrity, team},
      {:gradual_reintegration, team}
    ]

    execute_team_incident_response(isolation_actions ++ recovery_actions, incident)
  end

  defp backup_team_for(:red), do: :white  # White team can simulate red team scenarios
  defp backup_team_for(:blue), do: :purple  # Purple team includes blue team capabilities
  defp backup_team_for(:purple), do: :blue  # Blue team can provide basic synthesis
  defp backup_team_for(:white), do: :blue  # Blue team can provide verification
  defp backup_team_for(:gray), do: :red   # Red team can explore boundaries
end

Integration with Quality Systems

defmodule PrismaticSafety.QualityIncidentIntegration do
  @moduledoc """
  Bridges security incident response with quality management
  systems for comprehensive platform protection.
  """

  alias PrismaticSafety.QualityFloorGuardian
  alias PrismaticEvolution.AutoEvolution

  @spec correlate_quality_security_events(map(), map()) :: {:ok, map()}
  def correlate_quality_security_events(security_incident, quality_event) do
    correlation_analysis = %{
      temporal_correlation: analyze_temporal_correlation(security_incident, quality_event),
      causal_relationship: analyze_causal_relationship(security_incident, quality_event),
      impact_overlap: analyze_impact_overlap(security_incident, quality_event),
      confidence_assessment: assess_correlation_confidence(security_incident, quality_event)
    }

    if correlation_analysis.confidence_assessment > 0.7 do
      # High confidence correlation: treat as unified incident
      unified_incident = merge_incidents(security_incident, quality_event)
      enhanced_response = plan_unified_response(unified_incident)

      {:ok, %{
        incident_type: :security_quality_hybrid,
        unified_incident: unified_incident,
        response_plan: enhanced_response,
        correlation_analysis: correlation_analysis
      }}
    else
      # Low correlation: treat as separate incidents with cross-reference
      {:ok, %{
        incident_type: :parallel_incidents,
        cross_reference: create_cross_reference(security_incident, quality_event),
        independent_responses: true
      }}
    end
  end

  defp analyze_temporal_correlation(security_incident, quality_event) do
    time_diff = DateTime.diff(security_incident.detected_at, quality_event.detected_at, :second)

    cond do
      abs(time_diff) < 300 -> :simultaneous  # Within 5 minutes
      abs(time_diff) < 1800 -> :closely_related  # Within 30 minutes
      abs(time_diff) < 3600 -> :potentially_related  # Within 1 hour
      true -> :unrelated
    end
  end

  defp plan_unified_response(unified_incident) do
    # Plan response that addresses both security and quality concerns
    security_actions = plan_security_response(unified_incident)
    quality_actions = plan_quality_response(unified_incident)

    # Sequence actions to avoid conflicts
    sequenced_plan = sequence_response_actions(security_actions, quality_actions)

    # Add coordination checkpoints
    add_coordination_checkpoints(sequenced_plan)
  end
end

Quality Floor Guardian Integration

The Quality Floor Guardian implements continuous monitoring with automatic escalation, functioning as the platform's primary automated incident detection system:

defmodule PrismaticSafety.QualityFloorGuardian do
  @moduledoc """
  Autonomous quality monitoring with incident response triggers.
  Implements graduated response levels per NM/ND doctrine.
  """

  @quality_thresholds %{
    optimal: {99, 100},
    warning: {98, 99},
    critical: {95, 98},
    emergency: {0, 95}
  }

  @spec assess_quality_state(integer()) :: atom()
  def assess_quality_state(score) when score >= 99, do: :optimal
  def assess_quality_state(score) when score >= 98, do: :warning
  def assess_quality_state(score) when score >= 95, do: :critical
  def assess_quality_state(_score), do: :emergency
end

Comparison with Alternatives

ApproachPrismatic IRNIST SP 800-61SANS ProcessSOAR Platform
Automation levelOTP-native GenServer automationFramework guidance, implementation variesProcess-focused, tools optionalHigh automation, playbook-driven
Detection sourceQuality Guardian + Blue Team + NABLAExternal tools (IDS, SIEM)External toolsIntegrated detection layer
Response speedSub-second automated, human for complexDepends on implementationDepends on trainingSeconds for playbook incidents
Quality integrationNative (13 quality domains monitored)Separate quality managementNot integratedPlugin-based
Epistemic rigorNABLA confidence scoring, Trinity GateNot applicableNot applicableNot applicable
Self-healingSEADF auto-evolution triggersManual remediationManual with guidesAutomated remediation playbooks

Best Practices

  1. Automate Detection, Analyze Manually: Automated systems excel at detecting known patterns and quality regressions at machine speed. Reserve human analysis for novel incidents, strategic decisions, and post-incident reviews where contextual judgment is essential.

  2. Maintain Runbooks: Document step-by-step procedures for every known incident type. Runbooks reduce response time by eliminating decision-making overhead during high-pressure situations. Update runbooks after every post-incident review.

  3. Practice Response Workflows: Conduct regular tabletop exercises and simulated incidents. The Red Team's adversarial scenarios provide realistic practice material for Blue Team responders. Response muscle memory built through practice reduces MTTR.

  4. Preserve Evidence First: Before attempting remediation, capture forensic evidence. Memory dumps, log snapshots, network captures, and system state should be preserved in their pre-remediation state. Evidence lost during hasty remediation cannot be recovered.

  5. Implement Graduated Response: Match response intensity to incident severity. Over-response wastes resources and creates operational disruption. Under-response allows threats to escalate. The L1-L4 violation protocol provides a calibrated escalation framework.

  6. Close the Loop: Every incident must produce a post-incident report with root cause analysis, timeline reconstruction, and concrete improvement actions. The Purple Team's closure analysis ensures that findings from incidents feed back into defensive improvements.

Use Cases

  • Quality Regression Detection: The Quality Floor Guardian detects quality score drops across 13 domains and triggers graduated response from monitoring (OPTIMAL) through commit blocking (EMERGENCY), implementing automated incident response for code quality incidents.

  • Security Posture Degradation: When Prismatic Perimeter detects security rating changes in monitored assets, the incident response system classifies the degradation, assesses impact, and initiates investigation workflows through Blue Team agents.

  • Doctrine Violation Escalation: L3 and L4 violation protocol events trigger incident response workflows that investigate bypass attempts, incomplete deliveries, and doubt-compromised decisions, escalating to Supreme Review when necessary.

  • Infrastructure Anomaly Response: BEAM cluster events (node disconnection, process crashes exceeding supervision thresholds, memory pressure) trigger infrastructure incident response with automatic containment through circuit breakers and graceful degradation.

  • OSINT Source Compromise: When OSINT data sources provide conflicting or degraded intelligence, the incident response system isolates the compromised source, switches to alternative providers, and initiates investigation into the data quality incident.

  • Disaster Recovery - Extended recovery from catastrophic incidents beyond IR scope
  • Self-Healing - Automated recovery reducing incident response burden
  • Blue Team - Defensive agents detecting and responding to incidents
  • Observability - Detection capabilities enabling rapid incident identification
  • Circuit Breaker - Containment pattern preventing cascade failures
  • Violation Protocol - L1-L4 escalation levels for doctrine violations
  • Quality Floor Guardian - Autonomous monitoring triggering incident response
  • SEADF - Self-healing framework providing automated remediation

See Also


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL