KGCS Documentation

🧭 RAG Traversal Templates

For Cybersecurity Core Ontology v1.0

Baseline: frozen Core OWL v1.0 semantics only.

Below is a clean, formal definition of RAG traversal templates that is strictly derived from Core Ontology v1.0 and aligned with its authoritative class/edge tables and invariants.

These templates align with the Core v1.0 specification in docs/02-ontology/core-ontology-v1.0.md and the namespace policy in docs/02-ontology/namespace-policy-v1.0.md.

This is not prose guidance β€” these are machine-usable reasoning contracts.


0. What a β€œTraversal Template” Is (Formal Definition)

A RAG Traversal Template is a bounded, directional, typed graph walk with:

  1. Allowed start node types
  2. Allowed edge sequence
  3. Explicit stop conditions
  4. Guaranteed semantic outcome
  5. Forbidden shortcuts

If a traversal violates a template, the answer must be rejected, not rephrased.


1. Canonical Constraints (Global)

These apply to all templates.

1.1 Allowed Node Set

Only Core Ontology classes:

PlatformConfiguration
Vulnerability
VulnerabilityScore
Weakness
AttackPattern
Technique
SubTechnique
Tactic
DefensiveTechnique
DetectionAnalytic
DeceptionTechnique
EngagementConcept
Reference

1.2 Forbidden Nodes

Asset
ThreatActor
Incident
Exploit
AttackInstance
RiskAssessment
Probability / Likelihood

1.3 Edge Integrity Rule

Every traversed edge must exist verbatim in the Core Ontology edge table .


2. Template T1 β€” Vulnerability Impact Explanation

Intent

Explain what a vulnerability is, why it exists, and how it manifests β€” without operational advice.

Start

Vulnerability (CVE)

Traversal

Vulnerability
 β†’ caused_by β†’ Weakness
 β†’ exploited_by β†’ AttackPattern
 β†’ implemented_as β†’ Technique
 β†’ belongs_to β†’ Tactic

Stop Conditions

Guaranteed Output

Forbidden

❌ CVSS interpretation ❌ Mitigation advice ❌ Threat actor attribution


3. Template T2 β€” Severity & Scoring Explanation

Intent

Explain how severe a vulnerability is and why, without prioritization.

Start

Vulnerability

Traversal

Vulnerability
 β†’ scored_by β†’ VulnerabilityScore (one or more)

Stop Conditions

Guaranteed Output

Forbidden

❌ Risk ranking ❌ Asset context ❌ β€œCritical for you” language


4. Template T3 β€” Detection-Centric Reasoning

Intent

Answer: β€œHow could this be detected?” (not is it detected now)

Start (one of)

Vulnerability
Technique

Traversal (expanded)

Vulnerability
 β†’ caused_by β†’ Weakness
 β†’ exploited_by β†’ AttackPattern
 β†’ implemented_as β†’ Technique
 β†’ detected_by β†’ DetectionAnalytic

Alternative (if starting at Technique)

Technique
 β†’ detected_by β†’ DetectionAnalytic

Stop Conditions

Guaranteed Output

Forbidden

❌ Telemetry availability ❌ Log source guarantees ❌ SOC-specific logic


5. Template T4 β€” Mitigation-Centric Reasoning

Intent

Answer: β€œWhat mitigates this behavior?” at a knowledge level.

Start

Vulnerability

Traversal

Vulnerability
 β†’ caused_by β†’ Weakness
 β†’ exploited_by β†’ AttackPattern
 β†’ implemented_as β†’ Technique
 β†’ mitigated_by β†’ DefensiveTechnique

Stop Conditions

Guaranteed Output

Forbidden

❌ Configuration steps ❌ Product recommendations ❌ Effectiveness claims


6. Template T5 β€” Deception & Adversary Disruption

Intent

Explain how an adversary could be disrupted or deceived.

Start

Technique

Traversal

Technique
 β†’ countered_by β†’ DeceptionTechnique

Optional Extension

DeceptionTechnique
 ← disrupts ← EngagementConcept

Stop Conditions

Guaranteed Output

Forbidden

❌ Active defense execution ❌ Attribution ❌ Campaign claims


7. Template T6 β€” Reference & Evidence Grounding

Intent

Provide primary sources supporting any claim.

Start

Vulnerability

Traversal

Vulnerability
 β†’ references β†’ Reference

Stop Conditions

Guaranteed Output

Forbidden

❌ External enrichment ❌ Blog summaries ❌ Analyst opinion


8. Template T7 β€” End-to-End Defensive Reasoning (Gold Path)

Intent

Answer:

β€œWhat is this issue, how is it exploited, and how is it detected and mitigated?”

Traversal (full chain)

Vulnerability
 β†’ caused_by β†’ Weakness
 β†’ exploited_by β†’ AttackPattern
 β†’ implemented_as β†’ Technique
   β”œβ”€ detected_by β†’ DetectionAnalytic
   └─ mitigated_by β†’ DefensiveTechnique

Stop Conditions

Guarantees


9. Template Violation Matrix (Hard Fail)

Violation Result
Skipping Weakness ❌ Reject answer
CVE β†’ Technique direct ❌ Reject
Adding probability ❌ Reject
Asset-based inference ❌ Reject
Threat actor naming ❌ Reject

10. Why These Templates Work for RAG

Derived directly from:

They ensure: