# Require Spring method security before a scoped order mutation: Perch rule pack

Published by Perch / Verglas LLC. Source tutorial: https://frameworkrecipes.dev/spring-boot/method-write-permission/

Extract from your application repository root with unzip -n. The pack adds .perch/rules/perch-guide-spring-boot-method-write-permission.yaml and preserves existing files. Keep your root perch.yaml. Review and adapt each where selector to your application's paths before running a check.

Install: npm install -g @lakeday/perch
Sign in: perch login
Choose your agent: perch setup claude-code, perch setup codex, perch setup cursor, or perch setup pi.

Checks:
perch check src/main/java/example/CancelOrder.java --rules method-security-write-authority --json

Run a check after the agent's edit, inspect findings, fix the implementation, and run the identical check again. Exit 3 is a finding; exits 1 and 2 are incomplete checks. Keep the application's regression tests as separate gates. Commit the rule and agent configuration. Fresh judgments can vary; unchanged requests reuse cached answers.
