Promptguard
Offline prompt-contract auditor for Hermes, Claude Code, Codex, OpenCode & OpenClaw. Pre-write guard before agents ship vague code. Zero deps. No model API.
npx -y skills add mturac/promptguard --skill promptguardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Audit system prompts, agent prompts, router prompts, tool/function-call prompts, and coding-agent instructions as executable contracts. Use before writing or seeding prompts; blocks vague "fix this / write code" tasks missing ownership and verification. Works with Hermes, Claude Code, Codex, OpenCode, OpenClaw.
SKILL.md
4.2 KB, as published. Nobody here has run it
PromptGuard
Audit prompts as executable contracts, not writing style. The core job is to compare what the prompt literally says with what the user expects the model to do.
When Triggered
Use this skill when the user shares, writes, reviews, debugs, or asks to improve:
- system prompts
- agent/router prompts
- evaluator prompts
- tool or function-call instructions
- prompt files in a repo
Workflow
- Identify the surface: TUI, web chat, API, router, tool call, evaluator, or agent persona.
- Extract contracts: role, task, input, context, output, boundaries, safety escalation, memory/state, tool schema, evaluation.
- Flag failures: missing contract, conflicting instruction, ambiguous boundary, passive safety escalation, role drift, provider schema mismatch. Also flag vague intent, later-rule override, context retention illusion, and false certainty. For coding/build prompts, flag missing responsibility, owned surface, constraints, verification, and accountability report.
- Return findings as:
Severity | Evidence | Impact | Missing/Conflicting Contract | Clarification Contract | Questions to Ask | Approval Contract | Fix Draft
Clarification questions must be generated from the missing decision point. Do not hardcode them to one example like reports.
Pre-Write Guard
If the user asks to add, save, insert, seed, update, or write a prompt, audit the proposed prompt before editing files.
For pasted prompt text:
printf '%s' '<prompt text>' | python3 skills/promptguard/scripts/audit_prompt.py - --format markdown
If high or critical findings appear, do not write yet. Show findings and ask for explicit approval or offer a fixed draft.
Deterministic Audit
Prefer the installed package when available:
promptguard audit path/to/prompt-file --profile coding-agent --fail-on high --format markdown
promptguard audit-repo . --profile coding-agent --fail-on high --format sarif
Skill scripts delegate to the same CLI (package import or repo pip install -e .):
python3 skills/promptguard/scripts/audit_prompt.py path/to/prompt-file --profile coding-agent --fail-on high --format markdown
python3 skills/promptguard/scripts/audit_repo.py . --profile system --format markdown
Supported flags (shared with package CLI):
--profile general|coding-agent|system|security--fail-on critical|high|medium|low|info|none--rules PATH--format markdown|json|table|csv|sarif--accept-risk ID:reason(repeatable)--apply-accepted--save
Installed skill script paths (first that exists):
# Hermes (active profile home; often ~/.hermes or ~/.serhatagent)
python3 "$HERMES_HOME/skills/promptguard/scripts/audit_prompt.py" …
python3 ~/.hermes/skills/promptguard/scripts/audit_prompt.py …
# Codex / Claude / OpenCode
python3 ~/.codex/skills/promptguard/scripts/audit_prompt.py …
python3 ~/.claude/skills/promptguard/scripts/audit_prompt.py …
python3 ~/.config/opencode/skills/promptguard/scripts/audit_prompt.py …
Prefer the installed promptguard package when importable (pip install -e . / pipx).
Do not stop after discovering prompt files. Discovery is not completion. If a prompt-like file exists and the script exists, running the script is mandatory.
Severity
critical: unsafe, illegal, or harmful behavior risk.high: privacy, routing, parsing, or tool-call breakage.medium: inconsistent UX or agent boundary drift.low: maintainability or clarity issue.
Prefer concrete contract fixes over generic prompt advice.
Out of scope (this skill)
- Network LLM / remote model calls (stay offline and deterministic)
- Runtime chat firewalls / red-team attack generation