[[command]]
name = "gpg"
description = "GNU Privacy Guard — OpenPGP encryption and signing. The CLI is flag-driven (commands like --list-keys, --encrypt, --sign appear as long flags). This carve-out covers the read-only inspection flags: --list-keys / -k / --list-public-keys, --list-secret-keys / -K, --list-sigs, --check-sigs, --fingerprint, --list-trustdb, --list-config, --list-options, --print-md, --version, --help. Encrypt / decrypt / sign / key-management / network keyserver flags are not part of the safe surface here — those are mutating or external-system operations and should be invoked deliberately by the user."
url = "https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html"
researched_version = "GnuPG 2.x"
level = "SafeRead"
bare = false
examples_safe = ["gpg --list-keys", "gpg -k", "gpg --fingerprint", "gpg --version"]
examples_denied = ["gpg -d secret.gpg", "gpg --decrypt secret.gpg", "gpg secret.gpg", "gpg --verbose secret.gpg"]
# gpg with a positional file but NO inspection command is an IMPLICIT decrypt/verify (`gpg secret.gpg`
# default-decrypts the file) — not a read. Require one of the inspection commands (or --version); a
# positional-only invocation then denies. `--help`/`-h` are accepted bare by the dispatcher.
require_any = [
"--check-sigs", "--check-trustdb", "--fingerprint",
"--list-config", "--list-keys", "--list-public-keys",
"--list-secret-keys", "--list-sigs", "--list-trustdb",
"--print-md", "--show-keys", "--show-sigs", "--version",
"-K", "-k",
]
standalone = [
"--check-sigs", "--check-trustdb",
"--fingerprint", "--help",
"--list-config", "--list-keys",
"--list-options", "--list-public-keys",
"--list-secret-keys", "--list-sigs",
"--list-trustdb", "--no-tty", "--print-md",
"--quiet", "--show-keys", "--show-sigs",
"--verbose", "--version",
"-K", "-h", "-k", "-q", "-v",
]
valued = [
"--digest-algo",
"--homedir", "--keyring",
]
# `-d`/`--decrypt` decrypts a message and writes the PLAINTEXT to stdout — a secret disclosure to the
# model. Not in the allowlist above (so it was already denied as an unknown flag); classifying it as
# `decrypt-read` denies it below yolo but makes it reachable at a yolo ceiling, consistent with the
# other decrypt-to-screen tools. Both spellings listed.
[[command.flag]]
name = "-d"
classifies = "decrypt-read"
fact = "`gpg -d`/`--decrypt` decrypts the input and writes the PLAINTEXT to stdout — the decrypted content enters the caller's context."
source = "https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html (--decrypt)"
[[command.flag]]
name = "--decrypt"
classifies = "decrypt-read"
fact = "`gpg --decrypt` decrypts the input and writes the PLAINTEXT to stdout — the decrypted content enters the caller's context."
source = "https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html (--decrypt)"
[[command.flag]]
name = "--decrypt-files"
classifies = "decrypt-read"
fact = "`gpg --decrypt-files` decrypts each named file — a batch decrypt of secret material, classified like `--decrypt` for consistency (it was already denied as a non-inspection command)."
source = "https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html (--decrypt-files)"