thearchitectit/agent-guardrails-template/guardrails-core

Claude Code and agent skill by thearchitectit/agent-guardrails-template

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Available guardrail tools and automatic enforcement behavior for pi agents

Install

npx vskill@latest install thearchitectit/agent-guardrails-template/guardrails-core

SKILL.md

Pi Guardrails Core

The Four Laws of Agent Safety are enforced automatically via event handlers. You do NOT need to call guardrail tools before every edit — the extension handles enforcement automatically.

Automatic Enforcement

The following rules are enforced without any explicit tool calls:

HandlerEventLawWhat It Does
Read trackingtool_resultLaw 1Tracks every file read; blocks edits to unread files
Scope enforcementtool_callLaw 2Blocks edits to files outside authorized scope
Bash safetytool_callLaw 4Blocks dangerous commands (rm -rf, sudo, force-push)
Injection defensetool_callLaw 4Blocks/warns on prompt injection in tool input (bash/write/edit)
Output validationtool_resultLaw 3Detects secrets/PII in tool output, warns via status bar and logs violation
Content filteringtool_resultLaw 3Detects denied topic content in output, warns and logs violation
Canary tokenstool_resultLaw 3Detects canary tokens in output (data exfiltration), alerts via status bar
Permissionstool_callAllGates tool access by auto/ask/blocked levels

When a handler blocks an operation, it also records a halt in the session state. Use guardrail_acknowledge_halt to resume after reviewing the halt reason.

Explicit Self-Check Tools

These tools are available for proactive checking before operations:

  • guardrail_verify_read — Check if a file has been read before editing it
  • guardrail_check_scope — Check if a path is within the authorized scope
  • guardrail_check_halt — Evaluate whether an operation should be halted (includes uncertainty score)

Session Management

  • guardrail_init — Initialize a guardrails session at the start of each conversation
  • guardrail_status — Get the full session state summary (scope, strikes, violations, MCP status, halt state)

Three Strikes Workflow

The Three Strikes rule enforces Law 4 (Halt When Uncertain):

  1. guardrail_record_attempt — Record each task attempt (success or failure)
  2. guardrail_check_strikes — Check the strike count for a task
  3. guardrail_reset_strikes — Reset strikes after a successful resolution or user escalation

After 3 consecutive failures on the same task, the system recommends halting and escalating to the user.

Scope Management

  • guardrail_set_scope — Define which file paths the agent is authorized to operate on
  • guardrail_check_scope — Verify a path is in scope before operating on it

Violation Logging

  • guardrail_log_violation — Log a guardrail violation with law, severity, and context

Halt Lifecycle

When a handler blocks an operation, a halt is recorded in the session state:

  • guardrail_acknowledge_halt — Acknowledge a halt condition so work can resume
  • Halt states: active → halted → acknowledged

Regression Prevention

Cross-session failure registry for preventing regressions:

  • guardrail_check_regression — Check if modifying files risks regressing past failures
  • guardrail_verify_fixes — Verify that past fixes in a file are still intact
  • guardrail_register_failure — Register a past failure with a regression pattern

Replacement Validation

  • guardrail_validate_replacement — Validate that old content in an edit matches the actual file (catches stale edits)

Language Detection

  • guardrail_detect_language — Scan a project directory and return detected languages
  • guardrail_get_language_profile — Get detected languages + available rules with descriptions

Git Validation

  • guardrail_validate_git — Validate git commands against branch protection and destructive operation policies

Documentation Access

  • guardrail_read_skill — Read a guardrails skill's SKILL.md documentation
  • guardrail_list_skills — List all available guardrails skills
  • guardrail_list_languages — List available language-specific prevention rules

Uncertainty Scoring

guardrail_check_halt returns an uncertaintyScore (0-1):

  • 0-0.2: certain — no concerns
  • 0.2-0.5: probably — mild uncertainty (e.g. edit without details)
  • 0.5-0.8: uncertain — significant concern (e.g. delete without details)
  • 0.8-1.0: guessing — high risk (e.g. production-affected operations)

MCP Bridge

When the Go MCP server is available, guardrail_mcp proxies calls to it for enhanced enforcement including sandbox execution, canary tokens, extended validation, and policy retrieval.

Enforcement Coverage Map

ModuleSkillAutomatic?Explicit Tool?
Read tracking[[guardrails-core]]Yes (tool_result)guardrail_verify_read
Scope enforcement[[guardrails-core]]Yes (tool_call)guardrail_check_scope
Bash safety[[guardrails-core]]Yes (tool_call)guardrail_check_halt
Strike tracking[[guardrails-core]]Noguardrail_record_attempt/check_strikes
Injection defense[[injection-defense]]Yes (tool_call)guardrail_mcp detect_injection
Output validation[[output-security]]Yes (tool_result)guardrail_mcp scan_output
Content filtering[[content-safety]]Warn (tool_result)guardrail_mcp filter_content
Tool permissions[[tool-permissions]]Yes (tool_call)guardrail_mcp set_permission
Policy layers[[policy-config]]Yes (config load)guardrail_mcp get_policy
Sandbox[[sandbox-isolation]]Noguardrail_mcp sandbox_run
Canary tokens[[canary-tokens]]Warn (tool_result)guardrail_mcp canary_insert/check
Pre-work check[[guardrails-core]]Noguardrail_pre_work_check
Feature creep[[guardrails-core]]Noguardrail_detect_creep
Pattern rules[[guardrails-core]]Noguardrail_check_pattern
Language detection[[language-detection]]Auto (on load)guardrail_detect_language
Language profile[[language-detection]]Noguardrail_get_language_profile
Git validation[[guardrails-core]]Noguardrail_validate_git
Regression guard[[guardrails-core]]Noguardrail_check_regression
Fix verification[[guardrails-core]]Noguardrail_verify_fixes
Failure registry[[guardrails-core]]Noguardrail_register_failure
Replacement validation[[guardrails-core]]Noguardrail_validate_replacement
Halt lifecycle[[guardrails-core]]Auto (on block)guardrail_acknowledge_halt
Docs access[[docs-access]]Noguardrail_read_skill/list_skills
Language listing[[docs-access]]Noguardrail_list_languages

References

  • [[injection-defense]] — Prompt injection detection and blocking
  • [[output-security]] — Secret scanning and auto-redaction
  • [[content-safety]] — Topic-based content filtering
  • [[tool-permissions]] — Per-tool access control
  • [[policy-config]] — Organization → team → project policy hierarchy
  • [[sandbox-isolation]] — Docker-based command isolation
  • [[canary-tokens]] — Honeypot data exfiltration detection
  • [[language-detection]] — Auto-detect project languages and apply language-specific rules
  • [[docs-access]] — Runtime access to skill documentation and configuration guides
  • [[guardrails-dashboard]] — Status bar and panel UI

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
78
Repository forks
2
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/thearchitectit/agent-guardrails-template/guardrails-core/badge)](https://verified-skill.com/skills/thearchitectit/agent-guardrails-template/guardrails-core)

Something wrong with this skill or its page? Tell us.