KGCS Documentation

🧠 RAG Traversal Templates

(Query-Safe Paths)

Below is a formal set of RAG traversal templates designed to be query-safe, non-hallucinatory, and ontology-governed, explicitly aligned with:

These templates are not examples β€” they are approved traversal contracts that an LLM (or agent) is allowed to follow.

Implementation rule: templates requiring planned extensions MUST be treated as unavailable until the corresponding extension OWL and shapes are present.


0. Why Traversal Templates Exist (Non-Negotiable)

RAG systems must not β€œreason freely” over graphs They must follow pre-approved paths to avoid:

A Traversal Template defines:


1. Core Traversal Invariants (Global Rules)

These apply to all templates:

  1. ❌ Never skip layers (e.g. CVE β†’ Technique directly)
  2. ❌ Never cross extensions unless explicitly allowed
  3. βœ… Traverse from extension nodes into Core only through explicitly declared mapping edges
  4. ❌ Never infer β€œused”, β€œcaused”, or β€œexploited” unless edge exists
  5. βœ… Always terminate on authoritative Core nodes for explanations

2. Core + Asset Baseline Traversal Templates

T-CORE-01 β€” Vulnerability β†’ Defensive Options

Question answered

β€œHow can this vulnerability be mitigated or detected?”

Traversal

Vulnerability
 β†’ Weakness
 β†’ AttackPattern
 β†’ Technique
 β†’ (DefensiveTechnique | DetectionAnalytic | DeceptionTechnique)

Why safe


T-CORE-02 β€” Asset Exposure Analysis

Question answered

β€œWhat attack techniques are relevant to this asset?”

Traversal

Asset
 β†’ PlatformConfiguration
 β†’ Vulnerability
 β†’ Weakness
 β†’ AttackPattern
 β†’ Technique

Forbidden


T-CORE-03 β€” Technique Context

Question answered

β€œWhat is this technique, and how is it usually handled?”

Traversal

Technique
 β†’ Tactic
 β†’ DefensiveTechnique
 β†’ DetectionAnalytic
 β†’ DeceptionTechnique

3. Incident Extension Traversal Templates

Status: planned (activate only when Incident extension artifacts are available).

T-INC-01 β€” Incident β†’ What Happened

Question answered

β€œWhat techniques were observed in this incident?”

Traversal

Incident
 β†’ ObservedTechnique
 β†’ Technique

Rule


4. ThreatActor Extension Traversal Templates

Status: planned (activate only when ThreatActor extension artifacts are available).

T-TA-01 β€” Attribution Reasoning

Question answered

β€œWho might be responsible for this incident?”

Traversal

Incident
 β†’ AttributionClaim
 β†’ ThreatActor

Hard rule


5. Risk Extension Traversal Templates

Status: planned (activate only when Risk extension artifacts are available).

T-RISK-01 β€” Risk Prioritization

Question answered

β€œWhich vulnerabilities should we fix first?”

Traversal

Asset
 β†’ Vulnerability
 β†’ RiskScenario
 β†’ RiskScore

Rule


6. Cross-Extension (Explicitly Allowed) Templates

Status: planned (requires Incident + Risk extensions).

T-X-01 β€” Incident β†’ Risk Escalation

Question answered

β€œHow does this incident affect our risk posture?”

Traversal

Incident
 β†’ ObservedTechnique
 β†’ Technique
 β†’ RiskScenario
 β†’ RiskScore

7. Forbidden Traversals (Global Blacklist)

These must be hard-blocked in RAG:

❌ CVE β†’ ThreatActor ❌ Incident β†’ Vulnerability ❌ ThreatActor β†’ Weakness ❌ RiskScore β†’ Technique ❌ Detection β†’ ThreatActor ❌ Incident β†’ Decision

If a user asks a question that requires one of these paths β†’ the system must answer with uncertainty.


8. How to Enforce This in Practice

Option A β€” Static Path Registry

Option B β€” Query Planner + Validator

  1. LLM proposes traversal
  2. Validator checks against template list
  3. Only then execute graph query

Option C β€” Prompt-Bound RAG

Inject templates directly into system prompt:

β€œYou may only answer by following one of the approved traversal templates…”