DeepFellow DOCS

Blocks

The settings of every built-in Threat Intelligence block and the fields it reports.

A workflow step names a block in uses and passes the block's settings in config. A block without settings needs no config. Every block that gives a verdict reports safe and score in its entry in steps. The sections below list the other fields each block reports.

Blocks That Need Nothing Else

keyword-classifier

Reports the text as unsafe when it contains any of the keywords. The match ignores case and finds a keyword inside a longer word too. A keyword with spaces, such as ignore instructions, matches as a phrase.

  - id: keyword-check
    uses: keyword-classifier
    config:
      keywords:
        - jailbreak
        - ignore instructions
SettingDefaultDescription
keywordsrequiredKeywords to look for.

Reports: matched, the first keyword from keywords that the text contains.

Behind a preprocessor step, the text is lemmatized, so write the keywords in their base form.

dictionary-filter

Reports the text as unsafe when one of its words is in a dictionary file. Unlike keyword-classifier, it matches whole words only, and it reports the category of each word it finds.

  - id: dictionary-check
    uses: dictionary-filter
    preload: true
    config:
      path: dictionaries/example-threats.txt
SettingDefaultDescription
pathrequiredDictionary file, or a list of files that the block merges into one.
false_positive_rate0.001Memory and speed trade-off of the internal filter. It doesn't change which words match.

Reports: matched, the words it found, and matched_categories, their categories.

The image includes dictionaries/example-threats.txt. To use your own dictionary, mount it into the container and give its absolute path in path.

A dictionary is a UTF-8 text file. A line with a colon starts a category: the name goes before the colon, and comma-separated words follow it. The next lines continue the same category until a blank line. Lines that start with # are comments.

# Comments and blank lines are ignored.
violence: weapon, knife, grenade

terrorism: bomb, explosive
ricin

# No category: these words match but report no category.
jailbreak

unicode-normalizer

Rewrites the text so that hidden characters and look-alike letters don't hide a keyword from the steps after it. It reports no verdict of its own. All settings default to true.

SettingDescription
nfkcApplies Unicode NFKC normalization, which turns stylized letters into plain ones.
remove_invisibleRemoves characters that render as nothing, such as a zero-width space.
remove_bidiRemoves the controls that change the direction of text.
remove_joinersRemoves zero-width joiners between letters of scripts that never join, such as Latin and Cyrillic, where they only hide a word.
fold_homoglyphsReplaces letters from other alphabets that look like Latin ones, such as Cyrillic а.

preprocessor

Lemmatizes the text, so the steps after it match bombs and bombing with the keyword bomb. It reports no verdict of its own.

SettingDefaultDescription
modelen_core_web_smspaCy model to use.

The image includes en_core_web_sm only. Threat Intelligence downloads any other spaCy model on its first use, which requires internet access.

pii-detector

Reports the text as unsafe when it contains personal data, such as a name, an organization, or a place.

SettingDefaultDescription
modelen_core_web_smspaCy model to use.
entity_types[PERSON, ORG, GPE]spaCy entity types that count as personal data.

Reports: matched, the personal data it found.

en_core_web_sm recognizes names in English text only, and it doesn't detect numbers, such as an ID or a card number.

text-anonymizer

Replaces personal data with numbered placeholders, such as [PERSON_1] and [ORG_1], before the steps after it see the text. It reports no verdict of its own. Use it in front of a guard model that must not receive personal data.

SettingDefaultDescription
modelen_core_web_smspaCy model to use.
entity_types[PERSON, ORG, GPE]spaCy entity types to replace.

Its entry in steps carries no other fields. Threat Intelligence doesn't return what it replaced.

verdict-merger

Combines the verdicts of several steps into one. The merged verdict is unsafe when any of the steps is unsafe. It takes no settings. Each dependency gets a name with as, and the merged verdict uses these names in triggered_by.

  - id: keyword-check
    uses: keyword-classifier
    halt_on_unsafe: false
    config:
      keywords: [jailbreak]

  - id: guard-check
    uses: llama-guard
    halt_on_unsafe: false
    config:
      endpoint: http://infra:8086
      endpoint_env_name: DF_INFRA_URL
      api_key_env_name: DF_INFRA_API_KEY

  - id: verdict
    uses: verdict-merger
    dependencies:
      - step: keyword-check
        as: keywords
      - step: guard-check
        as: guard
    config: {}

Reports: matched, the matches of every step, and triggered_by, the names of the unsafe steps.

Set halt_on_unsafe: false on the merged steps. Otherwise the first unsafe step stops the workflow before the merge.

Blocks That Call a Guard Model

These blocks send the text to a guard model, such as one on DeepFellow Infra. llama-guard, qwen3guard, and llm-judge call an OpenAI-compatible API, and granite-guardian calls the Ollama API. They share these settings:

SettingDefaultDescription
endpointrequiredAddress of the model's server. The example workflows use http://infra:8086, DeepFellow Infra.
endpoint_env_namenoneEnvironment variable that holds the address. When the variable is set, it replaces endpoint. The example workflows use DF_INFRA_URL.
api_key_env_namenoneEnvironment variable that holds the API key. The example workflows use DF_INFRA_API_KEY.
modeldepends on the blockModel to call.
timeout_seconds30Time limit for the call to the model. The step's own timeout_seconds is a separate limit.
max_tokensdepends on the blockMaximum length of the model's answer.
max_history_messages0Number of earlier messages from conversation_history that the block sends with the text. granite-guardian doesn't have this setting.
max_input_charsdepends on the blockMaximum number of characters that the block sends to the model: the text, the history, and, for llm-judge, the policy.

