All Products
Search
Document Center

AI Guardrails:Library management

Last Updated:Jul 10, 2026

You can manage and configure keyword libraries in the Guardrails console to customize your content moderation policies.

Keyword library management

Create keyword libraries to flag risky content or exclude specific terms from moderation checks, and then attach these libraries to a service rule.

  1. Log on to the Guardrails console.

  2. In the left navigation pane, choose Protection Configuration > Vocabulary Management.

    1. On the Library Management tab, click Create Library.

    2. In the Create Library panel, enter the library details.

      1. You can combine multiple keywords into a single logical expression. For example, WeChat&part-time matches only when both terms appear. In an expression, the & operator must precede the ~ operator. The & operator means AND, and the ~ operator means NOT (exclude).

      2. Enter one keyword per line. Each keyword can be up to 50 characters long.

      3. You can add up to 1,000 lines at a time. To add more than 1,000 lines in one batch, use Import From File.

      4. You can create up to 20 libraries and add a total of 100,000 keywords per account.

    3. Click OK.

      If library creation fails, a detailed error message appears. Follow the instructions in the message to try again.

Keyword library configuration

  1. In the left navigation pane, choose Protection Configuration > Configuration. Find the target service and click Set Thesaurus in the Operation column.

  2. Select the Blacklist for the Library tab or Library Whitelist tab based on your needs.

    • Blacklist for the Library: Click Add a Library to add a new blacklist library. To remove a library, click Remove from Blacklist.

    • Keyword blacklist

      If text matches a keyword in a keyword blacklist, the Text Moderation API returns C_customized (indicating a match in a custom library) in the labels parameter of the API response. Use this to detect content that violates your specific policies.

      For example, you add the keywords Micro-lending and in-person service to a keyword blacklist. If you submit the text "Our campus offers small loans, safe, fast, convenient, no collateral, borrow anytime, same-day funding, in-person service" for moderation, the system detects a match for both Micro-lending and in-person service. Thelabels parameter in the API response will include C_customized, along with any labels from built-in detection rules.

    • Library Whitelist: Click Add a Library to add a new whitelist library. To remove a library, click Remove from Whitelist.

    • Keyword whitelist

      If text matches a keyword in a keyword whitelist, the system ignores that keyword during moderation. Use this to prevent false positives on terms that are safe in your business context.

      For example, you add the keywords convenient and fast to a keyword whitelist. If you submit the text "Our campus offers small loans, safe, fast, convenient, no collateral, borrow anytime, same-day funding, in-person service" for moderation, the system ignores convenient and fast. It then analyzes only the remaining text: "Our campus offers small loans, safe, no collateral, borrow anytime, same-day funding, in-person service".

  3. After you add or remove a library on the Blacklist for the Library or Library Whitelist tab, click OK to save the service rule settings.