security-hardening

security-hardening is a skill for Claude Code, Codex from monkilabs/opencastle. It costs 62 tokens per session (424 once invoked), scanned A, original, MIT.

A security design guide for sign-in, user permissions, browser security headers, input checks, APIs, and database row-level security, which controls access to individual database rows.

In plain words
What is it for?
Use it to implement authentication and authorization, configure content security policies, validate inputs, secure APIs, and write row-level security policies.
Why use it?
It helps prevent unauthorized access, unsafe input, cross-site attacks, and mistakes where client-side checks are trusted on their own.

Skill for Claude CodeCodex

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

Good fit Use it to implement authentication and authorization, configure content security policies, validate inputs, secure APIs, and write row-level security policies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/monkilabs/opencastle/security-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 monkilabs/opencastle --skill security-hardening
Clone the repo
git clone --depth 1 https://github.com/monkilabs/opencastle

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-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/monkilabs/opencastle/security-hardening/github.svg)](https://agentmods.dev/skills/monkilabs/opencastle/security-hardening)
Your own site
<a href="https://agentmods.dev/skills/monkilabs/opencastle/security-hardening"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/security-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-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/monkilabs/opencastle/security-hardening"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/security-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 424 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00424
Opus 5 $0.00031 $0.00212
Sonnet 5 $0.00012 $0.00085
Haiku 4.5 $0.00006 $0.00042

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

Security

Grade A, and why

security-hardening scanned grade A with 1 finding 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 5d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Least privilege; whitelist only required external domains per directive (project-specific, see deployment customization). `'unsafe-inline'`/`'unsafe-eval'` may be needed in dev — use nonces/hashes in production. Validate
src/orchestrator/skills/security-hardening/SKILL.md · 36 lines

What it actually says

Security Hardening

Authentication

Resolve the auth library via the database capability slot in the skill matrix.

  • Every sign in/up/out goes through a Server Action (POST-only → automatic CSRF protection).
  • Session refresh in middleware updateSession() with HTTP-only cookies; protected routes checked in middleware.
  • User roles live in profiles.roles TEXT[].

CSP

Least privilege; whitelist only required external domains per directive (project-specific, see deployment customization). 'unsafe-inline'/'unsafe-eval' may be needed in dev — use nonces/hashes in production. Validate shipped headers with curl -I against the preview URL.

RLS

SQL examples and role system: see the database skill (authoritative source for RLS).

  • ALTER TABLE x ENABLE ROW LEVEL SECURITY; on every table — default-deny, explicit-allow.
  • auth.uid() for auth checks, EXISTS subqueries for role checks.
  • Never disable RLS in production; never rely on client-side authorization alone.
  • CI gate: assert SELECT relrowsecurity FROM pg_class WHERE relname = 'your_table' is true, plus a positive/negative row-visibility test (other role must read 0 rows). Block merges on failure.

API Security

Cron routes: require authorization: Bearer ${process.env.CRON_SECRET}, else return 401. Generate with openssl rand -hex 32; rotate quarterly.

Zod schema validation on every Server Action and route handler before any DB operation; React Hook Form client-side.

Cross-reference: the api-patterns skill for Server Action patterns; the session-checkpoints skill for checkpointing security-sensitive work.

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. 5d ago First seen · 36 lines · 62 tokens per session scan A 8a85980a2431

Subscribe to this mod's changes

security-hardening is a skill published in the GitHub repository monkilabs/opencastle (61 stars, last pushed 11d ago), licensed MIT. It adds 62 tokens to every session and 424 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

product-architect

Complete product development system with 80 agents and 36 frameworks. Use when the user wants to build a product, write a PRD, plan an MVP or roadmap, design an app, research a market or check whether a feature already exists or is novel, do competitive analysis, run a security audit, build a financial model, plan…

ankitjha67/product-architect · 253 tokens

databricks-live-unity-catalog-grant-guard-at-azure

Mutating-runtime live guard for Unity Catalog privilege management on Azure Databricks. Executes exactly ONE GRANT or REVOKE of a single privilege on a single Unity Catalog securable (schema, table, or volume) to a single principal — with explicit written human approval, dry-run preflight, prior-state capture, and a…

VincentChuWaiChow/vanguard-frontier-agentic · 113 tokens

orchardcore-custom-indexing-elasticsearch

Skill for creating Orchard Core custom indexing pipelines for arbitrary data using Elasticsearch, based on CrestApps AI Memory and OrchardCore.Indexing patterns. Use this skill when requests mention Orchard Core Custom Indexing for Elasticsearch, Create a custom Elasticsearch index for arbitrary data, When to use this…

CrestApps/CrestApps.AgentSkills · 187 tokens

orchardcore-data-migrations

Skill for creating data migrations in Orchard Core. Covers content type migrations, YesSql index table creation, schema alterations, data seeding, and migration versioning patterns. Use this skill when requests mention Orchard Core Data Migrations, Create Data Migrations, Basic Migration with Content Type, Folder and…

CrestApps/CrestApps.AgentSkills · 190 tokens

orchardcore-elasticsearch

Skill for configuring Elasticsearch in Orchard Core. Covers Elasticsearch setup and Docker deployment, connection configuration, analyzers and token filters, index creation recipe steps, query types, comparison with Lucene, field mapping, custom data indexing, and Elasticsearch-specific configuration options. Use this…

CrestApps/CrestApps.AgentSkills · 168 tokens

orchardcore-ai-memory-elasticsearch

Skill for indexing CrestApps Orchard Core AI Memory with Elasticsearch. Covers memory field mappings, dense vectors, k-nearest-neighbor retrieval, default query fields, user isolation, and Elasticsearch operations. Use this skill when requests mention AI Memory Elasticsearch, AIMemoryElasticsearchIndexProfileHandler…

CrestApps/CrestApps.AgentSkills · 130 tokens