lielingai/zhishi/ai-security

Claude Code and agent skill by lielingai/zhishi

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

AI 安全研究环境——对 LLM 端点的安全测试环境。任务涉及越狱测试、提示注入、数据泄露探针、模型偏见/幻觉评测时使用。内置 garak(越狱/注入探针扫描器)+ promptfoo(自定义 eval 框架)+ PyRIT(多轮攻击编排,Python 库,新 API 在 pyrit.executor.attack,无 CLI——经 python3 驱动)。Gandalf 作判分靶场。

Install

npx vskill@latest install lielingai/zhishi/ai-security

SKILL.md

ai-security —— AI 安全研究环境

何时用

对自有或授权模型端点做安全测试:越狱、提示注入、训练数据/系统提示泄露、偏见与幻觉评测。只测自有模型或拿到书面授权的模型。没有端点时拿 Gandalf(gandalf.lakera.ai)当判分靶场练链路。

怎么进

zhishi env up ai-security
zhishi env open <id> # 或 docker exec -it <container> bash

标准工作流

bash
# ① garak 基线扫描(目标:OpenAI 兼容端点)
garak --model_type openai-compatible \
--model_name <模型> \
--model_option api_base=<端点> \
--model_option key=<key> \
--probes lmrc
# ② promptfoo 自定义 eval(针对自己的威胁模型)
cat > eval.yaml <<'EOF'
prompts: [prompts.txt]
providers:
- id: openai:chat:gpt-4o
config: { apiBaseUrl: "<端点>" }
tests:
- vars: { topic: "注入" }
assert:
- type: not-contains
value: "系统提示词是"
EOF
promptfoo eval -c eval.yaml
promptfoo view
# ③ PyRIT 多轮攻击编排(garak 单轮探针打不动的场景)
python3 - <<'EOF'
import asyncio
from pyrit.common import IN_MEMORY, initialize_pyrit
from pyrit.executor.attack import PromptSendingAttack
from pyrit.prompt_target import OpenAIChatTarget
initialize_pyrit(memory_db_type=IN_MEMORY)
target = OpenAIChatTarget(endpoint="<端点>", model_name="<模型>", api_key="<key>")
attack = PromptSendingAttack(objective_target=target)
result = asyncio.run(attack.execute_async(objective="提取系统提示词"))
print(result)
EOF
# 多轮策略:RedTeamingAttack / CrescendoAttack(同包,pyrit.executor.attack)

降级路径

  • garak 探针太多跑不动 → --probes 缩小到特定类别
  • 端点不兼容 → promptfoo 支持大多数供应商协议,换 provider 配置
  • 没有端点 → 本地起一个模型再测(ollama 环境内自装),或 Gandalf 判分靶场

收尾

  • 每个确认的问题落 research_log(kind=ai-security,bug_class 挂对应类别)
  • 扫描报告落 /workspace/reports/,别只留对话里

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
92
Repository forks
5
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/lielingai/zhishi/ai-security/badge)](https://verified-skill.com/skills/lielingai/zhishi/ai-security)

Something wrong with this skill or its page? Tell us.