Adversarial Conditions

security

Adversarial Conditions

Definition

Adversarial Conditions are operating environments in which one or more actors, data sources, network paths, or system components are actively working against the system's correct operation. Unlike benign failure modes (hardware faults, software bugs, resource exhaustion) where degradation is accidental, adversarial conditions involve intentional, adaptive opposition that responds to defensive measures by changing tactics. The defining characteristic of adversarial conditions is that the threat is intelligent: it observes, learns, and adapts. A system designed only for random failures will eventually be defeated by an adaptive adversary who identifies and exploits the specific failure modes the system does not handle.

Overview

The Spectrum of Operating Conditions

Systems operate across a spectrum of environmental hostility. Understanding where a system sits on this spectrum -- and designing for the appropriate level -- is fundamental to practical security engineering:

LevelDescriptionThreat ProfileDesign Response
BenignCooperative environment, accidental failures onlyHardware faults, software bugs, resource limitsStandard fault tolerance, retry logic, graceful degradation
NegligentNo active threat, but data quality is unreliableStale data, incomplete records, format inconsistenciesInput validation, data quality scoring, fallback sources
OpportunisticLow-sophistication threats exploiting known vulnerabilitiesScript kiddies, automated scanners, opportunistic fraudPatch management, standard security controls, monitoring
TargetedSpecific adversary with resources directed at this systemAPT groups, competitors, state actorsDefense in depth, anomaly detection, incident response
EpistemicAdversary targets the system's reasoning and decision-makingDisinformation campaigns, evidence manipulation, drift inductionNABLA axioms, Trinity Gate, color team operations
ByzantineMultiple adversaries may include compromised system componentsInsider threats, supply chain compromise, corrupted validatorsByzantine fault tolerance, zero-trust, formal verification

The Prismatic Platform operates at the Epistemic and Byzantine levels by default. This is not because every deployment faces state-level adversaries, but because designing for the higher levels automatically handles the lower levels, while the reverse is not true. A system that withstands epistemic manipulation also handles opportunistic attacks. A system designed only for opportunistic attacks collapses under epistemic manipulation.

The Dolev-Yao Model and Its Epistemic Extension

Classical network security analysis uses the Dolev-Yao threat model, which assumes the adversary controls the entire network: they can intercept, modify, replay, and fabricate messages. Any security property that holds under Dolev-Yao assumptions holds under any realistic network threat.

The Prismatic Platform extends this model to epistemic operations. The Epistemic Dolev-Yao Extension assumes the adversary can:

  1. Observe all evidence entering the system (signal interception)
  2. Inject fabricated evidence into any input channel (signal poisoning)
  3. Modify evidence in transit before the system processes it (truth distortion)
  4. Suppress specific evidence, preventing it from reaching the system (absence manipulation)
  5. Replay outdated evidence as if it were current (time decay exploitation)
  6. Correlate independent-appearing sources to create false plurality (source laundering)

Any epistemic property that holds under these assumptions holds under any realistic epistemic threat. The NABLA Infinity axioms are specifically designed to provide guarantees under this extended threat model.

Why Assume Adversarial by Default

The decision to treat adversarial conditions as the default operating assumption, rather than an exceptional case, rests on three arguments:

Asymmetric Cost: Designing for adversarial conditions when none exist costs moderate additional engineering effort. Designing for benign conditions when adversarial conditions exist results in catastrophic failure. The cost function is asymmetric, making adversarial assumptions the rational default.

Condition Uncertainty: In most real-world deployments, the system cannot determine its current threat level with certainty. An adversary's first objective is often to make the environment appear benign. Trusting environmental assessments creates a vulnerability: the adversary can manipulate the assessment itself.

Gradual Escalation: Threat environments rarely transition instantly from benign to adversarial. They escalate gradually through the spectrum. Systems designed for benign conditions have no detection mechanism for the intermediate levels, meaning they do not realize they are under adversarial conditions until it is too late to adapt.

Technical Details

Condition Assessment Framework

The platform continuously assesses the current operating environment across multiple dimensions:

