protect-adk-sensitive-data
Skill9 starsChanged 17 days agoMITView on GitHub
Inspect, implement or review sensitive-data boundaries in Python Google ADK agents using Sensitive Data Protection (SDP), Model Armor, strict tool contracts and guarded response release. Use for PII or credential exposure in prompts, tool calls, session history, logs or streamed answers, for prompt content leaking through trace, completion-upload or analytics exporters, for where a screen runs relative to the agent and tool dispatch, and for planning these controls and their cloud prerequisites. Do not activate for generic ADK setup, credential custody or OAuth tokens kept out of events (adk-tool-auth-and-secrets), whole-agent threat models (adk-agent-security), telemetry pipelines and alerts (adk-agent-observability), governance or privacy-impact papers (adk-governance-pack), Cloud Armor WAF configuration, unrelated infrastructure cleanup, or non-agent document redaction.
- Reads credentials
In this repository25 other files it gives its agents.
- adk-agent-evaluationSkill
- adk-agent-instructionsSkill
- adk-agent-interoperabilitySkill
- adk-agent-observabilitySkill
- adk-agent-securitySkill
- adk-discoverySkill
- adk-engineerSkill
- adk-fastapi-backendSkill
- adk-frontend-integrationSkill
- adk-governance-packSkill
- adk-memory-architectureSkill
- adk-model-and-output-contractsSkill
- adk-operational-guardrailsSkill
- adk-portability-planningSkill
- adk-presenterSkill
- adk-release-engineeringSkill
- adk-sql-agent-engineeringSkill
- adk-system-designerSkill
- adk-tool-auth-and-secretsSkill
- adk-tool-interface-designSkill
- adk-workflow-designSkill
- deploy-adk-on-google-cloudSkill
- optimise-adk-on-google-cloudSkill
- practice-profileSkill
- safe-api-tool-callsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Read the target's instructions, working-tree diff, dependency declarations, lockfiles and test configuration.
- Distinctive: line 48
Read compatibility.md before using ADK-specific code.
- Distinctive: line 52
Never silently upgrade or downgrade.
- Very specific: line 56
Check configuration key presence without printing .env, tokens or ADC data.
- Distinctive: line 76
Write down each boundary's accepted shape, trusted fields, policy and failure behaviour.
- Distinctive: line 82
Treat a forbidden finding as rejection.
- Distinctive: line 98
Add focused regression tests at the changed boundary.
- Distinctive: line 121
Read validation.md for the applicable regression matrix.
- Very specific: line 127
Run python -B -m unittest discover -s "$SKILL_DIR/tests" -v to check the bundled resources when adapting them.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Protect ADK sensitive data
Deliver the smallest change that keeps forbidden credentials and disallowed PII out of model requests, persisted events, tool side effects and public responses. State the actual detector coverage; screening does not establish authorisation, anonymity or regulatory compliance. This skill is an independent community project, not affiliated with or endorsed by Google.
Inspect and choose
- Read the target's instructions, working-tree diff, dependency declarations, lockfiles and test configuration. Preserve its package manager, Python and ADK versions. Use the existing interpreter; do not install or change dependencies merely to make this skill's examples fit.
- Optionally run
python "$SKILL_DIR/scripts/inspect_project.py" --project /path/to/packagewith the target interpreter. Substitute resolved paths; do not assume the skill is in the target's working directory.--dry-runinventories recognised root metadata paths without reading their contents. The normal report reads only selected dependency metadata, never credentials or source. It is an inspection aid, not a compatibility or security verdict. Inspect nested packages separately and resolve its manual-review warnings. - Read compatibility.md before using ADK-specific code. Compare declared and installed versions without importing the target application. If they differ, report it. If an API is incompatible, stop that integration and present an adaptation plan; continue independent offline work. Never silently upgrade or downgrade.
- Trace each entry point through authentication, body parsing, history writes,
runner callbacks, tool calls, logs/traces and JSON/SSE output. Inspect existing
tests and adapters. Treat retrieved content and tool output as untrusted.
Check configuration key presence without printing
.env, tokens or ADC data. - Select the relevant mode below. Ask only for unresolved decisions: permitted data classes, replacement versus rejection, model backend, target locations, or missing authorisation context. Give a short plan before broad edits.
| Need | Mode and conditional reading |
| Deny credentials or replace permitted PII before any write/call | SDP — read sdp.md; choose its framework-neutral controller or regional SDK adapter |
| Prompt injection, content screening, native ADK plugin or final response screening | Model Armor — read model-armor.md; for where any screen runs (blocking before the agent acts, or in parallel) read boundaries.md |
| Tool results that may not leave the project (no Model Armor on them): a local classifier such as LlamaFirewall's Prompt Guard 2 | Local screen — read boundaries.md |
| Tool arguments/results, session leakage, unsafe streaming, or overall audit | Boundary integration — read boundaries.md; for callback wiring, lifecycle or telemetry use implementation-recipes.md |
| Missing cloud prerequisites, setup, runtime identity or owned-resource cleanup | Cloud readiness — read cloud-lifecycle.md; prepare a plan before any mutation |
| Startup, identity, TLS, quota, SDK, request-accounting or cleanup failure | Diagnosis — use the matching symptom in troubleshooting.md |
| Tenant-specific policy, detector tuning, retention/media, failure modes or rollout | Production policy — use the relevant section of production-policy.md; distinguish planned policy from configured coverage |
Modes compose within this one skill. A narrow SDP fix does not require replacing the gateway, and an audit request authorises inspection and recommendations.
Implement or review
- Write down each boundary's accepted shape, trusted fields, policy and failure behaviour. Preserve existing domain schemas and auth conventions. Do not copy demonstration identities, order formats, project IDs or model defaults.
- Enforce this order for user text: trusted identity → bounded/validated body → credential inspection → PII transformation → required prompt screening → owned session/history → model. Nothing downstream receives the original text.
- Treat a forbidden finding as rejection; treat missing, malformed, truncated, failed or timed-out required inspection as unavailable. Both withhold the operation. Never fall back to the original text or a local fake in production.
- For tool-bearing agents, apply boundaries.md: protect generated arguments before persistence and again before execution; project and validate tool results; authorise every resource inside its tool. A third-party "alignment check" over the trace is a data sink, not a gate (step 3 there).
- Buffer the public answer, classify blocked/error events before final text, and screen the complete answer before release. Share this gate across JSON and SSE. Emit no raw deltas, tool payloads or internal metadata.
- Bound input bytes and characters, output size, concurrency, RPC time and total request time. Reuse owned async clients and close them on shutdown. Retain only approved metadata in logs; inspect SDK and exporter capture separately. Native-plugin defaults do not automatically inherit direct-client limits or application log filtering; verify them using the implementation recipes.
- Add focused regression tests at the changed boundary. Adapt files in place; copy optional assets only if they reduce duplication. Preserve their MIT notice. On repeat invocation inspect first and avoid duplicate plugins, callbacks, environment settings, templates or dependency entries.
Consequential operations
<!-- shared:consequential-operations-brief -->Inspection is read-only, and code generation authorises no deployment, paid call or live test. Before any consequential operation (an API, billing or quota change, a billable resource, a secret, IAM, a data migration, a deployment, a deletion, or a paid or destructive test), read consequential operations, present the exact scope and limits, obtain explicit approval and end the turn to wait for it. Cleanup is a separate confirmed operation on resources this workflow created.
<!-- /shared:consequential-operations-brief -->Local implementation can proceed when requested; permission denied is not proof of absence.
Validate and finish
Read validation.md for the applicable regression matrix. Run the target's existing offline checks, including at least one behavioural canary showing blocked data never reaches a model, persisted event, log or side effect. For callback changes use the actual pinned ADK runner with an injected model and provider doubles, not just direct callback calls.
Run python -B -m unittest discover -s "$SKILL_DIR/tests" -v to check the bundled
resources when adapting them. The optional SDK adapter tests require the target's
existing DLP SDK; report skips explicitly. These tests make no provider calls. A local
protection fake alone does not make an ADK application offline: replace the
model/runner too and prevent network egress in the test harness.
Report changed files, mode/policy decisions, exact commands and results, declared/installed versions, and remaining actions. Do not turn an unrun check into a pass or dated results into a release guarantee.
<!-- shared:evidence-labels-brief -->Label each result with its tier (offline, local, live or release) and
outcome (pass, fail, blocked or not run) as
evidence labels defines them;
earlier, vendor and documentation-only results are historical,
vendor-measured or guidance, never this session's evidence.
<!-- /shared:evidence-labels-brief -->Stop once the authorised change and applicable checks are complete; leave unsupported claims and separately approved operations explicitly pending.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

