Home

Core

This page lists the safe and destructive patterns in the Filesystem, Git, Obfuscation, and Stencila shell guard packs. See Shell Tool for how these patterns are evaluated.

Filesystem

Pack ID: core.filesystem

Guards against recursive/forced file deletion and dangerous moves/overwrites

Safe patterns

Rule IDPattern
core.filesystem.ls^ls\b[^|><]*$
core.filesystem.cat^cat\b[^|><]*$
core.filesystem.bat^bat\b[^|><]*$
core.filesystem.head^head\b[^|><]*$
core.filesystem.tail^tail\b[^|><]*$
core.filesystem.less^less\b[^|><]*$
core.filesystem.wc^wc\b[^|><]*$
core.filesystem.file^file\b[^|><]*$
core.filesystem.stat^stat\b[^|><]*$
core.filesystem.find^find\b[^|><]*$
core.filesystem.du^du\b[^|><]*$
core.filesystem.df^df\b[^|><]*$
core.filesystem.tree^tree\b[^|><]*$
core.filesystem.grep^grep\b[^|><]*$
core.filesystem.rg^rg\b[^|><]*$
core.filesystem.diff^diff\b[^|><]*$
core.filesystem.sort^sort\b[^|><]*$
core.filesystem.md5sum^md5sum\b[^|><]*$
core.filesystem.sha256sum^sha256sum\b[^|><]*$
core.filesystem.realpath^realpath\b[^|><]*$
core.filesystem.dirname^dirname\b[^|><]*$
core.filesystem.basename^basename\b[^|><]*$
core.filesystem.readlink^readlink\b[^|><]*$
core.filesystem.test^test\b[^|><]*$
core.filesystem.bracket^\[[^|><]*$
core.filesystem.double_bracket^\[\[[^|><]*$
core.filesystem.cargo_check^cargo\s+check\b[^|><]*$
core.filesystem.cargo_clippy^cargo\s+clippy\b[^|><]*$
core.filesystem.go_vet^go\s+vet\b[^|><]*$
core.filesystem.env^env\b[^|><]*$
core.filesystem.printenv^printenv\b[^|><]*$
core.filesystem.which^which\b[^|><]*$
core.filesystem.whoami^whoami\b[^|><]*$
core.filesystem.uname^uname\b[^|><]*$
core.filesystem.pwd^pwd\b[^|><]*$
core.filesystem.echo^echo\b[^|><]*$
core.filesystem.date^date\b[^|><]*$
core.filesystem.hostname^hostname\b[^|><]*$
core.filesystem.id^id\b[^|><]*$
core.filesystem.groups^groups\b[^|><]*$
core.filesystem.mkdir^mkdir\b[^|><]*$
core.filesystem.touch^touch\b[^|><]*$

Destructive patterns

Rule IDReasonSuggestionConfidence
core.filesystem.recursive_delete_rootRecursive deletion of root, home, or system directorySpecify the exact subdirectory to deleteHigh
core.filesystem.recursive_delete_forceForced recursive deletion can destroy entire directory trees without confirmationDelete specific files by name, or remove the -f flag and specify exact pathsHigh
core.filesystem.recursive_deleteRecursive deletion can destroy directory treesDelete specific files by name, or list directory contents first with ls -laMedium
core.filesystem.find_destructivefind with action flags can delete or execute arbitrary commands on matched filesUse find to list matching files first (find . -name '*.tmp'), review the output, then delete specific files by nameMedium
core.filesystem.mv_system_pathMoving system directories can break the OSMove specific files within subdirectories insteadMedium
core.filesystem.shred_deviceShredding devices causes permanent data lossThis operation should not be performed by an agentHigh
core.filesystem.chmod_broadRecursive or overly permissive chmod can break system securitySet specific permissions on specific files (e.g., chmod 644 file)Medium
core.filesystem.chown_recursiveRecursive chown on system directories can break the OSChange ownership of specific files onlyMedium
core.filesystem.overwrite_truncateOverwriting or appending to system files can break the OSUse sudo tee with explicit paths, or edit specific config filesMedium
core.filesystem.sensitive_readReading sensitive files (credentials, private keys, auth tokens) can leak secrets into the agent's context windowUse targeted commands that don't expose raw secrets (e.g., ssh-keygen -l -f ~/.ssh/id_rsa to check a key fingerprint)Medium

Git

Pack ID: core.git

Guards against destructive git operations that lose history or modify remote state

Safe patterns

Rule IDPattern
core.git.git_status^git\s+status\b[^|><]*$
core.git.git_log^git\s+log\b[^|><]*$
core.git.git_diff^git\s+diff\b[^|><]*$
core.git.git_show^git\s+show\b[^|><]*$
core.git.git_branch^git\s+branch\b[^|><]*$
core.git.git_tag^git\s+tag\b[^|><]*$
core.git.git_remote_v^git\s+remote\s+-v\b[^|><]*$
core.git.git_rev_parse^git\s+rev-parse\b[^|><]*$

Destructive patterns

Rule IDReasonSuggestionConfidence
core.git.reset_hardDiscards all uncommitted changes permanentlyUse git stash to save changes, or git reset --soft to unstageHigh
core.git.force_pushForce push overwrites remote history, potentially losing others' workUse git push --force-with-lease for safer force pushesHigh
core.git.clean_forcePermanently deletes untracked files/directoriesUse git clean -n (dry run) first to preview what will be deletedHigh
core.git.checkout_discardDiscards uncommitted changes across a broad scopeCheckout specific files: git checkout -- path/to/fileHigh
core.git.restore_discardDiscards uncommitted or staged changes across a broad scopeRestore specific files: git restore path/to/fileHigh
core.git.rebase_activeRebase with --onto or --root rewrites commit history and can cause data lossUse git log to review history first; simple git rebase <branch> is permittedMedium
core.git.branch_force_deleteForce-deletes a branch regardless of merge statusUse git branch -d which only deletes if fully mergedMedium
core.git.stash_drop_clearPermanently deletes stashed changesVerify stash contents with git stash show before droppingMedium
core.git.worktree_force_removeForce-removes a worktree without checking for uncommitted changesUse git worktree remove without --force which checks for uncommitted changes firstMedium
core.git.reflog_expireExpiring reflog entries permanently destroys the ability to recover previous HEAD positionsUse git reflog to inspect entries before expiring; avoid --expire=nowHigh
core.git.gc_pruneAggressive garbage collection permanently removes unreachable objectsUse git gc without --prune=now which uses a safe 2-week grace periodMedium

Obfuscation

Pack ID: core.obfuscation

Guards against meta-execution patterns whose purpose is guard bypass

Destructive patterns

Rule IDReasonSuggestionConfidence
core.obfuscation.pipe_to_shellPiping content to a shell interpreter bypasses command inspectionDownload/generate the script to a file, review it, then executeHigh
core.obfuscation.base64_to_shellBase64-encoded commands bypass pattern matchingWrite the command directly instead of encoding itHigh
core.obfuscation.eval_subshelleval of dynamic content bypasses command inspectionExecute the inner command directlyHigh
core.obfuscation.curl_pipe_shellDownloading and executing untrusted code in one stepDownload the script first with curl -o script.sh, review it, then executeHigh
core.obfuscation.python_execPython used as a shell wrapper to bypass command inspectionExecute the shell command directlyMedium

Stencila

Pack ID: core.stencila

Guards the agent's own runtime, credentials, and publishing operations

Safe patterns

Rule IDPattern
core.stencila.stencila_secrets_list^stencila\s+secrets\s+list\b[^|><]*$
core.stencila.stencila_auth_status^stencila\s+auth\s+status\b[^|><]*$
core.stencila.stencila_cloud_status^stencila\s+cloud\s+status\b[^|><]*$
core.stencila.stencila_db_status^stencila\s+db\s+status\b[^|><]*$
core.stencila.stencila_db_log^stencila\s+db\s+log\b[^|><]*$
core.stencila.stencila_db_verify^stencila\s+db\s+verify\b[^|><]*$
core.stencila.stencila_status^stencila\s+status\b[^|><]*$
core.stencila.stencila_formats_list^stencila\s+formats\s+list\b[^|><]*$
core.stencila.stencila_models_list^stencila\s+models\s+list\b[^|><]*$

Destructive patterns

Rule IDReasonSuggestionConfidence
core.stencila.secrets_modifyModifying secrets can break authenticationUse stencila secrets list to view secretsHigh
core.stencila.auth_modifyChanging authentication state affects all sessionsUse stencila auth status to check auth stateHigh
core.stencila.cloud_authChanging cloud authentication affects deploymentsUse stencila cloud status to check cloud stateHigh
core.stencila.publishPublishing makes content publicly visibleReview content manually before publishingHigh
core.stencila.uninstallUninstalling removes the runtimeThis operation should not be performed by an agentHigh
core.stencila.pushPushing sends local changes to remoteUse stencila status to review changes firstMedium
core.stencila.db_destructiveDatabase reset/gc can lose dataUse stencila db status to inspect the database firstMedium
core.stencila.cleanClean removes generated artifactsUse stencila status to see what will be removedMedium

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

© 2026 Stencila