How to Configure Make MongoDB Prevent Delete
To make mongodb prevent delete actions in Make workflows, assign a custom database role. This role must exclude the remove and dropCollection privilege actions on your collections. Teams often link Make scenarios to databases using standard read and write roles. Those broad roles allow an automation error to wipe out production records in seconds. How to make mongodb prevent delete with roles MongoDB controls database access through role-based rules. Each role grants permission to run specifi
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
To make mongodb prevent delete actions in Make workflows, assign a custom database role. This role must exclude the remove and dropCollection privilege actions on your collections. Teams often link Make scenarios to databases using standard read and write roles. Those broad roles allow an automation error to wipe out production records in seconds.
How to make mongodb prevent delete with roles
MongoDB controls database access through role-based rules. Each role grants permission to run specific actions on defined database resources. A role applies to the database where you define it. You can scope these rules down to an individual collection level.
MongoDB Atlas users have different built-in roles than self-hosted database users. Still, both setups build roles from the exact same set of privilege actions. When teams connect a Make workflow, they usually pick from two common built-in options.
The built-in read role grants read access to all non-system collections. It includes actions like find, listCollections, listIndexes, dbStats, collStats, and changeStream. It leaves out insert, update, remove, and dropCollection. This blocks deletes, but it also stops Make from adding new records.
To let Make write data, admins often switch to the built-in readWrite role. That role includes everything in the read role plus data change rights. Its actions include insert, update, remove, createCollection, createIndex, dropIndex, and dropCollection. Because readWrite bundles insert with remove, any Make module using it can delete data.
To block deletes while keeping writes, you must build a custom role. You grant the read actions alongside the insert and update actions. You leave out remove and dropCollection from the role definition. Then you assign this custom role to the database user for Make.
Why static database roles fall short in Make
A custom role stops Make from running remove commands on a collection. Yet static database roles only check who logs in at the start. They do not inspect what individual queries do while in flight. This leaves major gaps for teams running automated workflows.
MongoDB Authentication & Authorization + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
First, Make scenarios still need update rights to modify existing documents. A bad filter in an update module can overwrite thousands of records with blank values. To the database, that action looks like a valid update rather than a delete. The custom role lets the destructive update run without any warning.
Second, Make stores database login keys inside its scenario settings. If several workflows share one database user, they all share the same permissions. Rotating those static keys means updating every single Make scenario by hand.
Third, database roles cannot hide sensitive fields inside query results. When a Make module runs a find action, it pulls full documents. Those documents often hold emails, phone numbers, card numbers, or national IDs. Static roles cannot rewrite matched fields in results before they reach Make logs.
Managing custom roles across multiple collections
Some Make workflows need to clean up temporary staging tables during a run. Other steps in the same workflow must never delete from core customer collections. You can handle this by scoping your custom role at the collection level.
You grant insert and update actions on the core customer collections. Then you grant the remove action only on the temporary staging collection. If you prefer simpler rules, create two separate database users for Make. Give one user the insert-only role and the other user full staging rights. Splitting users limits the blast radius if a workflow step fails.
Inspect MongoDB wire traffic in flight
Built-in MongoDB roles govern collection access at setup time. They cannot score command risk per call or mask sensitive document values on the fly. By design, hoop.dev is an open-source proxy that sits next to MongoDB as a sidecar for your MongoDB. It reads every command from mongosh, drivers, or agent tools.
First, hoop.dev guardrails block bad deletes, drops, and write pipelines. Next, hoop.dev data masking rewrites sensitive values in returned documents based on your rules and logs each decision. Explore the repo on GitHub.
Frequently asked questions
Does the built-in read role block delete actions in MongoDB?
Yes, the built-in read role leaves out the remove and dropCollection actions. Still, it also blocks insert and update actions, so Make cannot write new data.
Why does the readWrite role allow Make to delete data?
The built-in readWrite role bundles insert and update actions with remove and dropCollection. Any Make scenario using a readWrite user can delete documents or drop entire collections.
Can I block deletes on just one MongoDB collection?
Yes, MongoDB roles support access rules down to the collection level. You can allow insert and update on one collection while leaving out the remove action.
Related guides
In this post