Android
AuraScore 81/100

Enterprise Android Security Attestation Automation Generator

Generate an automated Android security verification script for enterprise client hardware attestation and certificate pinning audits.

Use this template when auditing or automating security compliance for client-facing enterprise Android applications. It creates a robust validation script testing hardware keystore integrity, SSL pinning, and tamper responses.

Template

Role: Principal Android Security Consultant specializing in mobile enterprise defense and cryptographic validation.

Context

  • Client engagement: {{client_firm_name}}
  • Compiled package artifact: {{target_apk_path}}
  • Keystore alias for signing: {{keystore_alias}}
  • Verification attestation server: {{attestation_endpoint}}
  • Target compliance benchmark: {{compliance_standard}}
  • Minimum supported platform level: {{minimum_api_level}}

Task

Generate a production-ready shell and Python test automation script that connects to connected physical test devices via ADB, executes Play Integrity and KeyStore hardware-backed attestation checks, verifies network security config pinning against {{attestation_endpoint}}, and exports an audit-ready compliance artifact for {{client_firm_name}}.

Method

  1. Initialize environment parameters and validate device connectivity over ADB targeting {{minimum_api_level}}.
  2. Extract package metadata from {{target_apk_path}} and verify APK signature scheme integrity against {{keystore_alias}}.
  3. Inject a local proxy certificate to dynamically test that certificate pinning rejects unauthorized TLS handshakes.
  4. Trigger an instrumented hardware attestation challenge against the Android Keystore to verify hardware-backed key storage.
  5. Query the Play Integrity API via {{attestation_endpoint}} and parse verdict payloads for basic integrity, device recognition, and licensing status.
  6. Execute root and runtime tamper detection probes, asserting proper defensive termination behavior.
  7. Format all assertion results into structured JSON and an executive compliance summary mapped to {{compliance_standard}}.

Constraints

  • MUST output fully executable, posix-compliant Bash and Python 3 automation scripts without pseudo-code placeholders.
  • MUST NOT hardcode plaintext passwords, raw private keys, or internal API tokens into the generated code.
  • All ADB commands MUST handle multi-device environments gracefully using device targeting flags.
  • Error handling MUST fail closed with descriptive standard error codes upon any security assertion failure.

Output format

  • Section 1: Prerequisites and Environment Configuration
  • Section 2: Complete Test Harness Script (Bash/Python code block, 80-140 lines)
  • Section 3: Sample Execution Command and JSON Output Schema
  • Section 4: Security Remediation Guide (maximum 300 words)

Self-review

  • Ensure all variables ({{client_firm_name}}, {{target_apk_path}}, {{keystore_alias}}, {{attestation_endpoint}}, {{compliance_standard}}, {{minimum_api_level}}) are actively used in the script.
  • Verify that network security failure paths explicitly check for trust anchor rejections.
  • Check that the script executes cleanly in a continuous integration environment without interactive prompts.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-android
professional-services
android
security
attestation