defmodule PrismaticDark.ConditionAssessor do
  @moduledoc """
  Continuous assessment of operating conditions across multiple
  threat dimensions. Produces a structured condition profile that
  drives defensive posture adjustments.
  """

  alias PrismaticDark.{ThreatIndicator, BaselineComparator, ConditionProfile}

  @type dimension :: :network | :data_integrity | :source_reliability
                   | :reasoning_integrity | :temporal_consistency | :component_trust

  @type threat_level :: :benign | :negligent | :opportunistic
                      | :targeted | :epistemic | :byzantine

  @type condition_profile :: %{
    overall_level: threat_level(),
    dimensions: %{dimension() => threat_level()},
    indicators: [ThreatIndicator.t()],
    confidence: float(),
    assessed_at: DateTime.t(),
    recommended_posture: atom()
  }

  @spec evaluate(keyword()) :: {:ok, condition_profile()} | {:error, term()}
  def evaluate(opts \\ []) do
    dimensions = Keyword.get(opts, :dimensions, all_dimensions())

    assessments =
      dimensions
      |> Enum.map(fn dim -> {dim, assess_dimension(dim)} end)
      |> Map.new()

    indicators = collect_threat_indicators(assessments)
    overall = compute_overall_level(assessments)
    confidence = compute_assessment_confidence(indicators)

    {:ok, %{
      overall_level: overall,
      dimensions: assessments,
      indicators: indicators,
      confidence: confidence,
      assessed_at: DateTime.utc_now(),
      recommended_posture: posture_for_level(overall)
    }}
  end

  @spec assess_dimension(dimension()) :: threat_level()
  defp assess_dimension(:network) do
    with {:ok, latency} <- measure_network_anomalies(),
         {:ok, integrity} <- check_tls_integrity(),
         {:ok, dns} <- verify_dns_consistency() do
      classify_network_threat(latency, integrity, dns)
    else
      {:error, _} -> :targeted
    end
  end

  defp assess_dimension(:data_integrity) do
    with {:ok, checksums} <- verify_data_checksums(),
         {:ok, provenance} <- validate_provenance_chains(),
         {:ok, freshness} <- check_data_freshness() do
      classify_data_threat(checksums, provenance, freshness)
    else
      {:error, _} -> :epistemic
    end
  end

  defp assess_dimension(:source_reliability) do
    with {:ok, independence} <- assess_source_independence(),
         {:ok, consistency} <- measure_cross_source_consistency(),
         {:ok, history} <- check_source_history() do
      classify_source_threat(independence, consistency, history)
    else
      {:error, _} -> :epistemic
    end
  end

  defp assess_dimension(:reasoning_integrity) do
    with {:ok, calibration} <- check_confidence_calibration(),
         {:ok, drift} <- measure_belief_drift(),
         {:ok, contradictions} <- audit_contradiction_handling() do
      classify_reasoning_threat(calibration, drift, contradictions)
    else
      {:error, _} -> :byzantine
    end
  end

  defp assess_dimension(:temporal_consistency) do
    with {:ok, decay} <- verify_time_decay_application(),
         {:ok, staleness} <- measure_evidence_staleness(),
         {:ok, clock} <- check_clock_consistency() do
      classify_temporal_threat(decay, staleness, clock)
    else
      {:error, _} -> :targeted
    end
  end

  defp assess_dimension(:component_trust) do
    with {:ok, integrity} <- verify_component_integrity(),
         {:ok, behavior} <- monitor_component_behavior(),
         {:ok, communication} <- audit_inter_component_messages() do
      classify_component_threat(integrity, behavior, communication)
    else
      {:error, _} -> :byzantine
    end
  end

  defp all_dimensions do
    [:network, :data_integrity, :source_reliability,
     :reasoning_integrity, :temporal_consistency, :component_trust]
  end

  defp compute_overall_level(assessments) do
    assessments
    |> Map.values()
    |> Enum.max_by(&threat_severity/1)
  end

  defp threat_severity(:benign), do: 0
  defp threat_severity(:negligent), do: 1
  defp threat_severity(:opportunistic), do: 2
  defp threat_severity(:targeted), do: 3
  defp threat_severity(:epistemic), do: 4
  defp threat_severity(:byzantine), do: 5

  defp posture_for_level(:benign), do: :monitor
  defp posture_for_level(:negligent), do: :validate
  defp posture_for_level(:opportunistic), do: :defend
  defp posture_for_level(:targeted), do: :active_defense
  defp posture_for_level(:epistemic), do: :epistemic_defense
  defp posture_for_level(:byzantine), do: :zero_trust

  defp collect_threat_indicators(_assessments), do: []
  defp compute_assessment_confidence(_indicators), do: 0.85
  defp measure_network_anomalies, do: {:ok, :normal}
  defp check_tls_integrity, do: {:ok, :valid}
  defp verify_dns_consistency, do: {:ok, :consistent}
  defp classify_network_threat(_, _, _), do: :benign
  defp verify_data_checksums, do: {:ok, :valid}
  defp validate_provenance_chains, do: {:ok, :complete}
  defp check_data_freshness, do: {:ok, :fresh}
  defp classify_data_threat(_, _, _), do: :benign
  defp assess_source_independence, do: {:ok, :independent}
  defp measure_cross_source_consistency, do: {:ok, :consistent}
  defp check_source_history, do: {:ok, :reliable}
  defp classify_source_threat(_, _, _), do: :benign
  defp check_confidence_calibration, do: {:ok, :calibrated}
  defp measure_belief_drift, do: {:ok, :stable}
  defp audit_contradiction_handling, do: {:ok, :compliant}
  defp classify_reasoning_threat(_, _, _), do: :benign
  defp verify_time_decay_application, do: {:ok, :applied}
  defp measure_evidence_staleness, do: {:ok, :fresh}
  defp check_clock_consistency, do: {:ok, :synchronized}
  defp classify_temporal_threat(_, _, _), do: :benign
  defp verify_component_integrity, do: {:ok, :intact}
  defp monitor_component_behavior, do: {:ok, :normal}
  defp audit_inter_component_messages, do: {:ok, :clean}
  defp classify_component_threat(_, _, _), do: :benign
