Skip to content
cccskills
FreePublished on GitHub

global-agent-guardrails

Configure a shared guard that blocks destructive shell commands before local AI agents execute them. Adjust blocking rules, connect agent integrations, and test why commands are blocked or allowed.

OriginalShow the original description

Configure the shared guard against catastrophic shell commands in local AI agents. Use when changing block patterns, adding an agent or machine, or investigating why a command was or wasn't blocked.

Run score Not tested

See how to install

Good for

  • Adjust rules for blocking destructive commands
  • Connect the guard to another agent or machine
  • Investigate blocked or unexpectedly allowed commands
  • Verify protection with tests and safe probes

Files included (1)

  • SKILL.md3.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Global Agent Guardrails

Block catastrophic shell commands before execution. One patterns file feeds a shared hook script or native adapter for each agent. This guards against accidents, not malicious agents (obfuscation like python -c "shutil.rmtree(...)" can slip past regex).

Cloudroom ships a built-in Command Guard based on this one, on by default.

File map

The setup consists of a shared pattern list, a guard script, a test suite, and agent-specific adapters. Keep those in the appropriate user-level configuration locations for your tools.

Check installation

Confirm the shared guard and patterns are present, then run the test suite; it should report no failures.

If missing, rebuild from the wiring documentation in the project documentation.

Add or tune a pattern

  1. Edit the shared patterns file. Write POSIX ERE (grep -E). Use [[:space:]], never \s — adapters may convert [:space:] to \s for JS/Python and compile in multiline mode.
  2. Add block and allow cases to the test suite, then run it; all must pass.
  3. Verify the new pattern compiles in each adapter's regex engine.
  4. Consumers should re-read patterns for every command. If an agent uses a native blocklist, mirror changes there as appropriate.

Block only catastrophic commands (irreversible data loss, disk wipes, repo deletion). Recoverable local commands stay allowed; avoid over-blocking.

Per-agent wiring (user-global)

Configure each agent using its documented hook or native command-blocking mechanism. Where supported, point the hook to the shared guard; merge settings into existing configuration rather than overwriting it. Use absolute paths in configs where path expansion is inconsistent.

Gotchas

  • Some agents pin hook trust to configuration contents. After changing hook configuration, follow the agent's documented trust or approval process.
  • Some background or worker environments cannot execute local hook scripts. Check the agent's documentation for failure behavior and limitations.
  • Plugin hook manifests, enablement, and failure behavior vary by agent; keep adapters simple and follow each tool's public documentation.
  • Adapters should handle errors deliberately so a broken patterns file does not unexpectedly block every command.
  • Native blocklist semantics vary: some entries request confirmation while others prevent execution. Use the strongest appropriate mechanism for catastrophic commands.
  • Ensure the guard reads the command from the payload format used by each integration.
  • Adapter regexes may require multiline mode so ^ matches each shell line like grep.
  • False-positive class: a harmless command whose argument text contains a dangerous-looking string can get blocked. Workaround: put the text in a file and reference it.
  • Some agents or remote/background execution environments may not support local hooks. Check the relevant agent documentation for current support.

E2E verification

Use a safe probe in a temporary, non-git directory: ask the agent to run a command that would be blocked if executed. A guard block indicates the guard works; a repository-context error indicates the probe did not test the guard.

Run the guard's test suite directly to verify that a catastrophic command is blocked.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

4x4

FreeSummary

Work through sixteen open questions in four rounds to clarify major product decisions, risky changes, or large refactors. The agent adapts later questions to earlier answers, then turns your decisions into a step-by-step implementation plan.

  • Clarifying decisions before a major product change
  • Planning a large refactor
  • Deciding rollout order for a risky change
davidondrej/skills4.2KUpdated Oct 24, 2026

adr-verbatim

FreeSummary

Document approved decisions as concise ADRs, or architecture decision records. It preserves the user's meaning and conditions, removes conversational filler, follows the project's numbering, and presents the saved record for review.

  • Record a decision approved in conversation
  • Preserve the conditions and scope of a decision
  • Add a numbered ADR to existing records
davidondrej/skills4.2KUpdated Oct 24, 2026

anti-sleep

FreeSummary

Keep a Mac awake for a chosen duration or while a specified process runs. The skill uses built-in macOS tools to manage one session, verify that sleep prevention is active, and control whether the display stays on.

  • Keep a Mac awake during a lengthy task
  • Prevent sleep while a specified process runs
  • Allow the display to dim while keeping the Mac awake
davidondrej/skills4.2KUpdated Oct 24, 2026

ask-then-build

FreeSummary

Turn a feature or refactoring idea into a concise implementation prompt for another agent. It asks focused questions one at a time, records decisions, and includes development steps, validation, and working rules.

  • Clarify requirements for a new feature
  • Decide edge cases and failure behavior
  • Define the scope of a refactor
davidondrej/skills4.2KUpdated Oct 24, 2026

bb-cli

FreeSummary

Inspect and manage BB threads, environments, projects, and plugins through its command line interface. The skill guides agents to identify the correct targets, apply changes, and verify the resulting state.

  • Check BB projects and environment status
  • Manage skills and plugins
  • Create or operate threads
davidondrej/skills4.2KUpdated Oct 24, 2026

bb-plugins

FreeSummary

Create, install, and debug TypeScript plugins that extend bb with custom pages, sidebar panels, CLI commands, agent tools, themes, and other features. The skill also guides development reloads, log checks, and verification of installed plugins.

  • Add a custom page or sidebar panel to bb
  • Create a bb CLI command or agent tool
  • Investigate plugin errors through logs
davidondrej/skills4.2KUpdated Oct 24, 2026

See all skills by davidondrej

Report a problem with this skill