guardrails
Skill0 starsChanged 14 days agoISCView on GitHub
Cross-cutting hardening for security, container/dependency hygiene, HTML/DOM sinks, and language soundness gotchas across any project or language. Use when writing or modifying code that touches dependencies, Docker/containers, HTML/templates/DOM, auth, secrets, nullability, or lifetimes/resources. Use when reviewing code for security pitfalls. Do NOT use when only reading or exploring without code changes.
- Reads credentials
15 other projects use a version of this.
Adopted by
Most recently taken up by
- the-inconvenience-store/skillstheir own version, first seen Nov 6, 2026
- meaningfy-ws/skillerytheir own version, first seen Oct 27, 2026
- antrafa/skillstheir own version, first seen Oct 20, 2026
- irahardianto/awesome-agvtheir own version, first seen Oct 14, 2026
- adewale/guardrails-skilltheir own version, first seen Oct 13, 2026
- feelthefusion/skill-starter-kittheir own version, first seen Oct 13, 2026
Used with
Projects with it also use evaluation, prototype and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
NVIDIASkillevaluation
Evaluates accuracy of quantized or unquantized LLMs using NeMo Evaluator Launcher (NEL). Triggers on "evaluate model", "benchmark accuracy", "run MMLU", "evaluate quantized model", "run nel". Handles deployment, config generation, and evaluation execution. Always load when validating completed runs or reporting evaluation scores, including standalone launching-evals analysis. Not for quantizing models (use ptq), standalone serving (use deployment), or comparing completed baseline-vs-quantized results (use compare-results).
Also in 3 projects that use this
GoogleSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 3 projects that use this
GoogleSkillgrill-me
A relentless interview to sharpen a plan or design.
Also in 4 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- ai-analyst-lab/ai-analyst★ 304same name
- irahardianto/awesome-agv★ 157same name
- googlicius/obsidian-steward★ 85same name
- bolasblack/claude-skills★ 4same name
- hajekim/agentic-design-patterns-skills★ 4same name
- dfrysinger/skills★ 3same name
- adewale/guardrails-skill★ 2same name
- Citadel-Cloud-Management/citadel-saas-factory★ 2same name
- meaningfy-ws/skillery★ 2same name
- antrafa/skills★ 1same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apex-performance-auditorSkill
- checkSkill
- context7-mcpSkill
- design-craftSkill
- framework-engine-stacksSkill
- hypermedia-engine-stacksSkill
- learning-curatorSkill
- okf-docsSkill
- pi-lens-ast-grepSkill
- pi-lens-lsp-navigationSkill
- pi-lens-write-ast-grep-ruleSkill
- pi-lens-write-tree-sitter-ruleSkill
- rust-systemsSkill
- scalabilitySkill
- select-modelSkill
- skill-authoring-visionSkill
- systems-auditorSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Only reading or exploring without mutations (use explore mode)
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Guardrails
Cross-cutting hardening that loads first — before domain skills — to prevent the 5 universal failure classes across any stack: HTML/DOM sink hazards & canvas morph collisions, secret leaks, container/dependency bloat, unchecked null vs. explicit absence (Option), and lifetime/resource leaks. Tiny Level 1 inline; Level 2 behind references/guardrails-patterns.md.
Activation Boundary
Triggers on:
- Writing/modifying code that touches
deps(Cargo.toml,package.json,go.mod,pyproject.toml),Docker(Dockerfile,compose),HTML/DOM(hypermedia templates, Maud/Datastar, JSX/Svelte),auth(tokens, cookies, sessions), orsecrets - Reviewing a change for security, nullability, lifetime/resource safety, or container hardening
- Handling untrusted HTML sinks (
innerHTML, unescaped templates),<canvas>morph protection, or secret-like strings
Does NOT trigger on:
- Only reading or exploring without mutations (use explore mode)
- Pure planning (proposal/design/tasks) before code
- Skills that explicitly state
Do NOT use guardrails(none today)
When to Use
Load this skill first before any domain skill when the task touches the high-risk surfaces above. Check the 5 universal guardrails below, then proceed to domain logic. If no high-risk surface is touched, skip guardrails to save tokens.
Contrast
| Surface | Before (Anti-Pattern) | After (Universal Guardrail) | Why & Ecosystem Specificities |
| 1. HTML, DOM & Canvas Sinks | Unescaped HTML injection, unguarded <canvas> morphs, or implicit on* string handlers | Auto-escaped templates, data-ignore on stateful canvases, and explicit event bindings | Prevents XSS, preserves WebGL/WASM contexts during Datastar/HTMX DOM morphs, and avoids silent on* stripping in Svelte/JSX |
| 2. Secrets & Credentials | Committing .env / keys or echoing tokens in CI/deploy logs | .gitignore deny-lists, runtime secret injection, and unconditional log redaction | AGENTS.md invariant: never commit credentials or .env files across any environment |
| 3. Containers & Dependencies | Shipping build toolchains, root users, or unpinned dev adapters in production | Multi-stage builds, locked manifests, and minimal non-root runtime images (distroless) | Eliminates attack surface and runtime drift (Rust/Go -> distroless:nonroot, TS/Python -> locked slim non-root) |
| 4. Explicit Absence & Parsing | Unchecked if (x != null) or raw any payload access | Parse at I/O boundaries and encode absence in types (Option<T>, strict null checks) | Prevents runtime null-dereference panics (Rust: if let Some(v) = x, TS: strictNullChecks, Go/Py: explicit nil/None guard) |
| 5. Lifetimes & Resources | Eliding borrowed output lifetimes, holding locks across .await, or leaking handles | Explicit 'a lifetime ties, lexical lock scopes, and deterministic Drop/defer/using | Guarantees memory soundness, prevents async deadlocks, and ensures deterministic descriptor cleanup |
Anti-examples
1. Do NOT: Leave HTML sinks unescaped, <canvas> unprotected from DOM morphs, or event handlers implicit
<!-- before (wrong) — raw HTML sink + unprotected canvas destroyed on morph + fragile inline handler -->
<div innerHTML={untrustedBio} oncustom={handler}>
<canvas id="sim-canvas"></canvas>
</div>// after (right, Rust Maud + Datastar) — auto-escaped text, explicit data-on-click, and data-ignore on canvas container
html! {
div data-on-click="$open = !$open" {
p { (untrusted_bio) }
div id="canvas-stage" data-ignore {
canvas id="sim-canvas" {}
}
}
}Why: Auto-escaping blocks XSS; data-ignore (or framework key preservation) stops DOM morphing from dropping active WebGL/WebGPU contexts; explicit event syntax (data-on-click, on:click, onClick) prevents silent handler stripping.
2. Do NOT: Commit secrets or echo credentials in logs
# before (wrong)
git add .env && git commit -m "configure api keys"# after (right) — deny-list secret & artifact paths in .gitignore, inject at runtime
printf '\n.env\n.env.*\n*.pem\n*.key\ncredentials\nnode_modules/\ntarget/\ndist/\nbuild/\n' >> .gitignoreWhy: AGENTS.md Inviolable Prohibition — never commit .env or private keys, and mask tokens unconditionally in telemetry.
3. Do NOT: Ship build toolchains or root containers to production
# before (wrong) — single-stage build running as root with full compiler/dev toolchain
FROM rust:latest
COPY . .
RUN cargo build --release
CMD ["./target/release/app"]# after (right) — multi-stage build into minimal non-root distroless runtime
FROM rust:1-bookworm AS build
WORKDIR /src
COPY . .
RUN cargo build --release --locked
FROM gcr.io/distroless/cc-debian13:nonroot
COPY --from=build /src/target/release/app /app
USER nonroot:nonroot
ENTRYPOINT ["/app"]Why: Least-privilege execution — production images carry only the locked artifact and run as nonroot.
4. Do NOT: Assume nullable references or unvalidated payloads
// before (wrong) — C/JS mental model in Rust or unchecked nullable access
if user != null { /* ... */ }// after (right) — explicit type-level absence handling
if let Some(u) = user { /* use u */ }Why: Absence must be encoded and narrowed explicitly (Option<T> / Result<T, E> in Rust, strictNullChecks in TypeScript, err != nil in Go).
5. Do NOT: Elide borrowed output lifetimes or hold locks across .await
// before (wrong) — ambiguous borrowed return lifetime
fn longest(x: &str, y: &str) -> &str { if x.len() > y.len() { x } else { y } }// after (right) — explicit lifetime specifier tying output borrow to inputs
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { if x.len() > y.len() { x } else { y } }Why: Explicit ownership and lifetime bounds ('a in Rust; defer/using/with for I/O handles in Go/TS/Python) prevent dangling references and resource leaks.
References
references/guardrails-patterns.md— Level 2 detail for each universal guardrail across languages (code before/after, failure signal, remediation)./AGENTS.mdChapter 4 & Chapter 8 — cross-cutting security, boundary validation (FEAR), and unconditional redaction invariants
Gotchas
- Loads first, but only when a high-risk surface is present —
only readinganti-triggers prevent bloat on explore tasks - Co-activates cleanly with language-specific skills (such as
rust-systemsorhypermedia-engine-stacks) without locking the workspace to a single project - Single source for cross-cutting pre-flight checks: keep
SKILL.mdcompact and readreferences/guardrails-patterns.mdonly when deeper pattern detail is needed
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