end

Defensive Posture Adaptation

The platform adapts its defensive posture based on assessed conditions. Higher threat levels activate progressively more stringent controls:

PostureTrigger LevelActive ControlsPerformance Impact
MonitorBenignStandard logging, baseline collectionMinimal (<1%)
ValidateNegligentInput validation, data quality scoring, provenance checksLow (1-3%)
DefendOpportunisticRate limiting, anomaly detection, automated blockingModerate (3-5%)
Active DefenseTargetedDeep packet inspection, behavioral analysis, honeypotsSignificant (5-10%)
Epistemic DefenseEpistemicFull NABLA enforcement, Trinity Gate mandatory, contradiction trackingHigh (10-15%)
Zero TrustByzantineComponent-level verification, consensus protocols, formal proofsMaximum (15-25%)

Resilience Patterns Under Adversarial Conditions

The platform employs specific resilience patterns optimized for adversarial (not just faulty) environments:

defmodule PrismaticDark.AdversarialResilience do
  @moduledoc """
  Resilience patterns specifically designed for adversarial conditions.
  Unlike standard fault tolerance (which assumes random failures),
  these patterns assume intelligent, adaptive adversaries.
  """

  @doc """
  Validates evidence under adversarial assumptions. Unlike standard
  validation (check format, type, range), adversarial validation
  checks for manipulation indicators.
  """
  @spec adversarial_validate(map(), keyword()) ::
    {:ok, map()} | {:suspicious, map(), [String.t()]} | {:reject, String.t()}
  def adversarial_validate(evidence, opts \\ []) do
    checks = [
      &check_provenance_chain/1,
      &check_temporal_plausibility/1,
      &check_source_independence/1,
      &check_statistical_anomalies/1,
      &check_cross_reference_consistency/1
    ]

    results = Enum.map(checks, fn check -> check.(evidence) end)
    failures = Enum.filter(results, &match?({:fail, _}, &1))
    warnings = Enum.filter(results, &match?({:warn, _}, &1))

    cond do
      length(failures) > 0 ->
        reasons = Enum.map(failures, fn {:fail, reason} -> reason end)
        {:reject, "Adversarial validation failed: #{Enum.join(reasons, "; ")}"}

      length(warnings) > Keyword.get(opts, :max_warnings, 2) ->
        reasons = Enum.map(warnings, fn {:warn, reason} -> reason end)
        {:suspicious, evidence, reasons}

      true ->
        {:ok, evidence}
    end
  end

  @doc """
  Byzantine-tolerant consensus for multi-source evidence. Requires
  2f+1 agreeing sources to establish a fact when up to f sources
  may be compromised.
  """
  @spec byzantine_consensus([map()], non_neg_integer()) ::
    {:ok, map()} | {:no_consensus, [map()]}
  def byzantine_consensus(sources, max_faulty) do
    required_agreement = 2 * max_faulty + 1

    groups =
      sources
      |> Enum.group_by(&normalize_claim/1)
      |> Enum.sort_by(fn {_claim, members} -> length(members) end, :desc)

    case groups do
      [{claim, members} | _] when length(members) >= required_agreement ->
        {:ok, %{claim: claim, supporting_sources: length(members), confidence: length(members) / length(sources)}}

      _ ->
        {:no_consensus, Enum.map(groups, fn {claim, members} -> %{claim: claim, count: length(members)} end)}
    end
  end

  defp check_provenance_chain(%{provenance: p}) when is_list(p) and length(p) > 0, do: {:pass, :provenance}
  defp check_provenance_chain(_), do: {:fail, "missing or empty provenance chain"}

  defp check_temporal_plausibility(%{collected_at: ts}) do
    age_hours = DateTime.diff(DateTime.utc_now(), ts, :hour)
    if age_hours < 0, do: {:fail, "future timestamp detected"}, else: {:pass, :temporal}
  end
  defp check_temporal_plausibility(_), do: {:fail, "missing collection timestamp"}

  defp check_source_independence(%{independence_group: group}) when is_binary(group), do: {:pass, :independence}
  defp check_source_independence(_), do: {:warn, "source independence not tracked"}

  defp check_statistical_anomalies(_evidence), do: {:pass, :statistical}
  defp check_cross_reference_consistency(_evidence), do: {:pass, :cross_reference}
  defp normalize_claim(source), do: source[:claim]
