# Core allowlist: generic safe commands that don't belong to any domain

allowlists:
  commands:
    # ── Always safe: read-only / output-only ──────────────────────
    - { command: cd, trust: minimal }
    - { command: ls, trust: minimal }
    - { command: echo, trust: minimal }
    - { command: pwd, trust: minimal }
    - { command: whoami, trust: minimal }
    - { command: date, trust: minimal }
    - { command: cat, trust: minimal }
    - { command: head, trust: minimal }
    - { command: tail, trust: minimal }
    - { command: wc, trust: minimal }
    - { command: file, trust: minimal }
    - { command: which, trust: minimal }
    - { command: type, trust: minimal }
    - { command: basename, trust: minimal }
    - { command: dirname, trust: minimal }
    - { command: realpath, trust: minimal }
    - { command: readlink, trust: minimal }
    - { command: stat, trust: minimal }
    - { command: du, trust: minimal }
    - { command: printf, trust: minimal }
    - { command: md5sum, trust: minimal }
    - { command: sha256sum, trust: minimal }
    - { command: sha1sum, trust: minimal }
    - { command: cksum, trust: minimal }
    - { command: "true", trust: minimal }
    - { command: "false", trust: minimal }
    - { command: sleep, trust: minimal }
    - { command: grep, trust: minimal }
    - { command: rg, trust: minimal }
    - { command: find, trust: minimal }
    - { command: tree, trust: minimal }
    - { command: xargs, trust: minimal }
    - { command: fd, trust: minimal }
    - { command: sort, trust: minimal }
    - { command: uniq, trust: minimal }
    - { command: tr, trust: minimal }
    - { command: cut, trust: minimal }
    - { command: diff, trust: minimal }
    - { command: jq, trust: minimal }
    - { command: yq, trust: minimal }
    - { command: test, trust: minimal }
    - { command: column, trust: minimal }
    - { command: nl, trust: minimal }
    - { command: tac, trust: minimal }
    - { command: rev, trust: minimal }
    - { command: paste, trust: minimal }
    - { command: join, trust: minimal }
    - { command: comm, trust: minimal }
    - { command: cmp, trust: minimal }
    - { command: strings, trust: minimal }
    - { command: xxd, trust: minimal }
    - { command: hexdump, trust: minimal }
    - { command: od, trust: minimal }
    - { command: base64, trust: minimal }
    - { command: time, trust: minimal }
    - { command: read, trust: minimal }
    # ── System info: read-only ───────────────────────────────────────
    - { command: env, trust: minimal }
    - { command: printenv, trust: minimal }
    - { command: uname, trust: minimal }
    - { command: hostname, trust: minimal }
    - { command: id, trust: minimal }
    - { command: groups, trust: minimal }
    - { command: df, trust: minimal }
    - { command: ps, trust: minimal }
    - { command: pgrep, trust: minimal }
    - { command: pstree, trust: minimal }
    - { command: lsof, trust: minimal }
    - { command: nproc, trust: minimal }
    - { command: getconf, trust: minimal }
    - { command: locale, trust: minimal }
    - { command: uptime, trust: minimal }
    # ── Pagers and viewers ───────────────────────────────────────────
    - { command: less, trust: minimal }
    - { command: more, trust: minimal }
    - { command: man, trust: minimal }
    - { command: info, trust: minimal }
    # ── Modern CLI alternatives ──────────────────────────────────────
    - { command: bat, trust: minimal }
    - { command: exa, trust: minimal }
    - { command: eza, trust: minimal }
    - { command: delta, trust: minimal }
    - { command: tokei, trust: minimal }
    - { command: cloc, trust: minimal }
    - { command: scc, trust: minimal }
    - { command: hyperfine, trust: minimal }
    - { command: ag, trust: minimal }
    - { command: ack, trust: minimal }
    # ── Transparent wrappers: inner command evaluated separately ──
    - { command: timeout, trust: minimal }
    - { command: nice, trust: minimal }
    - { command: nohup, trust: standard, reason: "Runs a command immune to hangup signals" }
    - { command: strace, trust: standard, reason: "Traces system calls made by a process" }
    - { command: command, trust: minimal }
    - { command: builtin, trust: minimal }
    # NOTE: source/. are intentionally NOT allowlisted here.
    # secrets.yaml deny rules only cover cat/less/more/head/tail/bat,
    # so allowlisting source would let `source ~/.ssh/id_rsa` through.
    # Projects that need source allowlisted should do so per-project.
    # ── Always safe: dev tools (no publish risk) ──────────────────
    - { command: make, trust: standard, reason: "Runs build targets from a Makefile" }
    - { command: cmake, trust: standard, reason: "Generates build system files from CMakeLists" }
    - { command: rustc, trust: standard, reason: "Compiles Rust source code" }
    - { command: java, trust: standard, reason: "Runs a Java application" }
    - { command: javac, trust: standard, reason: "Compiles Java source files" }
    # ── Always safe: filesystem ops (secrets caught by rules) ─────
    - { command: mkdir, trust: standard, reason: "Creates directories" }
    - { command: mktemp, trust: standard, reason: "Creates temporary files or directories" }
    - { command: touch, trust: standard, reason: "Creates files or updates timestamps" }
    - { command: ln, trust: standard, reason: "Creates hard or symbolic links" }
    - { command: cp, trust: standard, reason: "Copies files and directories" }
    - { command: mv, trust: standard, reason: "Moves or renames files and directories" }
    - { command: tee, trust: standard, reason: "Reads stdin and writes to files and stdout" }
    - { command: tar, trust: standard, reason: "Creates or extracts tar archives" }
    - { command: gzip, trust: standard, reason: "Compresses files using gzip" }
    - { command: gunzip, trust: standard, reason: "Decompresses gzip files" }
    - { command: zip, trust: standard, reason: "Creates zip archives" }
    - { command: unzip, trust: standard, reason: "Extracts zip archives" }
    # ── Always safe: text processing ──────────────────────────────
    - { command: sed, trust: standard, reason: "Edits text via stream transformations" }
    - { command: awk, trust: standard, reason: "Processes and transforms structured text" }
    - { command: patch, trust: standard, reason: "Applies diff patches to files" }
    # ── Checksums ──────────────────────────────────────────────────
    - { command: shasum, trust: minimal }
    # ── Network diagnostics: read-only ─────────────────────────────
    - { command: ping, trust: minimal }
    - { command: dig, trust: minimal }
    - { command: nslookup, trust: minimal }
    - { command: host, trust: minimal }
    - { command: traceroute, trust: minimal }
    - { command: tracepath, trust: minimal }
    - { command: netstat, trust: minimal }
    - { command: ss, trust: minimal }
    # ── Network tools: read-only subcommands only ──────────────────
    - { command: "ip addr show", trust: minimal }
    - { command: "ip addr list", trust: minimal }
    - { command: "ip link show", trust: minimal }
    - { command: "ip link list", trust: minimal }
    - { command: "ip route show", trust: minimal }
    - { command: "ip route list", trust: minimal }
    - { command: "ip route get", trust: minimal }
    - { command: "ip neigh show", trust: minimal }
    - { command: "ip neigh list", trust: minimal }
    - { command: "ip rule show", trust: minimal }
    - { command: "ip rule list", trust: minimal }
    - { command: "arp -a", trust: minimal }
    - { command: "route -n", trust: minimal }
    # ── tmux: read-only invocations ──────────────────────────────────
    - { command: "tmux list-sessions", trust: minimal }
    - { command: "tmux ls", trust: minimal }
    - { command: "tmux list-windows", trust: minimal }
    - { command: "tmux list-panes", trust: minimal }
    - { command: "tmux capture-pane", trust: minimal }
    - { command: "tmux display-message", trust: minimal }
    - { command: "tmux show-options", trust: minimal }
    - { command: "tmux show-environment", trust: minimal }
    - { command: "tmux has-session", trust: minimal }
    # Note: tmux mutating operations (send-keys, new-session, kill-session, etc.)
    # are intentionally NOT allowlisted — they default to ask.
    # ── longline: project CLI ──────────────────────────────────────
    - { command: longline, trust: minimal }

rules: []
