guard
星标13
分支1
更新时间2026年1月23日 09:10
Analyze and prepare prompts with JSON for safe context submission
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Analyze and prepare prompts with JSON for safe context submission
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Feature development with guardrails. Plan → Review → Code → Ship.
Feature development with guardrails. Plan → Review → Code → Ship.
Run a full, policy-compliant feature development flow with structured review phases
Interactive menu for managing cook artifacts
基于 SOC 职业分类
| name | guard |
| description | Analyze and prepare prompts with JSON for safe context submission |
| user-invocable | true |
Epistemic safety analysis for JSON data in prompts. Prevents LLMs from reasoning with unjustified certainty when input data is incomplete.
When /guard is invoked, execute the guard script:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/guard_cmd.py" "<file_path>" [options]
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/guard_cmd.py" - [options] <<'GUARD_INPUT'
<json_data>
GUARD_INPUT
| Option | Description |
|---|---|
--mode | analysis|summary|forensics (default: auto-detect) |
--force | Bypass blocks, emit warnings only |
--allow-sampling | Permit sampling for forensic queries |
--no-reduce | Skip lossless reduction phase |
--budget-tokens N | Token budget (default: 3500) |
--print-only | Output report only, never auto-send |
--json | Output result as JSON |
| Mode | Sampling | Use Case |
|---|---|---|
analysis | Allowed | "What categories exist?", "Price range?" |
summary | Aggressive | "Describe the data structure" |
forensics | BLOCKED | "Why did request id=X fail?" |
============================================================
CONTEXT GUARD ANALYSIS
============================================================
Decision: [OK] ALLOW | [~] SAMPLE | [X] BLOCK
Mode: analysis | summary | forensics
TOKEN ANALYSIS:
Original: 5,234 tokens
After reduce: 4,891 tokens (-343)
Budget: 3,500 tokens
============================================================
ANTHROPIC_API_KEY environment variable (for token counting)