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.
npx skills add LucasDuys/forge --skill karpathy-guardrailsgit clone --depth 1 https://github.com/LucasDuys/forgeWrote 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.
[](https://agentmods.dev/skills/lucasduys/forge/karpathy-guardrails)<a href="https://agentmods.dev/skills/lucasduys/forge/karpathy-guardrails"><img src="https://agentmods.dev/badge/skills/lucasduys/forge/karpathy-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.
<a href="https://agentmods.dev/skills/lucasduys/forge/karpathy-guardrails"><img src="https://agentmods.dev/badge/skills/lucasduys/forge/karpathy-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.00999 |
| Opus 5 | $0.00018 | $0.00500 |
| Sonnet 5 | $0.00007 | $0.00200 |
| Haiku 4.5 | $0.00004 | $0.00100 |
Grade A, and why
karpathy-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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Karpathy Guardrails Skill
Behavioral guardrails that all Forge agents MUST follow during execution. These four principles prevent the most common failure modes in AI-generated code: silent assumptions, over-engineering, scope creep, and unfocused execution.
These guardrails are referenced by forge-executor, forge-reviewer, and forge-planner agents. They are not optional.
Principle 1: Think Before Coding
Rule: Surface assumptions explicitly. Never hide confusion behind code.
- When a spec requirement is ambiguous, flag it as NEEDS_CONTEXT rather than guessing
- When multiple valid interpretations exist, list them in the checkpoint context_bundle and ask
- Push back on unclear acceptance criteria before implementing them
- If you are uncertain about the right approach, state your uncertainty in state.md under "Key Decisions" before proceeding
Anti-pattern: Implementing "export users" without asking about scope, format, fields, or volume. Correct pattern: Flag ambiguity, present interpretations, get clarification.
Principle 2: Simplicity First
Rule: Write the minimum code that solves only the stated problem.
- No speculative features beyond what the acceptance criteria require
- No abstractions for single-use code paths
- No "flexibility" or "configurability" unless the spec explicitly requests it
- No error handling for impossible scenarios (trust internal code and framework guarantees)
- Self-check: "Would a senior engineer say this is overcomplicated?"
Anti-pattern: Building abstract strategy patterns and dataclass configurations for a simple discount calculator. Correct pattern: Three lines of direct logic that solve the stated requirement.
Token impact: Simpler code uses fewer tokens to generate, review, and verify. Over-engineering wastes budget across the entire pipeline (executor + reviewer + verifier).
Principle 3: Surgical Changes
Rule: Modify only what is necessary to fulfill the task's requirements.
- Every changed line must trace directly to an acceptance criterion
- Do not "improve" adjacent code, comments, or formatting
- Do not refactor code that is not broken
- Match existing code style, even if it differs from modern best practices
- Clean up only your own orphaned imports and variables
- Preserve pre-existing dead code unless the spec says to remove it
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.
- 11d ago First seen · 93 lines · 37 tokens per session scan A 14a1ecca543a
karpathy-guardrails is a skill published in the GitHub repository LucasDuys/forge (55 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 999 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.
Other skills, from other repositories
autonomous-run
Prepare, start, inspect, resume, or stop a finite local overnight coding run after a human has accepted a Wayfinder terminal spec; coordinates a declared Claude/Codex maker and independent checker without pushing, merging, or writing to external systems.
ai-ml-development
AI and machine learning development with PyTorch, TensorFlow, and LLM integration. Use when building ML models, training pipelines, fine-tuning LLMs, or implementing AI features.
authentication-patterns
OAuth 2.0, JWT, SSO, MFA, NextAuth/Clerk/Supabase Auth implementation patterns.
case-interview-practice
Interactive consulting case interview practice with structured frameworks, feedback mechanisms, and progressive difficulty. Use when preparing for management consulting interviews, case competitions, or business problem-solving exercises.
i18n-localization
Internationalization and localization for global applications. Use when adding multi-language support, handling regional formats, or preparing apps for global markets.
research-archival
Scrape AI research URLs, archive with frontmatter, create GitHub Issues with identity verification.