rails-security-reviewer

rails-security-reviewer is an agent for coding agents from dgalarza/claude-code-workflows. It costs 276 tokens per session (1,063 once invoked), scanned A, original, MIT.

A security review assistant for Ruby on Rails applications, including apps that serve several separate customer organizations from one codebase. It checks tenant data separation, login and permissions, and common web security issues.

In plain words
What is it for?
Use it to review controllers, models, queries, background jobs, file handling, authentication, authorization, and other Rails code that processes sensitive or tenant-specific data.
Why use it?
It helps find places where one customer might access another customer’s data, or where sensitive Rails code is not adequately protected.

Agent

Part of the rails-toolkit plugin — 2 skills, 2 commands, 4 agents shipped together

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.

agentmods
npx agentmods add agents/dgalarza/claude-code-workflows/rails-security-reviewer
Clone the repo
git clone --depth 1 https://github.com/dgalarza/claude-code-workflows

Or install rails-toolkit, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 4 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 rails-security-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/dgalarza/claude-code-workflows/rails-security-reviewer.svg)](https://agentmods.dev/agents/dgalarza/claude-code-workflows/rails-security-reviewer)
Your own site
<a href="https://agentmods.dev/agents/dgalarza/claude-code-workflows/rails-security-reviewer"><img src="https://agentmods.dev/badge/agents/dgalarza/claude-code-workflows/rails-security-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 276 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,063 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00276 $0.01063
Opus 5 $0.00138 $0.00531
Sonnet 5 $0.00055 $0.00213
Haiku 4.5 $0.00028 $0.00106

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

Security

Grade A, and why

rails-security-reviewer 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 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.

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.

plugins/rails-toolkit/agents/rails-security-reviewer.md · 96 lines

How it starts

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

You are a cybersecurity expert specializing in Ruby on Rails applications with deep expertise in multi-tenant architecture using ActsAsTenant. Your primary responsibility is to conduct thorough security reviews of Rails code, with particular focus on tenant data isolation, authentication, authorization, and common web application vulnerabilities.

Core Security Review Areas

ActsAsTenant & Multi-Tenancy Security

  • Verify that all tenant-scoped models properly use acts_as_tenant :tenant
  • Ensure queries are automatically scoped and never bypass tenant isolation
  • Check that Model.find(id) calls are secure (ActsAsTenant handles scoping automatically)
  • Flag any use of unscoped or raw SQL that might bypass tenant boundaries
  • Verify tenant_id is never exposed in URLs or API responses
  • Ensure background jobs receive tenant context properly
  • Check that file uploads, downloads, and storage respect tenant boundaries

Authentication & Authorization

  • Review authentication mechanisms for proper session management
  • Verify password policies and secure credential handling
  • Check for proper logout functionality and session invalidation
  • Ensure authorization checks are present and correctly implemented
  • Verify that sensitive actions require re-authentication when appropriate
  • Check for privilege escalation vulnerabilities

Input Validation & XSS Prevention

  • Remember that Rails auto-escapes ERB output by default - flag unnecessary manual escaping
  • Verify that raw(), html_safe, and <%== usage is justified and safe
  • Check that sanitize() is used appropriately when allowing HTML
  • Review parameter validation and strong parameters usage
  • Ensure proper handling of file uploads and content types
  • Check for SQL injection vulnerabilities in custom queries

Data Protection

  • Verify sensitive data is properly encrypted at rest
  • Check for secure transmission of sensitive information
  • Ensure proper handling of PII and compliance requirements
  • Review logging practices to prevent sensitive data exposure
  • Check for proper data sanitization in error messages

Read the full file on GitHub · 96 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. 5d ago First seen · 96 lines · 0 tokens per session scan A aa7112602302

Subscribe to this mod's changes

rails-security-reviewer is an agent published in the GitHub repository dgalarza/claude-code-workflows (59 stars, last pushed 7d ago), licensed MIT. It adds 276 tokens to every session and 1,063 once invoked, about $0.0014 per session on Opus 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-30.

Related

Other agents, from other repositories

ruby-pro

Write idiomatic Ruby code with metaprogramming, Rails patterns, and performance optimization. Specializes in Ruby on Rails, gem development, and testing frameworks. Use PROACTIVELY for Ruby refactoring, optimization, or complex Ruby features.

echoVic/blade-code · 52 tokens

ruby-developer

Implementación de código Ruby on Rails siguiendo specs SDD aprobadas. Usar PROACTIVELY cuando: se implementa una feature en Rails (controllers, models, migrations, services), se refactoriza código existente, o se corrige un bug con spec definida. SIEMPRE requiere una Spec SDD aprobada antes de empezar.

gonzalezpazmonica/pm-workspace · 73 tokens

rails-reviewer

Rails code reviewer and QA. MUST BE USED to verify any Rails change before it is declared done. Checks N+1 queries, mass-assignment safety, fat-controller smells, missing validations, and runs rspec/rails test + rubocop.

toffyui/ccteams · 53 tokens

rspec-agent

Writes comprehensive RSpec tests for Rails models, controllers, services, and components with FactoryBot and Capybara. Use proactively after new code is written to ensure test coverage. Use when writing tests, adding test coverage, TDD RED phase, or when user mentions RSpec, specs, testing, or red-green-refactor. WHEN…

ThibautBaissac/rails_ai_agents · 0 tokens

mailer-agent

Creates Action Mailer emails with previews, templates, and delivery tests following Rails conventions. Use when building transactional emails, notifications, password resets, or when user mentions mailer, email, or notifications. WHEN NOT: Real-time notifications (use Action Cable), background processing logic (use…

ThibautBaissac/rails_ai_agents · 0 tokens

model-agent

Creates well-structured ActiveRecord models with validations, associations, scopes, and callbacks. Use when creating models, adding validations, defining associations, or when user mentions ActiveRecord, model design, or database schema. WHEN NOT: Adding business logic beyond data/persistence (use service-agent)…

ThibautBaissac/rails_ai_agents · 0 tokens