Privacy guardrails for Spring AI: request-scoped PII tokenization and least-privilege disclosure across model/tool calls, with Presidio and JVM-local OpenNLP.
Keep detected PII out of the model. Reveal only what each trusted tool needs. Protect every tool result before it leaves the tool boundary.
Spring AI Privacy Guardrails combines a Spring-independent privacy core with a production-oriented Spring AI integration for chat, RAG, memory, tool calling, and output boundaries. Pluggable analyzers find sensitive spans; this project turns that evidence into request-scoped enforcement.
A detector answers what text is sensitive. A Spring AI application still has to decide where the original value may travel.
This project provides the missing execution boundary:
Most applications declare one primary starter:
Use case Declare --- --- General PII with Presidio (recommended) spring-ai-privacy-guardrails-presidio-spring-boot-starter Regex rules or custom analyzers only spring-ai-privacy-guardrails-spring-boot-starter Existing compatible OpenNLP models in a JVM-only deployment spring-ai-privacy-guardrails-opennlp-spring-boot-starter
The Presidio and OpenNLP starters already include the base starter, core, Spring AI integration, and Spring Boot baseline. Do not declare the base starter alongside either provider starter. The base starter intentionally includes no Presidio or OpenNLP provider.
Adding only a provider starter dependency does not activate the privacy infrastructure or its Presidio or OpenNLP analyzer. Explicitly enable the global privacy switch and the analyzer you intend to use in application.yml, then configure it as shown in Configuration.
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/ultramancode--spring-ai-privacy-guardrails.html)
Security & governance guardrails for MCP agents in Java — audit trail, agent-to-tool authorization, prompt-injection detection and rate limiting as a zero-config Spring Boot starter.
HanHan666666/patchbridge-agentLightweight browser-side AI agent framework for legacy enterprise web apps—Java 8, Spring Boot 2, TypeScript, MCP/WebMCP, OpenAI-compatible LLMs, tool calling, streaming, audit, and persistence. 面向存量企
sainitish1609/mcp-guard🛡️ Ultra-fast local security firewall, secret sanitizer, and context token compressor for Claude Code, Cursor, and MCP AI agents.
tainguyen07/agent-workflow-mcpMulti-agent workflow orchestrator with MCP tool servers: planner/executor agents, tool-use loop, MCP client/server, tracing and durable runs.
kpshinnik/docs_maskedЛокальное обезличивание документов перед отправкой в LLM и обратная подстановка после ответа. Скилл, MCP-сервер и CLI.
menot-you/n-memoryMemory your agent can trust — every answer carries its source; when it doesn't know, it says so. Hermetic, local, MCP.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.