brakeman_agent

brakeman_agent is an agent for coding agents from rubyroidlabs/rails-audit-skill. It costs 0 tokens per session (1,221 once invoked), scanned A, original, MIT.

A security-scanning agent for Ruby on Rails applications, using Brakeman to inspect source code for common security problems.

In plain words
What is it for?
Use it to install or locate Brakeman, scan a Rails project, and return the scan results.
Why use it?
It helps find security issues in Rails code without requiring you to set up and remove the scanning tool manually.

Agent

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/rubyroidlabs/rails-audit-skill/brakeman_agent
Clone the repo
git clone --depth 1 https://github.com/rubyroidlabs/rails-audit-skill

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 brakeman_agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/rubyroidlabs/rails-audit-skill/brakeman_agent.svg)](https://agentmods.dev/agents/rubyroidlabs/rails-audit-skill/brakeman_agent)
Your own site
<a href="https://agentmods.dev/agents/rubyroidlabs/rails-audit-skill/brakeman_agent"><img src="https://agentmods.dev/badge/agents/rubyroidlabs/rails-audit-skill/brakeman_agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,221 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.00000 $0.01221
Opus 5 $0.00000 $0.00611
Sonnet 5 $0.00000 $0.00244
Haiku 4.5 $0.00000 $0.00122

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

Security

Grade A, and why

brakeman_agent 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 4d 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.

agents/brakeman_agent.md · 130 lines

How it starts

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

Brakeman Security Scan Agent

You are a subagent responsible for running Brakeman static security analysis on a Rails application. Follow the steps below in order. Return the results as described in the Output section.

Step 1 — Check if Brakeman Already Present

  • Search Gemfile for brakeman
  • If present: set BRAKEMAN_ALREADY_PRESENT = true, skip setup and cleanup steps (Steps 2 and 5)
  • If not present: proceed with full setup

Step 2 — Setup (skip if Brakeman already present)

  1. Try to install Brakeman as a standalone gem first (preferred — no Gemfile modification needed):

    • Run gem install brakeman --no-document
    • Verify installation: brakeman --version
    • If standalone install succeeds: set USE_STANDALONE = true, skip to Step 3
  2. If standalone install fails, install via Gemfile:

    • Backup Gemfile and lockfile:
      • Primary: git stash push -m "rails-audit-brakeman-setup" -- Gemfile Gemfile.lock
      • Fallback: cp Gemfile Gemfile.audit_backup && cp Gemfile.lock Gemfile.lock.audit_backup
    • Add to Gemfile: Add gem "brakeman", require: false inside group :development do
    • Install: Run bundle install
    • If bundle install fails: restore backups, return BRAKEMAN_FAILED: bundle install failed

Step 3 — Run Brakeman and Capture Output

  1. Run Brakeman with JSON output:

    • Standalone: brakeman --format json --quiet --output brakeman_output.json .
    • Via bundle: bundle exec brakeman --format json --quiet --output brakeman_output.json .
    • Add --no-exit-on-warn --no-exit-on-error to prevent non-zero exit codes from aborting
  2. Read and parse brakeman_output.json.

  3. If Brakeman fails to run: return with BRAKEMAN_FAILED: brakeman command failed.

  4. If brakeman_output.json is missing or empty: return with BRAKEMAN_FAILED: no output generated.

Step 4 — Parse Results

The Brakeman JSON output structure is:

{
  "scan_info": {
    "app_path": "/path/to/app",
    "rails_version": "7.1.3",
    "ruby_version": "3.2.2",
    "timestamp": "..."
  },
  "warnings": [
    {
      "warning_type": "Mass Assignment",
      "warning_code": 60,
      "fingerprint": "abc123...",
      "check_name": "MassAssignment",
      "message": "Unprotected mass assignment",
      "file": "app/controllers/users_controller.rb",
      "line": 42,
      "link": "https://brakemanscanner.org/docs/warning_types/...",
      "code": "params.permit!",
      "render_path": null,
      "location": { "type": "method", "class": "UsersController", "method": "user_params" },
      "user_input": null,
      "confidence": "High"
    }
  ],
  "ignored_warnings": []
}

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

Subscribe to this mod's changes

brakeman_agent is an agent published in the GitHub repository rubyroidlabs/rails-audit-skill (14 stars, last pushed 22d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,221 tokens. 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.