dcg

1Password CLI

secrets.onepassword

Protects against destructive 1Password CLI operations like deleting items, documents, users, groups, and vaults.

  • 6blocking rules
  • 10safe patterns
  • 1Critical
  • 4High
  • 1Medium
~/.config/dcg/config.toml
[packs]
enabled = ["secrets.onepassword"]

Evaluated when a command contains op.

Blocking rules

Each rule ID is secrets.onepassword:<name>. Use it in allowlists and [policy.rules].

  1. op-vault-delete

    Critical

    op vault delete removes an entire vault.

    Explanation
    Deleting a vault removes all items, documents, and permissions within it. This affects all users with vault access and any applications using items from this vault. This action cannot be undone. Safer alternatives: - op item list --vault=X: Inventory vault contents - Export items and documents before deletion - Move items to a different vault instead
  2. op-connect-token-delete

    High

    op connect token delete revokes access tokens.

    Explanation
    Deleting a Connect token immediately revokes API access for integrations using it. CI/CD pipelines, deployment scripts, and applications fetching secrets will fail to authenticate until a new token is configured. Safer alternatives: - op connect token list: Document token usage first - Create new token before deleting old one - Update integrations with new token prior to deletion
  3. op-document-delete

    High

    op document delete removes secure documents (including archive operations).

    Explanation
    Deleting a 1Password document permanently removes the file (certificates, keys, configurations). Unlike items, documents may contain unique binary data that cannot be recreated from memory. Safer alternatives: - op document get: Download document before deletion - op document delete --archive: Move to archive for recovery - Back up to secure local storage first
  4. op-item-delete

    High

    op item delete removes secret items (including archive operations).

    Explanation
    Deleting a 1Password item permanently removes the secret (passwords, API keys, credentials). Without --archive, this cannot be undone. Applications and users relying on this item will lose access to the stored credentials. Safer alternatives: - op item get: Export item fields before deletion - op item delete --archive: Move to archive for recovery - Verify no applications reference this item
  5. op-user-delete

    High

    op user delete removes a user from 1Password.

    Explanation
    Deleting a user revokes their access to all vaults and items. Any private vaults owned by the user may be transferred or lost. Service accounts and integrations created by this user may also be affected. Safer alternatives: - op user suspend: Suspend instead of delete for recovery - op user get: Document user permissions first - Transfer vault ownership before deletion
  6. op-group-delete

    Medium

    op group delete removes a group.

    Explanation
    Deleting a group removes the permission boundary and all vault assignments. Members lose access to vaults shared through this group. This affects team organization and access control policies. Safer alternatives: - op group list: Review group membership first - Reassign vault permissions to individual users - Create replacement group before deleting old one

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • op-whoami
  • op-account-get
  • op-read
  • op-item-get
  • op-item-list
  • op-document-get
  • op-vault-list
  • op-vault-get
  • op-user-list
  • op-group-list