[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["# Custom infoType detectors\n\nSensitive Data Protection contains many built-in [infoType\ndetectors](/sensitive-data-protection/docs/concepts-infotypes), but you can also create your own. You can\ncustomize detection behavior by defining your own *custom infoType detectors*,\nso that Sensitive Data Protection will inspect or de-identify sensitive data that\nmatches patterns that you specify. The following are the types of custom\ninfoType detectors:\n\n- *Regular custom dictionary detectors* are simple word and phrase lists that Sensitive Data Protection matches on. Use regular custom dictionary detectors when you have at most several hundred thousand words.\n- *Large custom dictionary detectors* are generated by Sensitive Data Protection using large lists of words or phrases stored in either Cloud Storage or BigQuery. Use large custom dictionary detectors when you have a large list of words or phrases---up to tens of millions.\n- *Regular expression (regex) detectors* enable Sensitive Data Protection to detect matches based on a regular expression pattern.\n- *Surrogate infoType detectors* detect output from Sensitive Data Protection de-identification transformation [`CryptoReplaceFfxFpeConfig`](/sensitive-data-protection/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). This custom infoType detector is only used with the [`content:reidentify`](/sensitive-data-protection/docs/reference/rest/v2/projects.content/reidentify) method to reverse de-identification using format-preserving encryption (FPE) in FFX mode. For this reason, surrogates are not extensively described in these topics. For more information about how and when to use surrogate custom infoType detectors, see [Pseudonymization](/sensitive-data-protection/docs/pseudonymization).\n\nIn addition, Sensitive Data Protection includes the concept of *inspection rules*,\nwhich enable you to fine-tune scan results using the following:\n\n- *Exclusion rules* enable you to exclude false or unwanted findings by adding rules to a built-in or custom infoType detector.\n- *Hotword rules* enable you to increase the quantity or accuracy of findings returned by adding rules to a built-in or custom infoType detector.\n\nTo learn more about custom infoType detectors, see the [InfoTypes and infoType\ndetectors](/sensitive-data-protection/docs/concepts-infotypes#custom) concept page. For several examples that\nyou can use or alter as you see fit, see [Examples of custom infoType\ndetectors](/sensitive-data-protection/docs/examples-custom-infotypes). The rest of this topic describes how to\nuse Sensitive Data Protection to create your own custom infoType detectors.\n\nWhere to use custom infoType detectors\n--------------------------------------\n\nCustom infoType detectors are defined in the\n[`CustomInfoType`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#CustomInfoType)\nobject. You specify a `CustomInfoType` in the\n[`InspectConfig`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig)\nobject when configuring the following:\n\n- Inspection using [`projects.content.inspect`](/sensitive-data-protection/docs/reference/rest/v2/projects.content/inspect).\n- Inspection jobs inside [`InspectJobConfig`](/sensitive-data-protection/docs/reference/rest/v2/InspectJobConfig).\n- Inspection templates inside [`InspectTemplate`](/sensitive-data-protection/docs/reference/rest/v2/organizations.inspectTemplates#InspectTemplate).\n- De-identification using [`projects.content.deidentify`](/sensitive-data-protection/docs/reference/rest/v2/projects.content/deidentify).\n- De-identification templates inside [`DeidentifyTemplate`](/sensitive-data-protection/docs/reference/rest/v2/projects.deidentifyTemplates#resource-deidentifytemplate).\n- Re-identification of content that has been de-identified with FPE in FFX mode using [`projects.content.reidentify`](/sensitive-data-protection/docs/reference/rest/v2/projects.content/reidentify). This scenario is specific to surrogate custom infoType detectors.\n\nAPI overview\n------------\n\nThe\n[`CustomInfoType`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#CustomInfoType)\nobject allows you to create a custom infoType detector for new content or to\nfine-tune the results returned by pre-defined infoType detectors.\n\nThe `CustomInfoType` object is comprised of the following fields, which are set\nas described:\n\n- `\"infotype\"`: The name of the custom infoType detector, contained in an [`InfoType`](/sensitive-data-protection/docs/reference/rest/v2/InfoType) object.\n- `\"likelihood\"`: The default [`Likelihood`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#Likelihood) value to return for this custom infoType detector. You can specify alternate `Likelihood` values in `\"detectionRules\"` that will supersede this base `Likelihood` if the finding meets the criteria specified by the rule. If you don't include the `\"likelihood\"` field, the custom infoType detector defaults to `VERY_LIKELY`. For more information about likelihood, see the [Likelihood](/sensitive-data-protection/docs/likelihood) concept page.\n- `\"detectionRules\"`: A set of [`DetectionRule`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#DetectionRule) objects to additionally apply to all findings of this custom infoType detector. This is where you specify hotword rules, as [`HotwordRule`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#HotwordRule) objects. Rules are applied in the order in which they are specified. This field does not apply to `SurrogateType` objects.\n- `\"sensitivityScore\"`: The\n [`SensitivityScore`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#CustomInfoType.FIELDS.sensitivity_score)\n value to return for this custom infoType detector. If you don't include the\n `\"sensitivityScore\"` field, the custom infoType detector defaults to\n `VERY_LIKELY`.\n\n\n Sensitivity scores are used in [data profiles](/sensitive-data-protection/docs/data-profiles). When\n profiling your data, Sensitive Data Protection uses the sensitivity scores of the infoTypes to\n [calculate the sensitivity level](/sensitive-data-protection/docs/sensitivity-risk-calculation).\n\n\n- One of the following fields, depending on the kind of custom infoType\n detector you're creating:\n\n - `\"dictionary\"`: A [`Dictionary`](/sensitive-data-protection/docs/reference/rest/v2/Dictionary) object, which contains a list of words or phrases to search for.\n - `\"regex\"`: A [`Regex`](/sensitive-data-protection/docs/reference/rest/v2/Regex) object, which contains a single pattern defining the regular expression.\n - `\"surrogateType\"`: A [`SurrogateType`](/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#SurrogateType) object, if present, indicates that the custom infoType detector is a surrogate. For more information about how to use surrogate custom infoType detectors, see [Pseudonymization](/sensitive-data-protection/docs/pseudonymization).\n - `\"storedType\"`: A reference to an existing [`StoredInfoType`](/sensitive-data-protection/docs/reference/rest/v2/projects.locations.storedInfoTypes) object. This field is required when creating a large custom dictionary detector. Although you can create regular dictionary detectors or regular expression detectors by defining this field, it's simpler to create those by defining the `dictionary` field or `regex` field respectively.\n\nNext steps\n----------\n\nLearn more about creating custom infoTypes from the following topics:\n\n- [Creating a regular custom dictionary detector](/sensitive-data-protection/docs/creating-custom-infotypes-dictionary): Learn how to create a custom infoType detector to match findings on a list of words and phrases.\n- [Creating a large custom dictionary detector](/sensitive-data-protection/docs/creating-stored-infotypes): Learn how to match findings on a very large list of words and phrases. Stored custom infoType detectors can match on up to tens of millions of words.\n- [Creating a custom regex detector](/sensitive-data-protection/docs/creating-custom-infotypes-regex): Learn how to create a custom infoType detector to match findings on a regular expression.\n- [Modifying infoType detectors to refine scan results](/sensitive-data-protection/docs/creating-custom-infotypes-rules): Learn how to create modifiers for both built-in and custom infoType detectors that can fine-tune scan results.\n- [Customizing match likelihood](/sensitive-data-protection/docs/creating-custom-infotypes-likelihood): Learn how to use detection rules and hotwords to customize the likelihood values that are assigned to custom detector matches.\n- [Examples of custom infoType detectors](/sensitive-data-protection/docs/examples-custom-infotypes): Several example JSON custom infoType detector definitions that you can use or alter as you see fit."]]