Troubleshooting¶
English | 한국어
Start with the observed symptom. Reproduce it with synthetic input and the same client policy. Use the Inspector to compare with a known local configuration. Keep raw values and opaque-token mappings out of production logs.
Originals Remain in Model Input¶
- Check whether the selected analyzer detects the value. For local rules, check
rules.enabled,presets,include,excludeand the supported formats. Also check entity allowlists and score thresholds. If detection is missing, correct the rule selection or choose a suitable analyzer. - Confirm the call uses the client returned by
guardrailsChatClientFactory.builder(chatModel, policy)withprivacy()selected. AnotherChatClientor a directChatModelcall bypasses that policy. - Repeat the request with a model-input probe. The detected original should be absent from the prompt received by the model. The generated answer alone is not proof.
Memory and RAG stores can still hold originals. Protection applies to the copy sent to the model. See stored data for application responsibilities.
Registered Rules Do Not Run¶
- With Boot's automatic rule configuration, enable
spring.ai.privacy.rules.enabledand select registered IDs throughpresetsorinclude. Registering aPiiRuleorPiiRulePresetbean does not activate it.COMMONis not implicit, and the analysis language does not selectKR. - Check
exclude, which is applied after presets and included IDs. If you declare aRuleBasedPiiAnalyzerbean yourself, its catalog and selection replace automatic selection. Configure that bean instead of expecting the properties to modify it. - Inspect the analyzer's
ruleIds()andpresetNames(), then retry a synthetic matching value. See rule selection.addRuleandaddRulesregister rules, while the analyzer builder'spresets,includeandexcludeselect them.
Startup Fails After Rule Configuration¶
- Read the configuration error and check case-sensitive preset names and rule IDs.
Unknown IDs, duplicate definitions and an empty active selection are errors.
excludealso requires registered IDs. Do not define a custom rule or preset with a built-in ID or name. - If only
rules.enabled=trueis set, select at least one rule or preset. Check whether exclusions removed every selected rule. Correct the specific invalid selection instead of disabling protection. - Restart the app and verify
ruleIds()plus a matching test input. Check property spelling with configuration diagnostics.
A Tool Receives a Token Instead of an Original¶
- Confirm that original disclosure is intended. Tokens are the default for protected tools.
- Match the policy's tool name to the final
ToolDefinition.name(), including case and an MCP provider's prefix. Confirm thatToolDisclosurePolicyallows the token's final entity type. - Repeat the synthetic tool call and inspect the tool input and its protected result. Only the permitted types should be restored. See disclosure rules.
A Tool Is Missing or Execution Is Denied¶
- If the tool is absent from the model's list, check the authorization decision at the definition phase. Ordinary filtering does not throw a denial exception.
- For an execution denial, inspect the exception's
codeandphase, the registered tool name and the authentication available when the request begins. Correct the relevant permission or authentication propagation. See denial handling and asynchronous authentication. - Compare authorized and unauthorized requests. The model should see only permitted tools, and unauthorized tools should never run. The Security demo makes both cases reproducible.
Streaming Arrives Only at the End¶
- Check privacy output protection and
finalOutputInspectionEnabled. These features buffer the complete response so checks can find content split across chunks. This delay is expected. - If immediate delivery is required, review which output checks your application needs before changing the policy. Disabling them also removes those checks. Configure response limits and timeouts when retaining buffered output protection.
- Retry with the chosen policy. Check both the delivery timing and the content that is released. See output protection and inspection limits.
An Inspector Is Registered but Does Not Run¶
- Check that the client policy selects
inspection()and that the request uses that client. Final output inspection must be enabled separately. Confirm the selected direction has anInspectionService, either from inspector beans or supplied explicitly. - Check whether an earlier privacy or authorization failure prevented inspection, or an inspector's prerequisites failed. Inspect the reported phase and failure code. See results and failures.
- Send inputs your inspector is configured to block and allow, and check the inspection reports.
ONNX Initialization or Execution Fails¶
- For
CONFIGURATION, check the local model and matching tokenizer files, external weight files if needed, input names/types/shapes, and output class settings. Resolve paths against the application's working directory. See model requirements. - For
MODEL_ERROR, check the output shape and numeric values against the configuredlogitCountand activation. - Run the pinned test-model setup to compare with a known model.