Skip to content

Releases: AnswerDotAI/safecmd

v0.1.0

11 Jan 00:31

Choose a tag to compare

Breaking Changes

Refactor: Replace operator blocking with destination-based redirect validation

Major changes:

  • Remove ok_ops allowlist; all operators now permitted
  • Add ok_dests allowlist for output redirect destinations (default: ./, /tmp)
  • extract_commands() now returns 3-tuple: (commands, operators, redirects)
  • New collect_redirects() extracts write redirect destinations from AST
  • New normalize_dest()/validate_dest() resolve paths to absolute before matching,
    preventing path traversal attacks (./.. , ./subdir/../../escape)
  • Rename DisallowedOps -> DisallowedDest

CmdSpec improvements:

  • Detect denied flags in combined short flags (e.g., -xvfI matches -I)
  • Match long flags with =value (e.g., --to-command=cat matches --to-command)

API changes:

  • safe_run/validate: ops param -> dests param
  • add_allowed_ops/rm_allowed_ops -> add_allowed_dests/rm_allowed_dests
  • bash/unsafe_bash: rm_ops -> rm_dests, add_ops -> add_dests
  • Extract validate() function for reusable command validation (#6)

v0.0.6

29 Dec 04:22

Choose a tag to compare

New Features

  • Add safecmd console script (#5)

v0.0.5

28 Dec 23:10

Choose a tag to compare

New Features

  • Add ignore_ex to safe_run, and add fd redirect ops (#4)

v0.0.4

23 Dec 02:54

Choose a tag to compare

New Features

  • Add tools (#3)

v0.0.3

22 Dec 20:34

Choose a tag to compare

New Features

  • Add = op; add deny lists for rg, tar, and curl (#2)

v0.0.2

21 Dec 05:57

Choose a tag to compare

New Features

  • Add builtins; new params to add/rm cmds/ops (#1)

v0.0.1

21 Dec 00:02

Choose a tag to compare

  • init release