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.5 $0.00006 $0.00754
Sonnet 5.5 $0.00003 $0.00377
Haiku 4.5 $0.00002 $0.00189

Measured 3mo ago against content hash f022b792bef4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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 (1 stars, last pushed yesterday), licensed BSD-3-Clause. It adds 16 tokens to every session and 1,886 once invoked, about $0.0001 per session on Opus 5.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

Pi Guardrails Core compared with skills from other repositories

Pi Guardrails Core next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Pi Guardrails CoreTheArchitectit/agent-guardrails-templateSkill1yesterdayBSD-3-ClauseC16Claude Code, Codex
gemini-api-devoyi77/1ai-skillsSkill19todayMITA52Claude Code
construction-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A54Claude Code
edgeone skill scannerTencent/AI-Infra-GuardSkill7.8k3d agoApache-2.0A148Claude Code, Codex
connect-agentlangwatch/langwatchSkill5.1ktodayApache-2.0A102Claude Code, Codex
prompt-optimizationlangwatch/langwatchSkill5.1ktodayApache-2.0A105Claude Code, Codex
dashboard-widgetslangwatch/langwatchSkill5.1ktodayApache-2.0A79Claude Code, Codex