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.
java-ai-in-action/framework-compareSpring AI vs LangChain4j vs SAA 三框架同台对比(配套篇2)
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. 面向存量企
PyModel/jev-judge-mcpTyped judgment tools for MCP agents. TypeSafe's Jev model as verify, screen, find, classify, rerank, decide, compare, extract, review, gate, and score: the model judges, policy decides auto, review, o
sainitish1609/mcp-guard🛡️ Ultra-fast local security firewall, secret sanitizer, and context token compressor for Claude Code, Cursor, and MCP AI agents.
oscarbol09/jvm-mcpNative Java Model Context Protocol (MCP) server for live Spring Boot inspection via Attach API.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.