margaret-guard

margaret-guard is a skill for Claude Code from sofiahernandes/margaret. It costs 184 tokens per session (599 once invoked), scanned A, original, MIT.

A security review focused on exploitable vulnerabilities in the current code changes, such as injection, authentication bypasses, secret-handling mistakes, or data exposure.

In plain words
What is it for?
Use it to inspect changed code for unsafe input flows, authorization flaws, weak cryptography, code execution risks, cross-site scripting, and sensitive-data leaks.
Why use it?
It filters out general style concerns and theoretical hardening so the review concentrates on credible security problems introduced by the diff.

Skill for Claude Code

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

Part of the margaret plugin — 5 skills, 1 command shipped together

Good fit Use it to inspect changed code for unsafe input flows, authorization flaws, weak cryptography, code execution risks, cross-site scripting, and sensitive-data leaks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sofiahernandes/margaret/margaret-guard
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 sofiahernandes/margaret --skill margaret-guard
Clone the repo
git clone --depth 1 https://github.com/sofiahernandes/margaret

Made for: Claude Code.

Or install margaret, the plugin that ships this one along with the rest of its 5 skills, 1 command.

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 margaret-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/sofiahernandes/margaret/margaret-guard.svg)](https://agentmods.dev/skills/sofiahernandes/margaret/margaret-guard)
Your own site
<a href="https://agentmods.dev/skills/sofiahernandes/margaret/margaret-guard"><img src="https://agentmods.dev/badge/skills/sofiahernandes/margaret/margaret-guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 184 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 599 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.00184 $0.00599
Opus 5 $0.00092 $0.00300
Sonnet 5 $0.00037 $0.00120
Haiku 4.5 $0.00018 $0.00060

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

Security

Grade A, and why

margaret-guard 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 8d 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.

skills/margaret-guard/SKILL.md · 44 lines

What it actually says

Review changed code for HIGH-CONFIDENCE, exploitable security vulnerabilities only — not style, not theoretical hardening, not pre-existing issues outside the diff.

Categories

Input validation (SQL/command/XXE/template/NoSQL injection, path traversal) · auth (bypass, privilege escalation, session/JWT flaws) · crypto/secrets (hardcoded keys, weak algorithms, bad key storage/randomness, cert bypass) · code execution (insecure deserialization, eval injection, XSS) · data exposure (secrets/PII in logs, endpoint leakage, debug info).

Confidence

Only report what you're >80% sure is actually exploitable. Local-network-only still counts as HIGH. Never report: DOS/resource exhaustion, secrets on disk if otherwise secured, rate limiting, missing best-practice hardening with no concrete exploit path, test-only files, outdated third-party libraries.

Method

Trace data flow from user input to sensitive operations. Compare against this codebase's own established sanitization/auth patterns — a deviation from the project's own norm is a stronger signal than an abstract rule. Read the code, don't try to reproduce it.

Before reviewing, check for two optional repo config files — neither is required, missing means no-op, same behavior as without them:

  • .margaret/security-instructions.md: extra categories/context to fold into Categories above, never a replacement for it.
  • .margaret/security-exclude: one path glob per line (e.g. vendor/**); drop any finding whose file matches.

Output

Per finding: file:line, severity (HIGH/MEDIUM only — LOW is noise), category, one-line description, exploit scenario, fix. If nothing clears the bar: say so and stop.

Boundaries

Security only — route over-engineering findings to /margaret-scan. Lists findings, applies no fixes.

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. 8d ago First seen · 44 lines · 184 tokens per session scan A 3e285555d734

Subscribe to this mod's changes

margaret-guard is a skill published in the GitHub repository sofiahernandes/margaret (2 stars, last pushed 24d ago), licensed MIT. It adds 184 tokens to every session and 599 once invoked, about $0.0009 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.

Related

Other skills, from other repositories

skillnote

Self-hosted skill registry for OpenClaw. Stores procedures your team writes (name, description, body), syncs them to disk before each task, and collects which-helped/which-failed signals from the agent so the registry improves over time.

luna-prompts/skillnote · 54 tokens

chatcrystal-debug-recall

Recall ChatCrystal memories for debugging tasks involving failing tests, compiler errors, runtime exceptions, dependency issues, environment breakage, or performance regressions. Use when historical root causes, fixes, or pitfalls may accelerate diagnosis before proposing a fix.

ZengLiangYi/ChatCrystal · 54 tokens

verify

Fact-check claims encountered during reading — dates, names, events, citations. Use when encountering historical facts or disputed claims.

yha9806/academic-writing-toolkit · 26 tokens

test-coverage

Use after writing tests to assess coverage quality across structural, mutation, requirements, and API/integration dimensions; organized knowledge for choosing and interpreting coverage analyses.

NeoLabHQ/context-engineering-kit · 34 tokens

do-competitively

Execute tasks through competitive multi-agent generation, meta-judge evaluation specification, multi-judge evaluation, and evidence-based synthesis.

NeoLabHQ/context-engineering-kit · 29 tokens

create-rule

Use when found gap or repetative issue, that produced by you or implemenataion agent. Esentially use it each time when you say "You absolutly right, I should have done it differently." -> need create rule for this issue so it not appears again.

NeoLabHQ/context-engineering-kit · 59 tokens