> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Word Filtering

> Learn how to implement word filtering guardrails in TrueFoundry AI Gateway to detect and filter specific words and phrases in content.

Filters specific words and phrases.

## Options:

**word\_list**: An array of words to filter\
**case\_sensitive**: Whether matching is case sensitive (default false) **whole\_words\_only**: Match whole words only (default true) **replacement**: Text to replace filtered words with (default "\[FILTERED]")

## Example Config

<CodeGroup>
  ```yaml YAML lines theme={"dark"}
  name: word-filter-guardrails
  type: word-filter-guardrails-config
  rules:
    - id: specific-word-filter
      when:
        models:
          - openai-main/gpt-3-5-turbo
      input_guardrails:
        - type: word_filter
          action: transform
          options:
            word_list:
              - "unwantedword"
              - "inappropriatephrase"
            case_sensitive: false
            whole_words_only: true
            replacement: "[REMOVED]"
      output_guardrails:
        - type: word_filter
          action: transform
          options:
            word_list:
              - "unwantedword"
              - "inappropriatephrase"
            case_sensitive: false
            whole_words_only: true
            replacement: "[REMOVED]"
  guardrails_service_url: https://word-filter-service.company.com
  ```
</CodeGroup>
