Repository navigation
v0.4.0
Security audit + UX pass. Breaking in a few narrow places but safer everywhere.
Security
- Risk gate rewritten with segment-aware parsing so command substitutions (
$(rm ...),<(rm ...),>(rm ...), backticks) and process substitution now classify correctly instead of silently bypassing as Safe. - Whitespace obfuscation blocked —
rmhidden by tabs,$IFS,${IFS}is caught. - Interpreter guard —
python -c,perl -e,node -e,ruby -e,awk 'BEGIN{...'surface Warn so obfuscated destructive calls don't land as Safe. - Decoded shell pipes blocked —
base64 -d | sh,xxd -r | bash,openssl enc -d | shnow Block. - More destructive primitives blocked —
truncate,: > file,true > file,cp /dev/null target,git reset --hard,git clean -fd,git push --force. rmfalse-positive fixed — v0.3 blocked anything containing the tokenrm(includinggrep rm logfile). v0.4 only blocks whenrmis a command-position first token of a segment.- Content filter expanded — fine-grained GitHub PATs (
ghu_,ghs_,ghr_,github_pat_), Stripe, SendGrid, HuggingFace, JWT, Google service-account JSON, Azure storage, and any URL with embedded credentials (scheme://user:pass@host). - Codex tempfile hardened — replaced predictable
/tmp/ait-codex-<pid>.txtwithtempfile::NamedTempFile(O_EXCL, mode 0600, auto-cleanup on Drop). Closes a symlink/TOCTOU vector. - Codex prompt via stdin — was visible in
ps//proc/<pid>/cmdline; now piped via stdin. - HTTP response size cap (1 MiB) — OpenRouter and direct Anthropic API responses are Content-Length-checked and capped during read.
- ANSI escape sanitization — model output and backend error text is stripped of ESC sequences (CSI / OSC) before display, closing OSC-52 clipboard-injection.
hey doctorno longer leaks key body — shows only the public prefix (sk-or-v1-****).- 19 unit tests added for the risk gate.
UX
hey doctor— new diagnostic subcommand. Shows detected backends, preset tools, shell/TTY state, env-var config, and the active auto chain.hey init <shell>— emits a shell completion script (bash / zsh / fish / powershell / elvish).- Stdin prompt support —
echo "list docker containers" | hey --yes. Requires--yesor--dry-runsince confirm can't read. - EOF = abort — pressing Ctrl-D (or piping
hey foo < /dev/null) now aborts withaborted (no input)instead of silently running. - Warn requires explicit
y— forRisk::Warncommands the default is capitalN; blank Enter aborts. - Stdout-not-TTY refusal —
hey foo | headused to hang; now errors with a suggestion to pass--yesor--dry-run. - Edit → copy & edit in shell —
eat the confirm prompt copies the command to your clipboard, reports whether the copy succeeded, and aborts. Paste in your shell for readline editing. - Richer help text and error messages —
--helpdocuments subcommand-style backend selection;OPENROUTER_API_KEY not setpoints atopenrouter.ai/keys; Claudenot authenticatedsurfacesclaude login. - Narrow-terminal-safe thinking animation — uses
\x1b[Jso wrapped lines don't leave cruft on <70-col terminals.
Breaking changes
orshorthand foropenrouterremoved — too ambiguous with the English preposition.- Backend subcommand matching is now case-sensitive lowercase —
hey Claude is fastis a prompt. Risk::Warnno longer defaults to Yes on blank Enter.- EOF on the confirm prompt aborts instead of running.
hey foo | headrefuses without--yes/--dry-run.