返回 Skill 列表
extension
分类: 开发与工程无需 API Key

oe-security-prompt-injection

维护和扩展提示注入防御。在添加新的用户输入界面、更改提示模板或观察到新的注入模式时使用;运行安全回归测试套件并添加一个最小的新测试案例。

person作者: jakexiaohubgithub

oe-security-prompt-injection

Run the regression suite

  • pytest backend/tests/regression/test_security_prompt_injection.py -v

Add a new attack case (when needed)

  1. Add the new payload to the parametrized attack list in backend/tests/regression/test_security_prompt_injection.py.
  2. Assert both:
    • the input is flagged as suspicious, and
    • the matched pattern/category is the expected one (so we catch drift).

Guardrails

  • Do not weaken detection to “make a test pass”; prefer tightening allowlists for safe inputs and adding targeted patterns for new attacks.