security-and-hardening

security-and-hardening is a skill for Claude Code from GuillemRoca/agent-skills-android. It costs 62 tokens per session (3,383 once invoked), scanned A, original, MIT.

A set of security rules and Android development patterns for apps that handle credentials, personal data, authentication, network connections, or WebViews. It also covers preparation for publishing an app on the Google Play Store.

In plain words
What is it for?
Use it when storing tokens, protecting data, adding network communication, reviewing login permissions, configuring code shrinking, building WebView features, or preparing a Play Store release.
Why use it?
It helps prevent common mobile security mistakes and makes security checks part of development before sensitive code or a release reaches users.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agent-skills-android plugin — 30 skills, 8 commands, 3 agents shipped together

Good fit Use it when storing tokens, protecting data, adding network communication, reviewing login permissions, configuring code shrinking, building WebView features, or preparing a Play Store release.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/guillemroca/agent-skills-android/security-and-hardening
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add GuillemRoca/agent-skills-android --skill security-and-hardening
Clone the repo
git clone --depth 1 https://github.com/GuillemRoca/agent-skills-android

Made for: Claude Code.

Or install agent-skills-android, the plugin that ships this one along with the rest of its 30 skills, 8 commands, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-and-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/security-and-hardening/github.svg)](https://agentmods.dev/skills/guillemroca/agent-skills-android/security-and-hardening)
Your own site
<a href="https://agentmods.dev/skills/guillemroca/agent-skills-android/security-and-hardening"><img src="https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/security-and-hardening/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for security-and-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/guillemroca/agent-skills-android/security-and-hardening"><img src="https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/security-and-hardening.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,383 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.03383
Opus 5.5 $0.00025 $0.01353
Sonnet 5.5 $0.00012 $0.00677
Haiku 4.5 $0.00006 $0.00338

Measured 1mo ago against content hash b7bb7ca8d101, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

security-and-hardening scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/security-and-hardening/SKILL.md · 324 lines

How it starts

The opening of the file, as written. The whole thing — 324 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Security and Hardening

Overview

Security is a development constraint, not an afterthought. This skill provides a three-tier framework — Always Do, Ask First, Never Do — covering the OWASP Mobile Top 10, Android-specific attack vectors, and hardening patterns for production apps.

When to Use

  • Handling user credentials, tokens, or personal data
  • Implementing network communication
  • Before shipping any release to the Play Store
  • Reviewing code that touches authentication or authorization
  • Setting up ProGuard/R8 rules
  • Implementing WebView features
  • Collecting personal data, adding analytics/ads SDKs, or answering privacy requirements (GDPR, CCPA, Play Data safety)

Skip when: Changes are purely cosmetic with no data or network impact.

Core Process: Three-Tier Framework

Always Do

  1. Secure data storage. Jetpack Security Crypto (EncryptedSharedPreferences/MasterKey) is deprecated and unmaintained — do not add it to new code. Encrypt with a key held in the Android Keystore and persist the ciphertext (DataStore or a file):
// Key lives in the Android Keystore — never leaves secure hardware
val keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore")
keyGenerator.init(
    KeyGenParameterSpec.Builder("auth_token_key", KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT)
        .setBlockModes(KeyProperties.BLOCK_MODE_GCM)
        .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
        .build()
)
val secretKey = keyGenerator.generateKey()

// Encrypt, then persist iv + ciphertext (e.g. in Proto DataStore)
val cipher = Cipher.getInstance("AES/GCM/NoPadding").apply { init(Cipher.ENCRYPT_MODE, secretKey) }
val encrypted = cipher.iv + cipher.doFinal(token.toByteArray())

Existing apps already on EncryptedSharedPreferences can keep it (the format is stable), but plan a migration and never store new categories of secrets with it.

  1. Network Security Config:
<!-- res/xml/network_security_config.xml -->
<network-security-config>
    <!-- Enforce HTTPS for all connections -->
    <base-config cleartextTrafficPermitted="false">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>

    <!-- Certificate pinning for your API -->
    <domain-config>
        <domain includeSubdomains="true">api.example.com</domain>
        <pin-set expiration="2025-12-31">
            <pin digest="SHA-256">base64EncodedPin=</pin>
            <!-- Backup pin -->
            <pin digest="SHA-256">base64EncodedBackupPin=</pin>
        </pin-set>
    </domain-config>
</network-security-config>

Read the full file on GitHub · 324 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +47 lines · +19 tokens per session b7bb7ca8d101
  2. 2mo ago First seen · 277 lines · 43 tokens per session scan A ac7518a6b21f

Subscribe to this mod's changes

security-and-hardening is a skill published in the GitHub repository GuillemRoca/agent-skills-android (5 stars, last pushed 1mo ago), licensed MIT. It adds 62 tokens to every session and 3,383 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

security-and-hardening compared with skills from other repositories

security-and-hardening next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
security-and-hardeningGuillemRoca/agent-skills-androidSkill51mo agoMITA62Claude Code
sim-usecafe3310/public-agent-skillsSkill256yesterdayApache-2.0A48Claude Code, Codex
app-store-optimizationrootcastleco/rei-skillsSkill74d agononeA32Claude Code, Codex
imagegen-frontend-mobilefirstsun-dev/skillsSkill54d agononeA126Claude Code, Codex
sleek-design-mobile-appsfirstsun-dev/skillsSkill54d agononeA51Claude Code, Codex
healthkitfirstsun-dev/skillsSkill54d agononeA86Claude Code, Codex
liquid-glass-designx-cmd/skillSkill264mo agoApache-2.0A37Claude Code, Codex