Skip to main content
CID222 Docs

Detection engines at a glance

The seven engines CID222 runs over prompts and replies, what each one finds, which service it lives in, and where to read the detail.

  • Version: 0.4
  • Role: admin_user, normal_user, viewer

Detection is CID222's own: models the product ships and a decision maker the product owns. Each model runs in its own container and is called over HTTP, so one can be scaled or replaced without touching the gateway. This page is the map; the security guide is the detail.

The problem

One detector is either too loud or too quiet. A regular expression misses a name it has never seen and fires on a number that merely looks like an identifier. A classifier cannot prove that a card number is real and cannot explain itself. And an attacker who knows one detector exists encodes around it. What is needed is several detectors reading one decoded text, a way to confirm or demote what each of them found, and a single rule for turning disagreement into one action.

How CID222 does it

EngineWhat it findsWhere it runsServiceDetail
Language detectionThe language of the text, so every other detector gets a hint instead of guessingAhead of detectionlanguage-detectorDetection pipeline
PII — patternsStructured identifiers and secrets: e-mail, phone, card, national identity numbers, bank accounts, API keys, private keysRequest and responseIn the gateway, from the filter rulesPII detection
PII — neuralEntities no pattern can catch: person names, organisations, locations, addressesRequest and responseml-detectorPII detection
ToxicityThirteen harm labels including violence, hate, self-harm, sexual content, weapons and cyber crimeRequest and responsehap-guard-v2Detection pipeline
Attack guard — modelsPrompt injection and jailbreak, scored independently so both can fire on one promptRequestattack-guardDetection pipeline
Attack guard — scanSQL injection and cross-site scripting, deterministically, with libinjectionRequestattack-guardDetection pipeline
Code safetySecrets and destructive commands by rule, plus one finding per reported software weakness from the auditorRequest, and coding-assistant tool callsThe auditor, on its own hostCode Safety
HallucinationWhether a reply is supported by the context it was supposed to useResponse, in the backgroundhallucination-guardDetection pipeline

Everything in the request column runs in parallel over the same normalised text, and nothing is sampled: a detector that runs, runs on every request. What can remove a detector is your own policy. Before the fan-out the gateway resolves a detector plan per tenant, and a detector family whose every filter resolves to allow for that tenant is not called at all — switching a family off removes the network call rather than discarding its answer. Code safety is the one family that is off unless it is enabled.

Before the detectors: normalisation

Evasion decoders run first — ROT13, base64, leetspeak, Unicode homoglyphs and case — so a detector reads what the text means rather than how it was disguised. The detection response reports which decoders fired.

After the detectors: one action

A validation layer confirms or demotes each finding — a checksum on a card or a national identity number, context rules on the rest — and the decision maker folds what survives into a single action. The strongest wins: reject beats mask, mask beats flag.

Beyond text

Images and documents are not a separate detection stack. Text is extracted first — optical character recognition for images, a parser for PDF and DOCX — and then the same engines run over the result, with a redaction service producing a cleaned copy of the file where the policy calls for one.

Beyond a single message

Repeated jailbreak and injection detections against one user fill a sliding window. Crossing it opens one review of that user by the local risk-analyst model, which reads the detection history rather than re-reading traffic. This is not a per-message job and adds nothing to the request path.

Limits and known gaps

  • Hallucination detection is background-only, and its scores are relative. It runs after the reply has been delivered, so it never blocks one. Its two checkpoints were trained for token-level classification and are loaded for sequence-level classification, carried over unchanged so that scores stay comparable with archived analyses. Treat the score as a ranking signal, not as a probability.
  • Hallucination routing ignores the detected language. The service routes by the language the caller declares, and the gateway currently always declares English, so Turkish replies are scored by the English model.
  • Code safety is off unless it is configured. The auditor is a separate service that is disabled by default (CODE_SAFETY_SERVICE_ENABLED) and licensed with Enterprise. A degraded or failed audit means unknown, never clean.
  • Language coverage is not uniform. Toxicity and attack scoring cover a fixed set of languages; the PII model is multilingual on one set of weights; the language detector recognises far more languages than the detectors behind it are trained for.
  • Every number is conditional. Latency and accuracy depend on text length, language, which detector fired and how the filter is configured. The performance and accuracy reference states the conditions; a bare percentage anywhere else is unverified.

Last updated on

On this page

Download PDF