DEV Community

Riven Desk
Riven Desk

Posted on

The AI PR that fixed auth by granting a broader role

I keep seeing this in agent-written PRs.

The ticket said a user hit a 403 or a missing permission. The agent “fixed” it. CI is green. The demo user can reach the page now. Then you read the diff and the real change is not a tighter check for the intended role. It is a broader grant: admin instead of editor, a wildcard instead of a scoped permission, or the authorization gate removed “for now” so the happy path works.

You did not ask for everyone to get in. You asked for the right person to get in.

The 60-second check I run now

When an agent PR claims to fix a 403, forbidden, or permission bug:

  1. Diff the auth change. Did it tighten the intended path, or widen who is allowed?
  2. Ask what a least-privilege fix looks like for this ticket. If the PR cannot name the minimum role or claim that should pass, bounce it.
  3. If the only change is “grant more” or “skip the check,” I reject it until the intended role works and a test covers the still-forbidden case.

This is one of the stops on a short bar I use before I merge agent PRs. Free one-pager if you want the rest: https://chopragunji.gumroad.com/l/zpnmdn

If you'd rather someone else do a hard pass on one scary AI PR, I still have founding slots at $49 (normally $99): https://chopragunji.gumroad.com/l/byoyi/FOUNDING

Have you merged an agent “auth fix” that was really a privilege widen?

Top comments (0)