guardrails

guardrails is a command for Claude Code from Myr-Aya/GouvernAI-claude-code-plugin. It costs 46 tokens per session (1,062 once invoked), scanned A, original, MIT.

A command that displays and changes the project’s safety controls. These controls govern approval modes, token limits, and audit logging for agent actions.

In plain words
What is it for?
Checking status and logs, switching between guardrail modes, enabling audit-only behavior, setting a token cap, and resetting or viewing policy.
Why use it?
It makes the project’s action restrictions visible and lets users adjust how strictly operations are gated.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the gouvernai plugin — 1 skill, 1 command, 1 hook shipped together

Good fit Checking status and logs, switching between guardrail modes, enabling audit-only behavior, setting a token cap, and resetting or viewing policy.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/myr-aya/gouvernai-claude-code-plugin/guardrails
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.

Clone the repo
git clone --depth 1 https://github.com/Myr-Aya/GouvernAI-claude-code-plugin

Made for: Claude Code.

Or install gouvernai, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 hook.

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 guardrails

README.md
[![agentmods](https://agentmods.dev/badge/commands/myr-aya/gouvernai-claude-code-plugin/guardrails/github.svg)](https://agentmods.dev/commands/myr-aya/gouvernai-claude-code-plugin/guardrails)
Your own site
<a href="https://agentmods.dev/commands/myr-aya/gouvernai-claude-code-plugin/guardrails"><img src="https://agentmods.dev/badge/commands/myr-aya/gouvernai-claude-code-plugin/guardrails/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 guardrails

Your own site · 80×15
<a href="https://agentmods.dev/commands/myr-aya/gouvernai-claude-code-plugin/guardrails"><img src="https://agentmods.dev/badge/commands/myr-aya/gouvernai-claude-code-plugin/guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,062 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00046 $0.01062
Opus 5 $0.00023 $0.00531
Sonnet 5 $0.00009 $0.00212
Haiku 4.5 $0.00005 $0.00106

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

Security

Grade A, and why

guardrails scanned grade A with 0 findings 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 10d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

gouvernai/commands/guardrails.md · 76 lines

How it starts

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

Show the current guardrails status and provide mode controls.

Mode config file

Modes are persisted to guardrails-mode.json in the project root (CLAUDE_PROJECT_DIR). Read this file at the start of any command to determine the current mode. Write to it when mode changes. This file survives context resets and new sessions.

Schema:

{
  "mode": "full-gate",
  "audit_only": false,
  "token_cap": null,
  "set_at": "<ISO 8601 timestamp>",
  "set_by": "user"
}

Valid mode values: "full-gate" (default), "strict", "relaxed". audit_only: true overrides tier controls — T2/T3 auto-proceed with logging, T4 halts without executing. token_cap: integer or null. When set to an integer, actions whose estimated payload exceeds this token count pause for approval (T3 gate). When null or absent, the token cap is inactive.

Commands

If the user typed /guardrails with no argument or /guardrails status:

  • Read guardrails-mode.json (if it exists) to get persisted mode; otherwise assume full-gate
  • Show the current guardrails mode (full-gate, strict, relaxed, audit-only)
  • Show tier distribution for this session (how many T2, T3, T4 actions gated)
  • Show approval/denial counts
  • Show whether any pre-approved patterns are active
  • Show token cap setting: if token_cap is set in the config, show "Token cap: tokens"; otherwise "Token cap: not set"

If the user typed /guardrails log:

  • Read and display the last 20 entries from guardrails_log.md in the project root
  • If no log exists, say "No guardrails log found. The log is created on the first gated action."

If the user typed /guardrails strict:

  • Write {"mode": "strict", "audit_only": false, "set_at": "<now ISO 8601>", "set_by": "user"} to guardrails-mode.json in the project root
  • Confirm: "🛡️ Strict mode saved. All tiers escalated by +1. Persists across sessions until changed."

If the user typed /guardrails relaxed:

  • Write {"mode": "relaxed", "audit_only": false, "set_at": "<now ISO 8601>", "set_by": "user"} to guardrails-mode.json in the project root
  • Confirm: "🛡️ Relaxed mode saved. Tier 2 actions will skip the gate. Persists across sessions until changed."

Read the full file on GitHub · 76 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. 10d ago First seen · 76 lines · 46 tokens per session scan A ee46685c1211

Subscribe to this mod's changes

guardrails is a command published in the GitHub repository Myr-Aya/GouvernAI-claude-code-plugin (23 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 1,062 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.