π Rule ID
TG-AUTH-006 (Mass Assignment and Property-Level Authorization)
β What needs improvement?
Currently, TG-AUTH-006 only provides generic JavaScript object destructuring examples. However, most modern AI-built applications use ORMs/ODMs like Prisma, Mongoose, Drizzle, or TypeORM.
π― Expected Behavior
Developers and AI agents should have copy-pasteable safe examples for popular ORMs so they don't accidentally pass raw request bodies directly into database update methods.
π‘ Suggested Solution
Add safe code snippets to rules/authorization/TG-AUTH-006-mass-assignment.md:
- Prisma: Using Zod schema parsing before
prisma.user.update().
- Mongoose: Using explicit field picking (
lodash.pick or explicit object literals) instead of passing req.body.
π Rule ID
TG-AUTH-006(Mass Assignment and Property-Level Authorization)β What needs improvement?
Currently,
TG-AUTH-006only provides generic JavaScript object destructuring examples. However, most modern AI-built applications use ORMs/ODMs like Prisma, Mongoose, Drizzle, or TypeORM.π― Expected Behavior
Developers and AI agents should have copy-pasteable safe examples for popular ORMs so they don't accidentally pass raw request bodies directly into database update methods.
π‘ Suggested Solution
Add safe code snippets to
rules/authorization/TG-AUTH-006-mass-assignment.md:prisma.user.update().lodash.pickor explicit object literals) instead of passingreq.body.