Play Policy Insights
Android (Google)OfficialCreated by Google LLCDistributed by Android (Google)
- Skill
- Review and audit
- Security
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Play Policy Insights is an automated auditing tool designed to evaluate Android applications for compliance with Google Play Policy domains. It performs static code analysis and cross-references findings with Play Store declarations to identify potential issues such as undeclared data collection, architectural risks, and missing disclosures. The skill operates through a structured two-phase protocol, managing fact gathering, triage, and goal-oriented analysis to generate comprehensive compliance reports.
What it does
- Performs static analysis on Android application codebases.
- Cross-references code findings with Play Store policy declarations.
- Identifies undeclared data collection and missing privacy disclosures.
- Audits permissions, API hygiene, and user account/identity implementations.
- Generates deterministic compliance reports for pre-submission review.
- Supports both delegated and sequential execution modes for audit tasks.
When to use it
- Before submitting an Android application to the Google Play Store.
- When verifying compliance with Data Safety and Privacy policies.
- To audit an app's use of restricted permissions and sensitive APIs.
- To ensure demo login credentials and account deletion flows meet policy standards.
Advantages
- Provides a structured, repeatable audit process for policy compliance.
- Reduces manual effort by automating static analysis and report generation.
- Ensures consistent evaluation across different audit domains.
- Includes built-in safeguards for file system management and task execution.
Usage examples
- “Run a compliance audit on the Android app located in /path/to/app_code.”
- The agent initializes the audit environment, performs static analysis, executes goal-oriented checks, and generates a final compliance_report.md.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/android/play-policy-insights/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip play-policy-insights.zip -d .agents/skills
Documentation by Google LLC
Play Policy Insights: data safety, login credentials, and restricted permissions
You must audit Android apps for three specific policy domains. You must check data safety, demo login credentials, and restricted permissions.
Path Resolution
repo_root: Absolute path to the directory containing this
SKILL.md.app_dir:: Absolute path to the directory containing app's code.
temp_dir: Absolute path to the scratch directory at the workspace root. It is located at
.scratch/play_policy_insights_<uuid>. Containment Mandate: You must confine all file system writes, intermediate artifacts, and logs strictly to this directory. This ensures the skill remains portable and safe across diverse execution environments, including local harnesses and CI/CD pipelines, by avoiding reliance on system-level temporary paths or user home directories.
Critical mandates
Execution Mode Awareness Before starting Phase 2, evaluate if your execution environment provides a tool to spawn or delegate tasks to general-purpose sub-agents (e.g., tools often named
invoke_agent,delegate_task, orspawn_worker, using generic agent profiles like 'generalist' or 'coding_agent').If YES, you MUST use Mode A (Delegation).
If NO, use Mode B (Sequential Self-Execution). You must read the prompt files intended for the subagents, follow their instructions, and write the expected output files to disk.
Sub-agents orchestration:
If you use "Mode A (Delegation)", wait for "SUCCESS" confirmation from sub-agents to know when they are done.
Idempotency & Timeout Safeguard: If a sub-agent fails or times out, you MUST verify the presence and integrity of its target output file (e.g.,
<temp_dir>/worker_<goal_name>.json) before retrying. If the file exists and contains valid JSON, treat the execution as SUCCESS and proceed. Otherwise, retry up to three times.
Fail-fast mandate: The automated audit in Phase 1 is the source of truth. If
orchestrator.pyfails, you must stop immediately with an explanation of failure. Do not use manual auditing as a fallback.
The two-phase protocol
Phase 1: Fact gathering and triage
Initialize and triage:
Run
python3 <repo_root>/scripts/orchestrator.py init <app_dir>.This will create the scratch environment, perform static analysis, map the codebase, identify audit goals, and produce prompts for subagents for each audit goal and prompts for designated critic and aggregator subagents.
You must wait (up to 5 minutes) for the script to finish.
Capture environment: Note values of the
temp_dir, andactivated_goalsfrom the JSON output. You will need them in Phase 2.Evaluate goals: If
activated_goalsis empty, skip to step 3 of Phase 2 (Aggregation). Otherwise, proceed to step 1 of Phase 2 (Detailed analysis).
Phase 2: Goal-oriented audit
Determine your execution capabilities and proceed with either Mode A OR Mode B.
Mode A: Orchestrator WITH Delegation Capabilities (Parallel)
Detailed analysis: For each goal in
activated_goals(e.g.,permissions_and_apis,data_safety_part_1,data_safety_part_2), delegate to a sub-agent. Concurrency Limit: You must not spawn more than 3 sub-agents simultaneously. Spawn the first batch of up to 3, wait for their completions, and then spawn the next batch. Repeat until all goals are complete. Pass the prompt:"Read your instructions from <temp_dir>/prompt_worker_<goal_name>.md and execute. MANDATORY: You must use your file-writing capabilities to save your final JSON findings directly to the file system at <temp_dir>/worker_<goal_name>.json. You are strictly forbidden from outputting the JSON in your chat response. To minimize context usage, your final response must be exactly 'SUCCESS' and nothing else."Validate: Confirm every<temp_dir>/worker_<goal_name>.jsonexists and contains valid JSON. If a sub-agent fails or times out, but the valid JSON output file is already present on disk, do NOT retry; proceed normally. Only retry the corresponding worker (up to three times) if the file is missing or invalid.Aggregate Findings: Execute the python aggregation command:
python3 <repo_root>/scripts/orchestrator.py aggregate <temp_dir>. This producesaggregated_findings.jsonand returns a JSON object containingcritic_chunksrepresenting the number of chunks to verify (e.g.,{"temp_dir": "...", "critic_chunks": 2}).Parallel Critic review: For each chunk index
ifrom 1 tocritic_chunks, delegate to a sub-agent. Concurrency Limit: You must not spawn more than 3 critic sub-agents simultaneously. Batch them in groups of 3 as above. Pass the prompt:"Read your instructions from <temp_dir>/prompt_critic_<i>.md and execute. MANDATORY: You must use your file-writing capabilities to save your final JSON findings directly to the file system at <temp_dir>/critic_output_<i>.json. You are strictly forbidden from outputting the JSON in your chat response. To minimize context usage, your final response must be exactly 'SUCCESS' and nothing else."Validate: Confirm each<temp_dir>/critic_output_<i>.jsonexists and contains valid JSON before proceeding. If it failed or timed out, but the valid JSON file is present, proceed normally. Otherwise, retry that specific critic chunk.Proceed to Finalization (Step 4 below)
Mode B: Orchestrator WITHOUT Delegation Capabilities (Sequential)
Detailed Analysis: For each goal in
activated_goals, sequentially:Read the contents of
<temp_dir>/prompt_worker_<goal_name>.md.Execute the instructions contained within that file yourself.
CRITICAL: You MUST format your findings exactly as requested in the prompt and save them to
<temp_dir>/worker_<goal_name>.json. Do not summarize findings in your thoughts or chat; move to the next task.Validate: Confirm
<temp_dir>/worker_<goal_name>.jsonexists before moving to the next goal.
Aggregate Findings: Execute the python aggregation command:
python3 <repo_root>/scripts/orchestrator.py --aggregate <temp_dir>. This producesaggregated_findings.jsonand returns a JSON object containingcritic_chunksrepresenting the number of chunks to verify.Sequential Critic review: For each chunk index
ifrom 1 tocritic_chunks, sequentially:Read the contents of
<temp_dir>/prompt_critic_<i>.md.Execute the steps yourself and save your findings to
<temp_dir>/critic_output_<i>.json.Validate: Confirm
<temp_dir>/critic_output_<i>.jsonexists before moving to the next chunk.
Proceed to Finalization (Step 4 below)
Finalization (Both Modes)
Present findings: Run
python3 <repo_root>/scripts/generate_report.py <temp_dir>. It will produce<temp_dir>/compliance_report.md. Present this output file to user.STOP: The audit is complete. Await further instructions.
Files
- ATTRIBUTION.mdAdded by AutoGineer967 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md8.3 KiB
- resources/common_mandates.md6.0 KiB
- resources/compliance_report_template.md3.1 KiB
- resources/critic.md4.2 KiB
- resources/goal_data_safety.md10.2 KiB
- resources/goal_permissions_and_apis.md25.7 KiB
- resources/goal_user_account.md5.1 KiB
- resources/policies.json12.9 KiB
- resources/scanner_config.json25.5 KiB
- scripts/generate_report.pyScript27.7 KiB
- scripts/orchestrator.pyScript44.9 KiB
- scripts/play_store_scraper.pyScript12.0 KiB
- scripts/scanner.pyScript8.8 KiB
- scripts/template_engine.pyScript7.0 KiB
scripts/template_engine.py
#!/usr/bin/env python3
# Copyright 2026 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Small logic-less template engine for Markdown generation."""
import re
# Precompiled regex patterns at module scope for linear-time optimizations
TAG_PATTERN = re.compile(r"\{\{(#|/)?(IF_ANY|IF_ALL|IF|EACH)?\s*(.*?)\}\}")
NEWLINE_COLLAPSE_PATTERN = re.compile(r"\n{3,}")
VAR_VALID_PATTERN = re.compile(r"^[A-Za-z0-9_.]+$")
def get_nested_val(ctx, key):
"""Resolves nested dot-notation keys from context (e.g., app.info.package)."""
parts = key.split(".")
val = ctx
for p in parts:
if isinstance(val, dict):
val = val.get(p)
else:
return None
return val
class Node:
"""Base class for all Abstract Syntax Tree (AST) node elements."""
def render(self, ctx, buffer):
raise NotImplementedError
class TextNode(Node):
"""Represents raw static text blocks."""
def __init__(self, text):
self.text = text
def render(self, ctx, buffer):
buffer.append(self.text)
class VarNode(Node):
"""Represents dynamic variable interpolation with literal fallbacks."""
def __init__(self, key, raw_text):
self.key = key
self.raw_text = raw_text
def render(self, ctx, buffer):
val = get_nested_val(ctx, self.key)
if val is not None:
buffer.append(str(val))
else:
# Preserve the unresolved tag exactly like the original engine
buffer.append(self.raw_text)
class IfNode(Node):
"""Represents conditional block logic (IF, IF_ALL, IF_ANY)."""
def __init__(self, keys_str, mode, children):
self.keys = [k.strip() for k in keys_str.split(",")]
self.mode = mode
self.children = children
def render(self, ctx, buffer):
condition_met = False
if self.mode == "IF":
condition_met = bool(get_nested_val(ctx, self.keys[0]))
elif self.mode == "IF_ANY":
condition_met = any(get_nested_val(ctx, k) for k in self.keys)
elif self.mode == "IF_ALL":
condition_met = all(get_nested_val(ctx, k) for k in self.keys)
if condition_met:
for child in self.children:
child.render(ctx, buffer)
def strip_nodes(nodes):
"""Helper to strip leading/trailing whitespace from first/last TextNodes."""
if not nodes:
return nodes
# Strip leading whitespace from first TextNode
if isinstance(nodes[0], TextNode):
nodes[0].text = nodes[0].text.lstrip()
if not nodes[0].text:
nodes.pop(0)
# Strip trailing whitespace from last TextNode
if nodes and isinstance(nodes[-1], TextNode):
nodes[-1].text = nodes[-1].text.rstrip()
if not nodes[-1].text:
nodes.pop()
return nodes
class EachNode(Node):
"""Represents standard iteration logic {{#EACH}} over lists/dicts."""
def __init__(self, key, children):
self.key = key
self.children = strip_nodes(children)
def _render_children(self, local_ctx):
"""Helper to render nested children under a specific loop context."""
sub_buffer = []
for child in self.children:
child.render(local_ctx, sub_buffer)
return "".join(sub_buffer)
def render(self, ctx, buffer):
val = get_nested_val(ctx, self.key)
if not val:
return
rendered_items = []
if isinstance(val, dict):
for k, v in val.items():
if k == "-":
continue
new_ctx = ctx.copy()
new_ctx["KEY"] = str(k)
new_ctx["VALUE"] = v
rendered_items.append(self._render_children(new_ctx))
elif isinstance(val, list):
for item in val:
new_ctx = ctx.copy()
new_ctx["ITEM"] = item
rendered_items.append(self._render_children(new_ctx))
# Join iterations together with single newline
buffer.append("\n".join(rendered_items))
class _ParserFrame:
"""Helper class representing an active stack frame in the compiler."""
def __init__(self, tag_type, children, match):
self.tag_type = tag_type
self.children = children
self.match = match
def compile_template(template_str):
"""Parses template_str forward-only, building the AST Node tree."""
root_children = []
stack = [_ParserFrame(None, root_children, None)]
pos = 0
for match in TAG_PATTERN.finditer(template_str):
start, end = match.span()
# 1. Capture static text prior to the tag
if start > pos:
stack[-1].children.append(TextNode(template_str[pos:start]))
prefix = match.group(1)
tag_type = match.group(2)
arg = match.group(3).strip() if match.group(3) else ""
raw_tag = match.group(0)
if prefix == "#":
if tag_type:
# Pushing a new nested frame block onto the stack
new_children = []
stack.append(_ParserFrame(tag_type, new_children, match))
else:
# Invalid tag starting with #, treat as normal text block
stack[-1].children.append(TextNode(raw_tag))
elif prefix == "/":
if tag_type:
# Block closer tag
if len(stack) > 1 and stack[-1].tag_type == tag_type:
frame = stack.pop()
open_arg = frame.match.group(3).strip()
if frame.tag_type == "EACH":
node = EachNode(open_arg, frame.children)
else:
node = IfNode(open_arg, frame.tag_type, frame.children)
stack[-1].children.append(node)
else:
# Mismatched closer, treat as static text
stack[-1].children.append(TextNode(raw_tag))
else:
# Invalid closer, treat as static text
stack[-1].children.append(TextNode(raw_tag))
else:
# Variable tag or unknown braces
if VAR_VALID_PATTERN.match(arg):
stack[-1].children.append(VarNode(arg, raw_tag))
else:
stack[-1].children.append(TextNode(raw_tag))
pos = end
# Capture any trailing text blocks
if pos < len(template_str):
stack[-1].children.append(TextNode(template_str[pos:]))
# Graceful recovery for unclosed tags to prevent runtime crashes
while len(stack) > 1:
frame = stack.pop()
# Re-inject the unclosed opening tag as plain text, followed by its children
stack[-1].children.append(TextNode(frame.match.group(0)))
stack[-1].children.extend(frame.children)
return root_children
def render_template(template_str, context_dict):
"""Renders a markdown template with high performance and zero dependencies."""
nodes = compile_template(template_str)
buffer = []
for node in nodes:
node.render(context_dict, buffer)
final_string = "".join(buffer)
# Collapse 3 or more consecutive newlines into exactly 2 (preserves layout)
return NEWLINE_COLLAPSE_PATTERN.sub("\n\n", final_string)
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Google LLC
- Publisher
- Android (Google) (Official)
- Distributed by
- Android (Google)
- Source
- android/skills · play/play-policy-insights · commit bf68e2d
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.txt)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google LLC or Android (Google).
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download play-policy-insights.zip