safe-chains 0.220.0

Auto-allow safe bash commands in agentic coding tools
Documentation
[[command]]
name = "rustup"
description = "Rust toolchain installer and manager; supports listing components, targets, toolchains, opening docs, and delegating via run."
url = "https://rust-lang.github.io/rustup/"
bare_flags = ["--help", "--version", "-V", "-h"]

examples_safe = [
  "rustup target list",
  "rustup target list --installed",
  "rustup target add wasm32-unknown-unknown",
  "rustup target remove wasm32-unknown-unknown",
  "rustup component list",
  "rustup toolchain list",
  "rustup show",
]
examples_denied = [
  "rustup self update",
  "rustup update",
  "rustup toolchain install nightly",
]

[[command.sub]]
name = "component"

[[command.sub.sub]]
name = "list"
level = "Inert"
standalone = ["--help", "--installed", "-h", "-v"]
valued = ["--toolchain"]

[[command.sub]]
name = "doc"
level = "Inert"
standalone = [
    "--alloc", "--book", "--cargo", "--core", "--edition-guide",
    "--embedded-book", "--help", "--nomicon", "--path", "--proc_macro",
    "--reference", "--rust-by-example", "--rustc", "--rustdoc",
    "--std", "--test", "--unstable-book", "-h",
]
valued = ["--toolchain"]

[[command.sub]]
name = "run"
delegate_skip = 2

[[command.sub]]
name = "show"
level = "Inert"
standalone = ["--help", "--installed", "-h", "-v"]

[[command.sub]]
name = "target"

[[command.sub.sub]]
name = "list"
level = "Inert"
standalone = ["--help", "--installed", "-h", "-v"]
valued = ["--toolchain"]

# `target add` downloads the target's precompiled std (HTTP GET from
# static.rust-lang.org) and installs it into the active toolchain under
# ~/.rustup. Inbound download + local write; no user data leaves.
[[command.sub.sub]]
name = "add"
level = "SafeWrite"
standalone = ["--help", "-h"]
valued = ["--toolchain"]

# `target remove` deletes an installed target's files from the local
# toolchain. Local write only.
[[command.sub.sub]]
name = "remove"
level = "SafeWrite"
standalone = ["--help", "-h"]
valued = ["--toolchain"]

[[command.sub]]
name = "toolchain"

[[command.sub.sub]]
name = "list"
level = "Inert"
standalone = ["--help", "--installed", "-h", "-v"]
valued = ["--toolchain"]

[[command.sub]]
name = "which"
level = "Inert"
bare = false
standalone = ["--help", "-h"]
valued = ["--toolchain"]