printf '%s\n' "这张提示词上覆盖了下面十条里的哪几条?" > prompt.txt
for k in "Prompt Injection" "Sensitive Information Disclosure" "Excessive Agency" \
"Supply Chain" "Data and Model Poisoning" "Unbounded Consumption" \
"Misinformation" "Hidden Context Exposure" \
"Vector and Embedding Weaknesses" "Improper Output Handling"; do
printf '%-34s %s\n' "$k" "$(grep -c "$k" prompt.txt)"
done
预期观察:十行输出,每行右侧为命中次数;未覆盖的条目计数为 0,据此把清单缺口逐条落到整改项上。
filepython
查看代码
version = "2026"
refs = [
"LLM01:2026 Prompt Injection",
"LLM03 Excessive Agency",
"LLM08 Hidden Context Exposure",
]
for r in refs:
assert version in r or r.split()[0].endswith(version), r
print("all references pinned to", version)
预期观察:逐条断言引用串里带上了版本号,全部通过时打印 all references pinned to 2026;把任一条换成上一版条目名即立刻断言失败。
OWASP Top 10 for LLM Applications 2026 is the latest community-driven guide to the most critical security risks facing applications powered by large language models.
Prompt injection is intrinsic to current generative AI... so no reliable prevention mechanism exists today... Defense is therefore architectural rather than interceptive.