# Command parsing and "allow always" rules are conservative Status: accepted ## Context Read-only commands run without a prompt and "allow always" persists patterns. A permissive parser or glob would let a harmless-looking prefix authorise a dangerous chain, e.g. `cargo test && rm -rf ~`. ## Decision - The auto-run read-only list deliberately omits `env`, `xargs`, `sed`, `cargo`, `curl` (they exec, write or reach the network). - The chain splitter accepts only `|`, `&&`, `;` and the redirects `2>&1` / `>/dev/null`. Anything else the shell would interpret (`||`, `&`, `$`, backticks, parens, `<`, `>`, newlines, open quotes) returns `None` and asks. - `cd` is free: it only matters for what follows, which is checked on its own. - "Allow always" stores one rule per non-read-only segment (first word plus subcommand, e.g. `bash:cargo test *`), joined by newlines; risky segments store their exact text; unparsable commands get no rule. A rule therefore cannot cover a chain it was not granted for. File tools get no rule; the prompt offers "allow all edits this session". ## Consequences Heredocs, `{}` groups and similar always prompt. Rules are coarse globs. Code: crates/hx-core/src/permit.rs (READONLY list, `split_chain`, `cd` handling, `rule`)