dcg

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
~/.config/dcg/config.toml
[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].

  1. modal-dict-delete

    Critical

    modal 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.
  2. modal-environment-delete

    Critical

    modal 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.
  3. modal-queue-delete

    Critical

    modal 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.
  4. modal-secret-delete

    Critical

    modal 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.
  5. modal-volume-delete

    Critical

    modal 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.
  6. modal-app-stop

    High

    modal 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.
  7. modal-container-stop

    High

    modal 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.
  8. modal-dict-clear

    High

    modal 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.
  9. modal-queue-clear

    High

    modal 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.
  10. modal-volume-rm-recursive

    High

    modal 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.
  11. modal-secret-create-force

    Medium

    modal 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.
  12. modal-volume-rm

    Medium

    modal 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-list
  • modal-volume-get
  • modal-volume-create
  • modal-app-readonly
  • modal-container-readonly
  • modal-secret-list
  • modal-secret-create-no-force
  • modal-environment-list
  • modal-environment-mutate
  • modal-dict-readonly
  • modal-queue-readonly
  • modal-shell
  • modal-deploy
  • modal-token