Modal Platform
platform.modal
Protects against destructive Modal CLI operations that can delete or wipe Modal Volumes, Secrets, Apps, Containers, Environments, Dicts, or Queues. Catches commands even when `-y`/`--yes` is passed to bypass interactive confirmation.
- 12blocking rules
- 14safe patterns
- 5Critical
- 5High
- 2Medium
[packs]
enabled = ["platform.modal"]Evaluated when a command contains modal.
Blocking rules
Each rule ID is platform.modal:<name>. Use it in allowlists and [policy.rules].
Criticalmodal-dict-deletemodal dict delete removes a named Modal Dict and all its data.
Explanation
Deleting a Modal Dict can destroy authoritative state that an app treats as a transient cache when it actually is not. Agents passing --yes bypass Modal's confirmation prompt entirely.
Criticalmodal-environment-deletemodal environment delete schedules removal of an entire Modal environment.
Explanation
Deleting a Modal environment removes the environment and every Modal app inside it — irrecoverable. Agents passing --yes bypass Modal's confirmation prompt entirely.
Criticalmodal-queue-deletemodal queue delete removes a named Modal Queue and all its data.
Explanation
Deleting a Modal Queue discards every message currently in flight or buffered. Agents passing --yes bypass Modal's confirmation prompt entirely.
Criticalmodal-secret-deletemodal secret delete permanently removes a published Modal Secret.
Explanation
Deleting a Modal Secret can immediately break every running app that references it (API keys, DB credentials, OAuth tokens). Agents passing --yes bypass Modal's confirmation prompt entirely.
Criticalmodal-volume-deletemodal volume delete removes a Modal Volume and all data inside it.
Explanation
Deleting a Modal Volume destroys persistent ML artifacts: model weights, datasets, checkpoints. There is no undo. Agents passing --yes bypass Modal's confirmation prompt entirely.
Highmodal-app-stopmodal app stop terminates a Modal app and its running containers.
Explanation
Stopping a Modal app permanently stops it and terminates running containers; in-progress inputs are lost or reassigned. Use `modal app rollback` to roll back without stopping.
Highmodal-container-stopmodal container stop terminates a running Modal container and reassigns inputs.
Explanation
Stopping a Modal container interrupts in-flight work. The platform may reassign inputs, but exactly-once semantics are not guaranteed.
Highmodal-dict-clearmodal dict clear empties a Modal Dict.
Explanation
Clearing a Modal Dict deletes every entry but leaves the Dict object. If the Dict holds authoritative state, this is data loss.
Highmodal-queue-clearmodal queue clear drains every message from a Modal Queue.
Explanation
Clearing a Modal Queue drops every buffered message. If consumers have not yet processed them, the work is lost.
Highmodal-volume-rm-recursivemodal volume rm -r recursively deletes files inside a Modal Volume.
Explanation
Recursive `modal volume rm` can wipe entire subdirectories of persistent storage (datasets, checkpoints). Catastrophic when the target is wrong.
Mediummodal-secret-create-forcemodal secret create --force overwrites an existing Modal Secret in place.
Explanation
Overwriting a Secret with --force changes the value used by every app that references it on next cold start — common cause of unintended prod credential rotation.
Mediummodal-volume-rmmodal volume rm deletes a file inside a Modal Volume.
Explanation
Single-file deletion inside a Volume is recoverable only if you have an external copy. Verify the target path before running.
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
modal-volume-listmodal-volume-getmodal-volume-createmodal-app-readonlymodal-container-readonlymodal-secret-listmodal-secret-create-no-forcemodal-environment-listmodal-environment-mutatemodal-dict-readonlymodal-queue-readonlymodal-shellmodal-deploymodal-token