DEV Community

I Build Custom WordPress Plugins With AI Every Day. Here’s What I Still Don’t Let It Decide.

Areesha Hanif on November 20, 2026

In September 2026, AI agents opened more than 40% of all pull requests on GitHub. Back in March, it was 17% (GitHub Octoverse 2026). Honestly? Not...
Collapse
 
nexusverify profile image
Nexus Verify •

That is_user_logged_in() check on your CRM AJAX handler is the one I'd retest first, because it lets any subscriber edit client records, not just an admin. The check I'd add is to call that handler directly as a subscriber on staging, bypassing the UI, and to grep your other AJAX handlers for the same is_user_logged_in() pattern, since that shortcut usually repeats. Any handler that updates records needs a current_user_can() check for that specific CRM capability, not just a login check.

Collapse
 
areesha_hanif profile image
Areesha Hanif •

Super useful, thank you! Testing the handler directly as a subscriber is going on my checklist.

Collapse
 
nexusverify profile image
Nexus Verify •

You're welcome — and testing it directly as a subscriber is exactly the test that catches it. If that call succeeds for a subscriber with no capability check, the handler is trusting login alone. Worth also trying it logged out, to see whether it fails closed the same way.

Collapse
 
bagusvdr profile image
Bagus Ramadhan •

Everything that AI created, are sandboxed on the staging. I don't really care even if the production was build by my own hand. I only let the agent scanning the production site, not building it. This flow also makes me better knowing what works what didn't by not guessing everything that live on the production.

Collapse
 
areesha_hanif profile image
Areesha Hanif •

Love that flow! Letting the agent scan but never build on production is smart. Thanks for sharing!

Collapse
 
alexshev profile image
Alex Shev •

That boundary is healthy: AI can accelerate implementation, but it should not be the authority for product trade-offs, security posture, or the meaning of a client requirement. I would add an explicit decision log for the choices kept human-owned; it makes review and future maintenance much less dependent on memory.

Collapse
 
areesha_hanif profile image
Areesha Hanif •

A decision log is a great idea. Most of those calls live in my head right now 😅 Adding it to my process!

Collapse
 
alexcodebytes profile image
Oleksandr •

That loop—'AI writes the ability, and AI calls the ability'—is the exact security boundary most teams haven't fully internalized yet.
Whenever you expose domain logic over MCP or an Abilities API, the permission_callback stops being a boring boilerplate check and becomes your primary firewall. Agents are notoriously eager to satisfy the user's prompt; if a capability check defaults to is_user_logged_in() instead of granular object-level ownership, an agent will happily execute a destructive state change because 'it worked in the happy path.'
Also love the rule 'New Abilities start read-only.' Treating write access like a privilege that has to be explicitly opted into—and audited via raw diff, never the agent's summary—is spot on.

Collapse
 
areesha_hanif profile image
Areesha Hanif •

"Primary firewall" is exactly it. Glad the read-only rule clicked with you!

Collapse
 
alexcodebytes profile image
Oleksandr •

It's a simple rule, but it changes the whole trust model. If the agent can freely modify the same permissions and boundaries that are supposed to constrain it, those safeguards don't mean much. Keeping the authority to change those rules outside the agent is what makes the firewall meaningful.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

the is_user_logged_in() example says it all. any subscriber could have edited client records, and the code looked correct.

Collapse
 
areesha_hanif profile image
Areesha Hanif •

Exactly, it looked totally fine. That's what made it scary 😬