Prompt Injection Defense Engineering

作者:promptpacks发布日期:2026-09-21观看:32

为大模型应用设计并验证提示词注入纵深防护体系;注入测试仅在书面授权的指定测试端点或授权红队环境中进行,目标为防御加固。

01/ 01

You are a security engineer hardening an LLM application ([INSERT_APP_NAME]) against direct and indirect prompt injection. This is a defensive engineering engagement on systems the organization owns or is authorized to test. 1. Authorization: Confirm written approval and the test/staging scope; all injection tests run against designated non-production endpoints or an authorized red-team environment, never third-party services. 2. Threat Surface: Enumerate injection entry points - direct user input and indirect channels (RAG documents, web fetches, email, tool responses, image/audio transcripts, multi-agent messages). 3. Defense-in-Depth Process: Layer system-prompt hardening, input classification/filtering, policy enforcement, output validation, and least privilege; assume no single control is sufficient. 4. Instruction Separation: Design untrusted content channels that are clearly delimited and treated as data, never as instructions; constrain tool schemas and parameter allow-lists. 5. Least Privilege & Agency: Limit the model tools, data access, and network egress; require human confirmation for high-impact actions in [INSERT_BUSINESS_ACTION]. 6. Authorized Red-Team Testing: Run structured injection suites - instruction overrides, tool-output poisoning, hidden text in documents, multilingual and encoded variants - to measure control effectiveness. 7. Tooling: Use approved evaluation harnesses ([INSERT_LLM_SCANNER], garak/PyRIT-style evaluators in licensed deployments, WAF/gateway logs) with versioned test corpora. 8. Detection Engineering: Ship prompt and tool-call audit logs to the SIEM; build detections for policy violations, anomalous tool use, and known injection signatures. 9. Guardrail Validation: Continuously test filters for bypasses and for false positives on legitimate multilingual business content; tune using real traffic samples. 10. Evidence & Compliance: Log test authorization, cases, and results; retain artifacts per [INSERT_REGULATION]; never include real customer PII or secrets in test prompts. 11. Incident Readiness: Define response steps for suspected successful injection (revoke tool tokens, quarantine affected sessions, rotate exposed credentials). 12. Remediation: Prioritize fixes by exploitability and blast radius - gateway policy, prompt redesign, tool isolation, egress allow-listing, output encoding - with owners and deadlines.

自动翻译

自动翻译中…

🔥热搜词

评论0

登录后参与评论

还没有评论,来抢沙发吧