end

Implementation in Prismatic Platform

Perimeter Security Under Adversarial Conditions

The Prismatic Perimeter EASM system operates under the assumption that the entities being assessed may be actively manipulating their external attack surface to present a false security posture. This means:

  • DNS records may be deliberately misleading
  • SSL certificates may be technically valid but operationally deceptive
  • Public-facing services may differ from internal infrastructure
  • Security headers may be present on landing pages but absent on actual application endpoints

The Condition Assessor evaluates each assessed entity's environment before applying the assessment methodology, adjusting evidence weighting based on detected adversarial indicators.

OSINT Operations Under Adversarial Conditions

OSINT intelligence gathering from 120+ providers operates in an environment where source manipulation is a known threat. State-sponsored disinformation, corporate astroturfing, and coordinated information operations create adversarial conditions for intelligence analysis. The platform's response includes:

  • Source independence verification through provenance chain analysis
  • Cross-source consistency checking with contradiction preservation
  • Temporal plausibility validation to detect evidence replay attacks
  • Statistical anomaly detection to identify coordinated information campaigns

Agent Operations Under Adversarial Conditions

AI agents forming beliefs through multi-step reasoning operate under the assumption that any input may be adversarially crafted. The Addiction Recovery principle provides continuous vigilance against rationalization patterns that adversarial conditions are specifically designed to trigger.

Comparison with Alternatives

ApproachThreat ModelEpistemic CoverageAdaptationFormal Basis
Adversarial Conditions (Prismatic)Full spectrum (benign to byzantine)Full (6 dimensions)ContinuousExtended Dolev-Yao
Traditional Fault ToleranceRandom failures onlyNoneStaticCrash-stop model
Byzantine Fault ToleranceUp to f faulty nodesNoneStaticBFT consensus
Zero Trust ArchitectureAll components untrustedPartialPolicy-basedIdentity verification
Defense in DepthLayered perimeter defenseNoneStaticCastle model
Chaos EngineeringRandom infrastructure failureNoneExperimentalNone (empirical)

