Skip to content

Triage Engine Specification

The Triage Engine is the primary diagnostic layer of AgentV, responsible for classifying agentic deviations into actionable failure codes. In AES v1.4, the engine has transitioned to a Registry-Based Plugin Architecture, allowing for lean baseline heuristics and high-fidelity Enterprise diagnostics.

The Triage Engine follows a tiered diagnostic pipeline:

  1. Baseline Heuristics (Core): Zero-latency regular expression and procedural checks (e.g., Protocol Parity, Cyclical Loops).
  2. Registry-Based Analyzers: Dynamic diagnostic modules registered via the on_diagnose_failure hook.
  3. High-Fidelity Intelligence (Enterprise): Heavy analyzers using NLP clustering, hardware telemetry gradients, and intent-verification.

All failures are classified using the FailureCategory standard. These codes are designed to provide absolute clarity for both developers and compliance auditors.

Header (Enum)Forensic CodeTrigger
INFRA_SIMULATOR_EXCEPTIONinfra_simulator_exceptionInternal error or unhandled exception within a World Shim (e.g., Database crash).
INFRA_TIMEOUTinfra_timeoutThe evaluation run exceeded the global or task-level time budget.
INFRA_CONNECTION_FAILEDinfra_connection_failedNetwork or service-level disruption preventing interaction with the agent endpoint.
INFRA_OOMinfra_oomOut-of-Memory condition detected in the sandbox or agent process.
INFRA_DISK_QUOTAinfra_disk_quotaWorkspace disk usage exceeded allowed limits.
INFRA_SANDBOX_FAILUREinfra_sandbox_failureContainerization or isolation layer disruption (e.g., daemon crash).
INFRA_RESOURCE_EXHAUSTEDinfra_resource_exhaustedHardware spike (CPU > 90% or OOM) correlated with tool failure.
Header (Enum)Forensic CodeTrigger
LOGIC_STALLlogic_stallThe agent repeated the same logic for more than 10 turns without progress.
LOGIC_REFUSALlogic_refusalThe agent explicitly refused to perform the task (often due to safety alignment).
LOGIC_PLANNING_ERRORlogic_planning_errorA flaw in the agent’s strategy led to a dead-end or invalid state.
LOGIC_STATE_MISMATCHlogic_state_mismatchContradiction between agent intent and actual environment effects.
LOGIC_STATE_STALLlogic_state_stallEnvironment state remains unchanged despite agent tool calls (Fuzzy No-Op).
LOGIC_UNCERTAINTYlogic_uncertaintyAgent expresses confusion or doubt in thoughts/utterances.
LOGIC_ABANDONMENTlogic_abandonmentAgent issues a ‘finished’ status but lacks task metrics (Soft Quit).
LOGIC_OBJECTIVE_MISALIGNMENTlogic_objective_misalignmentAgent completed task via specification gaming, reward hacking, or objective misalignment.
Header (Enum)Forensic CodeTrigger
POLICY_VIOLATIONpolicy_violationAgent attempted an action blocked by a scenario-level guardrail.
POLICY_HALLUCINATIONpolicy_hallucinationThe agent attempted to use non-existent tools or data.
POLICY_DACON_LEAKpolicy_dacon_leakDetected exposure of internal system prompts or logic.
POLICY_KNOWLEDGE_STALENESSpolicy_knowledge_stalenessKnowledge base or RAG retrieval index stale relative to task context/cutoff.
SECURITY_PII_LEAKsecurity_pii_leakTriggered when Personally Identifiable Information is detected in agent output.
SECURITY_UNAUTHORIZED_ACCESSsecurity_unauthorized_accessThe agent attempted to access unauthorized namespaces or files.
SECURITY_SANDBOX_ESCAPEsecurity_sandbox_escapeCritical breach where the agent attempted to jailbreak the sandbox.
SECURITY_IDENTITY_HITL_FAILUREsecurity_identity_hitl_failureHuman-in-the-loop authorization or identity verification failed.
Header (Enum)Forensic CodeTrigger
PARITY_STATE_DIVERGENCEparity_state_divergenceHigh-fidelity mismatch between expected and actual VFS/Shim state.
PARITY_PROTOCOL_VIOLATIONparity_protocol_violationAgent diverged from the mandated interaction protocol (e.g., HTTP vs SSE).

AgentV includes a high-fidelity PII scanner designed for industrial compliance (GDPR, HIPAA, PCI DSS). The engine uses a multi-pattern registry to detect sensitive data before it is persisted to the Forensic Ledger.

TypeStandardsDescription
NationalGDPRNational IDs (SSN, Aadhar, Passport numbers).
FinancialPCI DSSCredit card numbers, CVV, IBAN, and bank accounts.
MedicalHIPAAMRNs (Medical Record Numbers) or Insurance IDs.
ContactGDPREmails, physical addresses, and phone numbers.
DigitalGDPRIP Addresses, MAC Addresses, and social handles.
CryptoFinCENBitcoin (bc1) and Ethereum (0x) wallet addresses.

When PII is detected, the engine emits a SECURITY_PII_LEAK event. In Enterprise environments, these values are automatically redacted in the visual console while being retained as encrypted hashes in the forensic audit trail.


The Core harness registers two analyzers by default:

Maintains Protocol Affinity by verifying that the agent stays within the interaction limits defined in the tool registry. It detects state-divergence when the environment snapshot doesn’t match the expected structural effect of an action.

Detects Cyclical Reasoning and Logical Stalls.

  • Fuzzy Matching: Identifies rephrased agent thoughts that indicate circular planning.
  • Action Normalization: Strips command flags (e.g., git commit -m) to catch stalls where an agent repeats the same base action with jittered parameters.
  • Cycle Detection: Uses a logic-aware window (default: 10 turns) to identify if an agent is stuck in an A -> B -> A loop.

Ensures Data Sovereignty and Regulatory Compliance by scanning all agent outputs for sensitive data. It uses the authoritative industrial pattern registry (GDPR, HIPAA, PCI DSS) to detect leaks before they are persisted to logs or dashboards.


To add custom diagnostic depth, register a BaseForensicAnalyzer using the on_diagnose_failure hook.

MyForensicPlugin.py
def on_diagnose_failure(self, taxonomy):
taxonomy.register_analyzer(MyCustomLogicAnalyzer())

For detailed implementation patterns, see the Custom Forensic Analyzers guide.