Home

Environments

This page lists the safe and destructive patterns in the Environment Managers and R Language shell guard packs. See Shell Tool for how these patterns are evaluated.

Environment Managers

Pack ID: environments.managers

Guards against destructive operations on environment and package managers

Safe patterns

Rule IDPattern
environments.managers.python_version^python[23]?\s+--version\b[^|><]*$
environments.managers.pip_list^pip[3]?\s+list\b[^|><]*$
environments.managers.pip_show^pip[3]?\s+show\b[^|><]*$
environments.managers.pip_freeze^pip[3]?\s+freeze\b[^|><]*$
environments.managers.conda_list^conda\s+list\b[^|><]*$
environments.managers.conda_env_list^conda\s+env\s+list\b[^|><]*$
environments.managers.conda_env_export^conda\s+env\s+export\b[^|><]*$
environments.managers.conda_info^conda\s+info\b[^|><]*$
environments.managers.mamba_list^mamba\s+list\b[^|><]*$
environments.managers.mamba_env_list^mamba\s+env\s+list\b[^|><]*$
environments.managers.uv_pip_list^uv\s+pip\s+list\b[^|><]*$
environments.managers.uv_pip_show^uv\s+pip\s+show\b[^|><]*$
environments.managers.spack_find^spack\s+find\b[^|><]*$
environments.managers.spack_info^spack\s+info\b[^|><]*$
environments.managers.spack_list^spack\s+list\b[^|><]*$

Destructive patterns

Rule IDReasonSuggestionConfidence
environments.managers.conda_env_removePermanently removes a Conda environment and all installed packagesUse conda env export to save the environment specification firstHigh
environments.managers.conda_clean_allRemoves all cached packages, tarballs, and index cachesUse conda clean --dry-run --all to preview what will be removedMedium
environments.managers.pip_uninstallUninstalls Python packages which may break dependent packagesUse pip show <package> to review dependents before uninstallingMedium
environments.managers.virtualenv_removeRemoves a Python virtual environment directoryBackup with pip freeze > requirements.txt before deleting the environmentMedium
environments.managers.mamba_env_removePermanently removes a Mamba/Conda environment and all installed packagesUse mamba env export to save the environment specification firstHigh
environments.managers.uv_cache_cleanRemoves the entire uv package cacheUse uv cache dir to inspect the cache location firstMedium
environments.managers.micromamba_env_removePermanently removes a Micromamba environment and all installed packagesUse micromamba env export to save the environment specification firstHigh
environments.managers.poetry_env_removeRemoves a Poetry virtual environmentUse poetry env info to review the environment firstMedium
environments.managers.pipenv_rmRemoves the Pipenv virtual environmentEnsure Pipfile.lock is committed so the environment can be recreatedMedium
environments.managers.spack_uninstall_allUninstalls all Spack packages, potentially removing shared dependenciesUninstall specific packages by name; review with spack find firstHigh

R Language

Pack ID: environments.r

Guards against destructive R package management operations

Safe patterns

Rule IDPattern
environments.r.r_version^R\s+--version\b[^|><]*$
environments.r.rscript_version^Rscript\s+--version\b[^|><]*$

Destructive patterns

Rule IDReasonSuggestionConfidence
environments.r.r_remove_packagesRemoves installed R packagesUse installed.packages() to review before removingMedium
environments.r.r_unlinkRecursively deletes files or directories from an R scriptVerify paths with list.files() before deletingMedium

This documentation was generated from rust/agents/src/tool_guard/shell/packs/environments.rs.

© 2026 Stencila