security-best-practices

security-best-practices is a skill for Claude Code, Codex from shahidshabbir-se/my-pi-setup. It costs 27 tokens per session (715 once invoked), scanned A, a copy of security-best-practices, MIT.

A collection of secure coding guidance for backend services, microservices, and code that handles external input or sensitive data. It covers validation, authentication, authorization, secrets, and access controls.

In plain words
What is it for?
Use it when building backend features, processing user input, managing secrets, authenticating users, or protecting sensitive resources.
Why use it?
It helps prevent common problems such as injection, exposed credentials, weak password storage, and overly broad permissions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building backend features, processing user input, managing secrets, authenticating users, or protecting sensitive resources.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shahidshabbir-se/my-pi-setup/security-best-practices
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 shahidshabbir-se/my-pi-setup --skill security-best-practices
Clone the repo
git clone --depth 1 https://github.com/shahidshabbir-se/my-pi-setup

Made for: Claude Code, Codex.

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/shahidshabbir-se/my-pi-setup/security-best-practices/github.svg)](https://agentmods.dev/skills/shahidshabbir-se/my-pi-setup/security-best-practices)
Your own site
<a href="https://agentmods.dev/skills/shahidshabbir-se/my-pi-setup/security-best-practices"><img src="https://agentmods.dev/badge/skills/shahidshabbir-se/my-pi-setup/security-best-practices/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-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/shahidshabbir-se/my-pi-setup/security-best-practices"><img src="https://agentmods.dev/badge/skills/shahidshabbir-se/my-pi-setup/security-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 715 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 100% copy Near-identical to another mod 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.00027 $0.00715
Opus 5 $0.00014 $0.00358
Sonnet 5 $0.00005 $0.00143
Haiku 4.5 $0.00003 $0.00072

Measured 11d ago against content hash 36682b40a93e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

security-best-practices 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 11d 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.

Origin

This is a copy

100% identical to security-best-practices — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

agent/skills/security-best-practices/SKILL.md · 105 lines

How it starts

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

Security Best Practices

Apply these security principles when developing backend services, microservices, and any code handling sensitive data or external inputs.

Input Validation and Sanitization

  • Apply input validation and sanitization rigorously, especially on inputs from external sources
  • Validate all user inputs at the boundary of your application
  • Use allowlists over denylists when validating input
  • Sanitize data before storing or displaying to prevent injection attacks
  • Implement strict type checking and schema validation

Authentication and Authorization

  • Use secure defaults for JWT, cookies, and configuration settings
  • Implement proper token expiration and refresh mechanisms
  • Store secrets securely using environment variables or secret management services
  • Never hardcode credentials or API keys in source code
  • Use secure password hashing algorithms (bcrypt, Argon2)

Permission Boundaries

  • Isolate sensitive operations with clear permission boundaries
  • Apply the principle of least privilege throughout the system
  • Implement role-based access control (RBAC) where appropriate
  • Audit and log access to sensitive resources
  • Use separate service accounts for different components

Resilience and Protection

  • Implement retries, exponential backoff, and timeouts on all external calls
  • Deploy circuit breakers and rate limiting for service protection
  • Consider distributed rate-limiting to prevent abuse across services (e.g., using Redis)
  • Implement request throttling to prevent denial of service
  • Use connection pooling with appropriate limits

Secure Configuration

  • Use HTTPS/TLS for all network communications
  • Configure secure HTTP headers (HSTS, CSP, X-Frame-Options)
  • Disable verbose error messages in production
  • Keep dependencies updated and scan for vulnerabilities
  • Use secure defaults and fail securely

Error Handling

  • Implement comprehensive error handling throughout the application
  • Never expose stack traces or internal details to end users
  • Log security-relevant events with appropriate detail
  • Propagate context appropriately for debugging while maintaining security
  • Handle authentication and authorization failures gracefully

Read the full file on GitHub · 105 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. 11d ago First seen · 105 lines · 27 tokens per session scan A 36682b40a93e

Subscribe to this mod's changes

security-best-practices is a skill published in the GitHub repository shahidshabbir-se/my-pi-setup (2 stars, last pushed 3mo ago), licensed MIT. It adds 27 tokens to every session and 715 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to security-best-practices, differing in 0 lines, and is treated as a copy.