Skip to content

backend-guard.mjs

  • Event: PreToolUse Edit/Write
  • Type: wall: blocks the action and says why (exits with code 2)

BLOCKS introducing: destructive migrations in the part that gets applied (dropping or renaming columns or tables: expand → contract pattern), env() outside config/ in Laravel, personal data in logs (whole request, bodies, passwords or tokens), migrations without an honest down(), mass assignment (the whole request into the model) and swallowed errors (empty catch, except: pass). WARNS about several writes in the same function without a transaction and about a query inside a loop (N+1). Escape: senzu-allow with the reason.

See the code of backend-guard.mjs on GitHub