[RECIPE PROPOSAL] Model Armor SDP de-identification and tool-result screening

Author: kaligautierCreated Sep 27, 2026Updated Sep 27, 2026
Labelscontribute

1. What is the intent/purpose of your new recipe? In what way will it help the ADK community?

I find the current Model Armor implementation in the safety-plugins recipe too limited as a reference for applications that need to remove sensitive data while preserving useful content. It focuses on blocking filter matches, but does not use Sensitive Data Protection (SDP) de-identification results to replace sensitive text and continue the interaction. I also think a clearer separation of responsibilities would make the integration easier to understand, test and reuse.

I propose a focused recipe at contrib/python/model-armor-sdp-redaction/ demonstrating:

  • SDP de-identification for user messages, model responses and JSON tool results. For example, Contact me at [email protected] becomes Contact me at *** when that replacement is configured in the SDP template.
  • Applying the transformed user text before it is forwarded to the model or saved in session history, and forwarding transformed tool results to the next model call.
  • Explicit allow, redact and block decisions. An SDP-only match with a valid replacement can continue; other safety matches, unusable replacements, API failures and incomplete verdicts block the content.
  • Clear separation between regional asynchronous API transport, response validation, policy decisions, ADK callbacks and metadata-only logging.

The goal is to provide an educational reference for custom ADK safety callbacks alongside the first-party ModelArmorPlugin, with clear behavior and protection boundaries. It would be a separate community recipe, preserving the existing recipe under core/.

2. What language is your recipe implemented in?

Python 3.11 or later, using ADK and uv.

3. Will this be a deployable recipe, either by having a Dockerfile, or by utilizing Vertex AI?

The initial scope is a locally runnable recipe that can call Gemini through Vertex AI or the Gemini Developer API. It would not initially include a Dockerfile or one-command agent deployment. Calling Vertex AI for model inference is separate from deploying the agent itself.

4. What GCP services or third-party APIs are required?

  • Google Cloud Model Armor with a regional template.
  • Sensitive Data Protection inspect and de-identify templates connected to the Model Armor template.
  • Gemini through Vertex AI or the Gemini Developer API.
  • Google Cloud credentials and the IAM permissions required to use those services.

No third-party business API is required.

5. Who will own and maintain this?

Proposed owner and maintainer: @kaligautier, as an individual contributor.

6. Additional information

This proposal follows the maintainer feedback on https://github.com/google/adk-recipes/pull/2652. That PR originally extended the existing safety-plugins recipe. I will wait for approval of this proposal before submitting the contribution as a separate recipe under contrib/.

The contribution would include setup documentation, focused unit tests, ADK Runner tests that inspect model requests and stored events, and an opt-in live verification script. Full live Cloud validation remains pending, as documented in the existing PR; local tests are not evidence of complete live validation.

Automatic screening would cover buffered text and JSON tool results. Tool arguments, images, audio, existing session history and arbitrary state writes would remain outside its scope. The recipe would document these limits explicitly.