max_history_messages counts from the end of conversation_history: 6 means the last six messages, such as three conversation turns. Only a step without dependencies gets the history. On a step with dependencies, the setting has no effect.

With history, the model judges the conversation instead of the text alone. Before you rely on the workflow, measure it on your own traffic.

A model judges only the part of a text that fits in its context. When the text is longer than max_input_chars, the step doesn't call the model, and the request fails with 413 (input_too_large), whatever the step's on_failure is. When the model provider rejects the text because it doesn't fit in the context, the request fails with the same 413. The defaults fit the context that DeepFellow Infra gives each model. If you serve a model with a larger context, raise the limit.

max_input_chars counts characters, not tokens. Text such as base64, hex, digits, or emoji takes many tokens per character. It fills the context while it is still under the limit. vLLM rejects this text, and the request fails with 413. Ollama cuts off the part that doesn't fit and returns no error, so the model judges only the rest.

llama-guard

Classifies the text with Llama Guard 3 against its 14 safety categories.

SettingDefault
modelllama-guard3
max_tokens64
max_input_chars8000

Reports: category, the Llama Guard category code, such as S9, or several codes, such as S1,S9.

On DeepFellow Infra, llama-guard judges the user message even when its step examines the model response. To check responses, use qwen3guard or granite-guardian.

qwen3guard

Classifies the text with Qwen3Guard, in 119 languages. The model sorts the text into three levels: safe, controversial, and unsafe.

SettingDefaultDescription
modelQwen/Qwen3Guard-Gen-4B
max_tokens128
max_input_chars32000
treat_controversial_as_unsafefalseWhen true, the controversial level also makes the step unsafe.
blocked_categoriesallCategories that make the step unsafe. The step reports the other categories and passes.

The categories are Violent, Non-violent Illegal Acts, Sexual Content or Sexual Acts, PII, Suicide & Self-Harm, Unethical Acts, Politically Sensitive Topics, Copyright Violation, and Jailbreak. Jailbreak applies to the user message only.

Reports: severity, the level, category and matched_categories, the categories found, and, for a model response, refusal, whether the response refuses the request.

When a step examines a model response and refusal is missing from its entry, the model judged the user message instead.

granite-guardian

Checks one risk with IBM Granite Guardian. The step names the risk in risk_name.

SettingDefaultDescription
risk_namerequiredRisk to check: a built-in name or your own criterion as a sentence.
modelibm/granite3.3-guardian:8b-q4_K_M
max_tokens4096
max_input_chars16000
num_ctx8192Context size of the model, in tokens. The text and the answer share it, so max_tokens limits only the answer within it.
thinkfalseWhen true, the model reasons before its answer. It takes longer.

The built-in risks are harm, social_bias, jailbreak, violence, profanity, sexual_content, unethical_behavior, groundedness, answer_relevance, and context_relevance. As your own criterion, write a sentence, such as The message must not mention competitor products.

groundedness checks whether a model response sticks to the material it was based on. The step examines the response (subject: assistant_message), and the request carries the material in context.

Reports: category, the risk name, when the step is unsafe.

llm-judge

Judges the text against a policy that you write in the step. Use it for rules that no guard model knows, such as the topics an assistant answers.

  - id: topic-check
    uses: llm-judge
    config:
      endpoint: http://infra:8086
      endpoint_env_name: DF_INFRA_URL
      api_key_env_name: DF_INFRA_API_KEY
      model: YOUR_MODEL
      category: off-topic
      policy:
        instructions: |
          Answer only questions about the DeepFellow product and general software engineering.
          Do not answer questions about politics, elections, or religion.
SettingDefaultDescription
modelrequiredModel that judges the text.
policy.instructionsrequiredThe rule to judge against.
categorypolicy-violationName the step reports when the text breaks the rule.
max_tokens512Maximum length of the model's answer. A reasoning model, such as qwen3, spends part of it on reasoning, so raise it for one.
max_input_chars8000

Reports: category, when the step is unsafe.

The block tells the model how to answer, so describe only the rule in instructions, not the answer format. Test the model on examples of your own before you rely on it.

Blocks That Call an External Service

nemo-guardrail

Runs one configuration of an NVIDIA NeMo Guardrails server. The configuration lives on that server, and the step names it in config_id. Threat Intelligence doesn't include a NeMo Guardrails server.

SettingDefaultDescription
endpointrequiredAddress of the NeMo Guardrails server.
endpoint_env_namenoneEnvironment variable that holds the address, such as NEMO_ENDPOINT. When the variable is set, it replaces endpoint.
config_idrequiredNeMo Guardrails configuration to run.
api_key_env_namenoneEnvironment variable that holds the server's API key.
modelnoneLeave it unset. The configuration on the NeMo Guardrails server names its own model.
categorynoneName the step reports when the text is unsafe. Without it, the step reports the name of the rail.
timeout_seconds30Time limit for the call.
max_input_chars8000Maximum number of characters that the block sends to the server. See Blocks That Call a Guard Model.
allow_modifiedfalseWhen true, text that a rail changed, such as by masking personal data, counts as safe, and the steps after it get the changed text. When false, changed text counts as unsafe.

Reports: category, when the step is unsafe.

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.

On this page