Skip to content

v0.18.0

Latest

Choose a tag to compare

@Dicklesworthstone Dicklesworthstone released this 05 Dec 20:22
· 8 commits to main since this release

What's Changed in v0.18.0

New configuration

  • Declared heredoc data receivers (#684): a [[heredoc.data_receivers]] entry in the user, system or an explicit DCG_CONFIG file names a program, and optionally its subcommands, that reads stdin as data, so the quoted body of mytool search - <<'EOF' is not judged as shell. The program and subcommand words must match in the command as submitted; wrappers, rebound or path-spoofed programs, nested shell scripts, unquoted delimiters, here-strings and pipelines that run the output get no exemption. A repository's .dcg.toml cannot add receivers. See docs/configuration.md.
  • Operator-set denial trailer (#679): [output] denial_trailer = "..." replaces the closing instruction of every denial reason an agent reads, and [rules."<pack_id>:<pattern_name>"] denial_trailer sets it for one rule. Wording only; the command is still denied. A repository .dcg.toml cannot set it.

Protection

  • rimraf is reviewed like rm -rf (#675): the new core.filesystem:rimraf-general rule denies rimraf of anything outside a literal temp directory, also through npx, pnpx, bunx, npm exec, pnpm, yarn and bun. trash, trash-put, gio trash and moves into a Trash directory are denied for an empty, dynamic, current-directory, home, root or broad operand. If your agents run rimraf dist, they will now get a denial; allowlist the command or the rule if that is intended.
  • tmux server protection (#686): the opt-in system.processes pack denies tmux kill-server and tmux kill-session. Machines that already enable the pack get these rules on upgrade.
  • kill -1 (#676): a -1 after a PID (kill 12345 -1) is now denied; the explanation now says a leading -1 is SIGHUP.
  • Hardened heredoc pipeline evaluation.
  • Variable assignments are credited only where the shell applies them when dcg resolves rm, mv and redirect targets, and embedded-code analysis that runs out of its structural bounds is reported as incomplete, never as clean.

Antigravity (agy) and dcg doctor

  • Windows (#677): dcg install --agy writes a handler that cmd.exe can run.
  • Linux and macOS (#685): install.sh registers a detected Antigravity (skipped with --no-configure), and both installers check the registration before reporting protection. dcg doctor checks the effective run_command registration across user and workspace hook files and repairs missing or disabled dcg hooks without touching other handlers.
  • dcg doctor reports custom packs that fail to load, and an inherited DCG_BYPASS, as errors.

False positives fixed

  • A new home-directory file created with > next to a stderr redirect such as 2>/dev/null (#681).
  • A heredoc given to a script or ssh 'bash -s' whose body mentions another language (#687).
  • A literal-bound executable in a pipeline, such as T=/usr/bin/true; $T -d | cat (#680).
  • Literal Python in a read-only final pipeline filter, including a backtick (#653).
  • Python heredocs that write prose to documentation files with pathlib or append text with += (#664).
  • Python helpers that read a known file, and clearer reporting of structural analysis limits (#673).
  • A quoted heredoc fed to node with runtime options such as --input-type=module (#674).

Allowlists and installer

  • A rule allowlist entry for heredoc.posix:substitution-unverified now takes effect, waiving only the substitutions dcg could not parse (#661). dcg corpus --use-allowlist runs a corpus against the active allowlist.
  • install.sh recovers a lock left with an empty or missing pid file instead of failing with "Another installer is running".

Dependencies

  • toml 1.2.3, toml_edit 0.25.21, sha2 0.11.2, vergen-gix 10.1.0.

See CHANGELOG.md for details.

Installation

curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh" | bash -s -- --easy-mode

Or via Homebrew / Scoop:

brew install dicklesworthstone/tap/dcg
# or upgrade:
brew upgrade dcg
scoop update
scoop install dcg

Verification

All release archives, installers, and SHA256SUMS are signed with Minisign (keyid: 69B3955C8D2E62A8):

minisign -Vm SHA256SUMS -P RWSoYi6NXJWzaRs1mJmOwwXrZfPWcq6MXnQlNMLBYKzlIQTLwuVQG6uO
sha256sum -c SHA256SUMS --ignore-missing

Full Changelog: v0.17.2...v0.18.0