Module qa_agent

Module qa_agent 

Source
Expand description

Quality-Assurance / Safety monitor agent.

QAAgent is a passive observer: it receives a copy of every chat message flowing through the system and publishes a system/qa-flag alert when a policy violation or malfunction is detected.

Checks performed (rule-based, no LLM):

Content checks (every message):

  • Prompt-injection patterns in user messages
  • Agent error bleed-through (script error:, rhai error:, (no output), …)
  • Raw JSON/data bleed (agent returned internal message structure)
  • Possible PII (email-like patterns) in any direction

Temporal checks (on every heartbeat tick):

  • No-response tracking: if a user message is sent to an agent and no reply arrives within AGENT_RESPONSE_TIMEOUT_MS (30 s), a no-response flag is raised — exactly what triggered the math-agent 45 s timeout.

The agent does NOT block messages; it only annotates.

Structs§

QAAgent