Class ThreatAssessment
- Namespace
- AsiBackbone.Core.ThreatModeling
- Assembly
- AsiBackbone.Core.dll
Represents a structured threat-aware assessment contributed during policy evaluation.
public sealed class ThreatAssessment
- Inheritance
-
ThreatAssessment
- Inherited Members
Constructors
ThreatAssessment(ThreatSeverity, string, string, string, GovernanceDecisionOutcome, double, IReadOnlyDictionary<string, string>?)
Initializes a new instance of the ThreatAssessment class.
public ThreatAssessment(ThreatSeverity severity, string category, string reasonCode, string description, GovernanceDecisionOutcome recommendedOutcome, double confidence = 1, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
severityThreatSeverityThe severity reported by the contributor.
categorystringThe threat category reported by the contributor.
reasonCodestringThe machine-readable reason code.
descriptionstringThe human-readable threat description.
recommendedOutcomeGovernanceDecisionOutcomeThe governance outcome recommended by the contributor.
confidencedoubleThe contributor confidence from 0.0 to 1.0.
metadataIReadOnlyDictionary<string, string>Optional contributor-supplied metadata retained on generated operation reasons. Keys beginning with
threat.are reserved for framework-generated provenance.
Exceptions
- ArgumentException
Thrown when
category,reasonCode, ordescriptionis null, empty, or whitespace, or whenmetadatacontains a key in the reservedthreat.namespace.- ArgumentOutOfRangeException
Thrown when
severityorrecommendedOutcomeis undefined, or whenconfidenceis outside the supported range.
Fields
MaximumConfidence
Defines the maximum confidence value accepted by a threat assessment.
public const double MaximumConfidence = 1
Field Value
MinimumConfidence
Defines the minimum confidence value accepted by a threat assessment.
public const double MinimumConfidence = 0
Field Value
Properties
Category
Gets the threat category reported by the contributor.
public string Category { get; }
Property Value
Confidence
Gets the contributor confidence from 0.0 to 1.0.
public double Confidence { get; }
Property Value
Description
Gets the human-readable threat description.
public string Description { get; }
Property Value
IsActionable
Gets a value indicating whether the assessment should influence the composed decision.
public bool IsActionable { get; }
Property Value
Metadata
Gets optional contributor-supplied metadata retained on generated operation reasons.
public IReadOnlyDictionary<string, string> Metadata { get; }
Property Value
ReasonCode
Gets the machine-readable reason code.
public string ReasonCode { get; }
Property Value
RecommendedOutcome
Gets the governance outcome recommended by the contributor.
public GovernanceDecisionOutcome RecommendedOutcome { get; }
Property Value
Severity
Gets the severity reported by the contributor.
public ThreatSeverity Severity { get; }
Property Value
Methods
Create(ThreatSeverity, string, string, string, GovernanceDecisionOutcome, double, IReadOnlyDictionary<string, string>?)
Creates a threat assessment.
public static ThreatAssessment Create(ThreatSeverity severity, string category, string reasonCode, string description, GovernanceDecisionOutcome recommendedOutcome, double confidence = 1, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
severityThreatSeverityThe severity reported by the contributor.
categorystringThe threat category reported by the contributor.
reasonCodestringThe machine-readable reason code.
descriptionstringThe human-readable threat description.
recommendedOutcomeGovernanceDecisionOutcomeThe governance outcome recommended by the contributor.
confidencedoubleThe contributor confidence from 0.0 to 1.0.
metadataIReadOnlyDictionary<string, string>Optional contributor-supplied metadata retained on generated operation reasons. Keys beginning with
threat.are reserved for framework-generated provenance.
Returns
- ThreatAssessment
A threat assessment.
Exceptions
- ArgumentException
Thrown when
category,reasonCode, ordescriptionis null, empty, or whitespace, or whenmetadatacontains a key in the reservedthreat.namespace.- ArgumentOutOfRangeException
Thrown when
severityorrecommendedOutcomeis undefined, or whenconfidenceis outside the supported range.
NoThreat()
Creates a no-threat assessment.
public static ThreatAssessment NoThreat()
Returns
- ThreatAssessment
A no-threat assessment that does not influence decision composition.
ToOperationReason(string?, GovernanceDecisionOutcome?)
Converts the assessment into an operation reason with threat metadata.
public OperationReason ToOperationReason(string? contributorName = null, GovernanceDecisionOutcome? effectiveOutcome = null)
Parameters
contributorNamestringOptional contributor name to include in metadata.
effectiveOutcomeGovernanceDecisionOutcome?Optional effective outcome selected by the evaluator after safety promotion.
Returns
- OperationReason
An operation reason representing the assessment.