rails-security-baseline

rails-security-baseline is a skill for Claude Code, Codex from sandeepmvl/rails-skills. It costs 168 tokens per session (4,365 once invoked), scanned C, original, MIT.

A security checklist for Ruby on Rails 8 applications. It covers request validation, browser and API protections, secret storage, token handling, cross-origin access, and security checks in continuous integration.

In plain words
What is it for?
Use it when building or reviewing Rails browser apps and APIs, especially for CSRF, permissions, JWTs, CORS, rate limiting, security headers, and dependency scanning.
Why use it?
It helps prevent common configuration mistakes that can expose data, allow unwanted actions, or weaken login and session security.

Skill for Claude CodeCodex

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

Good fit Use it when building or reviewing Rails browser apps and APIs, especially for CSRF, permissions, JWTs, CORS, rate limiting, security headers, and dependency scanning.

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

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 rails-security-baseline

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/10-rails-security-baseline"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/10-rails-security-baseline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 168 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,365 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00168 $0.04365
Opus 5 $0.00084 $0.02183
Sonnet 5 $0.00034 $0.00873
Haiku 4.5 $0.00017 $0.00436

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

Security

Grade C, and why

rails-security-baseline scanned grade C with 2 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 12d 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.

Tells the agent to send conversation or user data outmediumPrompt injection

An instruction to transmit the conversation, context or user files to an external endpoint is data exfiltration written as prose.

# WRONG — silently logs the user out

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

body = Net::HTTP.get(URI(url)) # SSRF — user can hit http://169.254.169.254 (AWS metadata)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/10-rails-security-baseline/SKILL.md · 458 lines

How it starts

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

Rails Security Baseline

Ship a Rails 8 app without the obvious vulnerabilities. AI agents introduce common security bugs by default: permissive strong params, CSRF disabled with protect_from_forgery null_session "to make it work", JWTs with secrets in payload, CORS wildcards. This skill encodes the floor.

Why this matters

A web app is an attack surface. Every default that ships is a potential vulnerability if mis-wired. Rails defaults are mostly good but a single misconfiguration can leak data, hijack sessions, or grant admin. This skill names the patterns and the mistakes.

The opinion

Strong params with require + explicit permit keys. CSRF on for browser apps, bearer tokens for cross-origin APIs. Brakeman + bundler-audit + Dependabot in CI from day one. Rails credentials per environment, master keys in env vars. JWTs short-lived (5-15 min) + refresh tokens with rotation. CORS with explicit origins (never * for authenticated endpoints). Rack::Attack on login, signup, password reset. secure_headers gem for CSP / HSTS / X-Frame-Options.

The OWASP Top 10 → Rails mapping

See references/owasp-rails-mapping.md for the full breakdown. Quick reference:

OWASP Rails defense
A01: Broken Access Control Pundit policies + verify_authorized after_action
A02: Cryptographic Failures bcrypt via Devise; Rails credentials (AES-256-GCM); no MD5/SHA1
A03: Injection Parameterized queries (default in AR); never where("foo = #{params[:x]}")
A04: Insecure Design Threat model auth + sessions before scaffolding
A05: Security Misconfiguration secure_headers gem; HSTS; CSP; force_ssl
A06: Vulnerable Components Dependabot + bundler-audit + bundle outdated weekly
A07: Auth Failures Devise/Rodauth defaults; lockable; bcrypt cost ≥12
A08: Software & Data Integrity Sign artifacts; verify webhook signatures; SRI for CDN scripts
A09: Logging Failures lograge + Sentry + PII scrubbing (see observability-baseline)
A10: SSRF Validate user-supplied URLs; allowlist hosts; never Net::HTTP.get(URI(params[:url]))

Read the full file on GitHub · 458 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 458 lines · 168 tokens per session scan C f7b3b40f5379

Subscribe to this mod's changes

rails-security-baseline is a skill published in the GitHub repository sandeepmvl/rails-skills (21 stars, last pushed 3mo ago), licensed MIT. It adds 168 tokens to every session and 4,365 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it C with 2 findings (tells the agent to send conversation or user data out, cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rubyllm

Build and maintain Ruby or Rails applications with the RubyLLM AI framework. Use for chats, agents, tools, structured output, media generation, transcription, OCR, moderation, embeddings, reranking, Rails integration, and RubyLLM upgrades; not for contributing to the framework itself.

crmne/ruby_llm · 61 tokens

new

Create a new project to start development quickly.

clacky-ai/openclacky · 10 tokens

rspec-conventions

Rootstrap RSpec conventions. Use when writing, reviewing, or editing RSpec test files (spec//spec.rb, spec/railshelper.rb, spec/spechelper.rb, spec/support//.rb) or factories. Covers describe/context structure, let/subject, matchers, factories, mocking/stubbing, shared examples, and spec types (model, request…

rootstrap/rails_api_base · 82 tokens

ruby-patterns

Ruby/Rails: blocks, metaprogramming, ActiveRecord, Sidekiq, RSpec, Sorbet, Hanami. Triggers: Ruby, Rails, ActiveRecord, Sidekiq, RSpec, Gemfile, bundler, Hanami, Sorbet.

softspark/ai-toolkit · 60 tokens

ruby-rules

Ruby coding rules: style, patterns, security, testing. Triggers: .rb, Gemfile, .gemspec, Rails, ActiveRecord, Sidekiq, RSpec, Sorbet, rubocop.

softspark/ai-toolkit · 48 tokens

simplify

Simplifies and refines Ruby on Rails code following 37signals patterns and the One Person Framework philosophy, while preserving exact functionality. Focuses on recently modified code unless instructed otherwise. Use this skill when simplifying or refactoring Rails code, reviewing recently written Rails code for…

maquina-app/rails-claude-code · 123 tokens