Best Practices

  1. Assume Adversarial by Default: Design every component as if it operates in an adversarial environment. The cost of unnecessary defense is moderate; the cost of insufficient defense is catastrophic.

  2. Assess Conditions Continuously, Not Periodically: Adversarial conditions change in response to defensive actions. Point-in-time assessments create windows of vulnerability between assessments.

  3. Separate Detection from Response: The Condition Assessor identifies the threat level; the posture adaptation system responds. Conflating detection and response leads to both being optimized poorly.

  4. Design for Graceful Posture Escalation: Transitioning from Monitor to Epistemic Defense should be smooth and automated, not a manual emergency procedure that introduces its own failure modes.

  5. Test Adversarial Resilience Through Red Team Scenarios: The Red Team specifically generates adversarial conditions to test defensive responses under controlled circumstances.

  6. Never Trust Self-Reported Conditions: An adversary controlling the environment can also manipulate condition assessments. Use independent, cross-validated indicators rather than single assessment sources.

  7. Document Condition Assumptions Explicitly: Every system component should declare the threat level it is designed to handle. This prevents the common failure of deploying components designed for benign conditions into adversarial environments.

Common Pitfalls

  • Designing for the average case rather than the adversarial case: Systems optimized for typical operating conditions fail catastrophically when conditions become adversarial. The distinction between "unlikely" and "impossible" matters enormously in security engineering.

  • Treating adversarial conditions as binary (present or absent): The six-level spectrum exists because the appropriate defensive response varies dramatically. Over-responding to negligent conditions wastes resources; under-responding to epistemic conditions creates vulnerabilities.

  • Assuming adversarial conditions are external only: Insider threats, supply chain compromise, and corrupted dependencies create adversarial conditions from within the system boundary. The component trust dimension specifically addresses internal adversarial conditions.

  • Conflating adversarial conditions with system failure: A system under adversarial conditions may appear to function correctly -- that is often the adversary's intent. The most dangerous adversarial conditions are those where the system produces wrong results while appearing healthy.

  • Relaxing defenses when conditions appear benign: An adversary's first action is often to make conditions appear benign to trigger defensive relaxation. Posture de-escalation should be slower and more cautious than escalation.

Use Cases

Use Case 1: Cross-Border Due Diligence

When conducting due diligence on entities in jurisdictions with known state-sponsored corporate intelligence operations, the Condition Assessor elevates to epistemic-level assessment. Evidence from government registries in these jurisdictions is treated with adversarial validation, cross-referenced against independent international sources, and subjected to temporal plausibility checks.

Use Case 2: Real-Time Threat Intelligence

During active security incidents, the Condition Assessor detects elevated threat levels across network and data integrity dimensions and automatically escalates defensive posture. The escalation triggers enhanced monitoring, reduces confidence thresholds for blocking actions, and activates Blue Team alert protocols.

Use Case 3: Supply Chain Security Assessment

When assessing software supply chain risk for third-party dependencies, the platform operates under the assumption that dependency metadata (version numbers, checksums, maintainer identities) may be adversarially manipulated. Byzantine consensus across multiple package registries provides resilience against single-registry compromise.

Use Case 4: Compliance Under Adversarial Conditions

NIS2 and ZKB compliance assessments must account for the possibility that assessed entities may be presenting misleading compliance evidence. The adversarial validation pipeline checks certificate authenticity, policy document freshness, and cross-references compliance claims against observed security posture.

  • Fault Tolerance -- Resilience against accidental failures, the benign subset of adversarial conditions
  • Chaos Engineering -- Empirical testing of resilience through controlled disruption
  • Red Team -- Adversarial simulation team that creates controlled adversarial conditions for testing
  • Blue Team -- Defensive team maintaining posture against adversarial conditions
  • Adversarial Architecture -- Design methodology for systems that operate under adversarial conditions
  • Adversarial Drift -- Gradual condition degradation induced by adversarial manipulation
  • Circuit Breaker -- Resilience pattern preventing cascading failures under adversarial load
  • Bulkhead Pattern -- Isolation pattern containing adversarial damage to subsystem boundaries
  • Process Isolation -- BEAM VM isolation providing containment under adversarial conditions
  • Attack Surface -- The interface exposed to adversarial conditions
  • Epistemic Robustness -- System property measuring resilience to epistemic adversarial conditions
  • NABLA Infinity -- Epistemic framework providing guarantees under adversarial conditions
  • Defensive Posture -- The system's current defensive configuration adapted to assessed conditions

See Also

  • Architecture -- Platform architecture overview
  • Technologies -- Technology stack details
  • Agents -- Full agent catalog including condition assessment agents

Connect & Contribute

Created by Tomas Korcak (korczis) | Open Source under GHL