Pi Guardrails Core

Pi Guardrails Core is a skill for Claude Code, Codex from TheArchitectit/agent-guardrails-template. It costs 16 tokens per session (1,886 once invoked), scanned C, original, BSD-3-Clause.

A set of automatic safety rules for coding agents that read files, edit code, run commands, and return tool results.

In plain words
What is it for?
Use it to enforce file-read tracking, project scope, command safety, output checks, prompt-injection checks, and permission levels.
Why use it?
It reduces risks such as editing unread or unauthorized files, running dangerous commands, exposing secrets, or allowing unapproved tool access.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to enforce file-read tracking, project scope, command safety, output checks, prompt-injection checks, and permission levels.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thearchitectit/agent-guardrails-template/guardrails-core
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add TheArchitectit/agent-guardrails-template --skill guardrails-core
Clone the repo
git clone --depth 1 https://github.com/TheArchitectit/agent-guardrails-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Pi Guardrails Core

README.md
[![agentmods](https://agentmods.dev/badge/skills/thearchitectit/agent-guardrails-template/guardrails-core/github.svg)](https://agentmods.dev/skills/thearchitectit/agent-guardrails-template/guardrails-core)
Your own site
<a href="https://agentmods.dev/skills/thearchitectit/agent-guardrails-template/guardrails-core"><img src="https://agentmods.dev/badge/skills/thearchitectit/agent-guardrails-template/guardrails-core/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Pi Guardrails Core

Your own site · 80×15
<a href="https://agentmods.dev/skills/thearchitectit/agent-guardrails-template/guardrails-core"><img src="https://agentmods.dev/badge/skills/thearchitectit/agent-guardrails-template/guardrails-core.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,886 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.01886
Opus 5 $0.00008 $0.00943
Sonnet 5 $0.00003 $0.00377
Haiku 4.5 $0.00002 $0.00189

Measured 11d ago against content hash f022b792bef4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

Pi Guardrails Core scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

| Bash safety | `tool_call` | Law 4 | Blocks dangerous commands (rm -rf, sudo, force-push) |
pi-extension/skills/guardrails-core/SKILL.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

Handler Event Law What It Does
Read tracking tool_result Law 1 Tracks every file read; blocks edits to unread files
Scope enforcement tool_call Law 2 Blocks edits to files outside authorized scope
Bash safety tool_call Law 4 Blocks dangerous commands (rm -rf, sudo, force-push)
Injection defense tool_call Law 4 Blocks/warns on prompt injection in tool input (bash/write/edit)
Output validation tool_result Law 3 Detects secrets/PII in tool output, warns via status bar and logs violation
Content filtering tool_result Law 3 Detects denied topic content in output, warns and logs violation
Canary tokens tool_result Law 3 Detects canary tokens in output (data exfiltration), alerts via status bar
Permissions tool_call All Gates 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):

Read the full file on GitHub · 160 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 160 lines · 16 tokens per session scan C f022b792bef4

Subscribe to this mod's changes

Pi Guardrails Core is a skill published in the GitHub repository TheArchitectit/agent-guardrails-template (79 stars, last pushed 2d ago), licensed BSD-3-Clause. It adds 16 tokens to every session and 1,886 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

construction-expert

Expert-level construction management, project planning, BIM, safety compliance, and construction technology. Use when the user mentions BIM, project management, safety, or building, or when the task involves Construction Management, Technologies, Standards and Regulations, or Cost Control.

personamanagmentlayer/pcl · 54 tokens

gemini-api-dev

Use when build applications using Google Gemini API. Handle chat completions, multimodal inputs, function calling, streaming, and grounding with Google Search. Use when building applications using google gemini api. handle chat completions, multimodal.

oyi77/1ai-skills · 52 tokens

pydantic-ai

Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.

davila7/claude-code-templates · 32 tokens

edgeone skill scanner

A local static scanner that checks agent-skill files for security risks before they are installed or used. Static analysis examines files without running them.

Tencent/AI-Infra-Guard · 148 tokens

connect-agent

Connect the codebase's AI agent to LangWatch agent simulations, so test suites run against the real agent process. Adds a small connect function beside the service startup that calls the agent already in the codebase, which opens an outbound connection and registers the agent with its environment and its run…

langwatch/langwatch · 102 tokens

prompt-optimization

Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…

langwatch/langwatch · 105 tokens