---
name: brakeman
description: "Use when adopting Brakeman to assess this standard: Review Rails security warnings"
---

# Apply Brakeman

Analyze Rails controllers, models and views for unsafe data flow. Triage warnings by confidence and link each accepted exception to a review decision.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by Brakeman.
2. Use Brakeman in this repository to meet this standard: Review Rails security warnings. Analyze Rails controllers, models and views for unsafe data flow. Triage warnings by confidence and link each accepted exception to a review decision. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://brakemanscanner.org/) for configuration and prerequisites.

## Worked check

For the illustrated Active Record query, locate the interpolated request value in the finding, replace interpolation with bound parameters, and recheck the same query for that warning.

[Evidence and example](https://brakemanscanner.org/docs/warning_types/sql_injection/)

## Tool invocation

```
bundle exec brakeman
```
