understudy guardrails.instructions.md

A set of security and behavior rules for team AI agents. It limits destructive actions, secret or data leaks, unapproved changes, production changes without control, and work done without specifications or tests.

In plain words
What is it for?
Use it to constrain agents working on code, data, secrets, tests, and production-related changes.
Why use it?
It gives agents fixed boundaries to follow instead of treating safety practices as optional suggestions. The rules can apply automatically in VS Code or be activated in Copilot CLI.

Instructions file for GitHub Copilot

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.

agentmods
npx agentmods add instructions/erniker/understudy/guardrails
Clone the repo
git clone --depth 1 https://github.com/erniker/understudy

Made for: GitHub Copilot.

Per session 2,193 This file is loaded in full into every session.
When invoked 2,193 The same file โ€” it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02193 $0.02193
Opus 5 $0.01097 $0.01097
Sonnet 5 $0.00439 $0.00439
Haiku 4.5 $0.00219 $0.00219

Measured yesterday against content hash 9cdcad456f69, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

understudy guardrails.instructions.md 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 yesterday.

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.

templates/.github/instructions/guardrails.instructions.md ยท 240 lines

How it starts

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

๐Ÿ›ก๏ธ Guardrails โ€” Security and Behavior Limits of the Understudy

๐ŸŽฏ This file applies to ALL team agents.

In VS Code it auto-applies to all files (applyTo: "**").

In Copilot CLI it is activated with /instructions.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚ What are guardrails? โ”‚

โ”‚ โ”‚

โ”‚ They are security and behavior limits that ALL โ”‚

โ”‚ Understudy agents must respect, without exception. โ”‚

โ”‚ They protect against: โ”‚

โ”‚ - Unauthorized destructive actions โ”‚

โ”‚ - Data or secret leaks โ”‚

โ”‚ - Out-of-scope or unapproved changes โ”‚

โ”‚ - Process violations (code without spec, without tests) โ”‚

โ”‚ - Impact on production without change control โ”‚

โ”‚ โ”‚

โ”‚ Guardrails are NOT suggestions โ€” they are hard โ”‚

โ”‚ restrictions that the agent MUST comply with. โ”‚

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜


1. ๐Ÿ›ก๏ธ Security

NEVER

  • Generate code with hardcoded credentials, tokens, API keys, passwords or secrets
  • Store secrets in files, pipeline environment variables, logs or comments
  • Disable or bypass existing security controls (APIM policies, WAF rules, auth middleware)
  • Generate code that accesses data beyond the scope defined in the task
  • Suggest workarounds that circumvent governance, auditing or compliance

ALWAYS

  • Use vault services (Key Vault, Secrets Manager) to retrieve secrets
  • Use Managed Identity or approved Service Principals for authentication between services
  • Validate and sanitize ALL inputs at system boundaries
  • Apply the principle of least privilege to all identities and access
  • Include audit logging for sensitive operations
  • Treat all external inputs as untrusted

Read the full file on GitHub ยท 240 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. yesterday First seen ยท 240 lines ยท 2,193 tokens per session scan A 9cdcad456f69

Subscribe to this mod's changes

understudy guardrails.instructions.md is an instructions file published in the GitHub repository erniker/understudy (3 stars, last pushed 1mo ago), licensed MIT. It adds 2,193 tokens to every session, about $0.0110 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-31.