Loading...
  • 建構
  • 管理
  • 模型與定價
  • 客戶端 SDK
  • API 參考
Search...
⌘K
Log in
緩解越獄
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
建構/強化防護欄

緩解越獄和提示詞注入

了解如何防止用戶利用提示詞漏洞生成不當內容,包括使用無害性篩選、輸入驗證和提示詞工程等策略。

越獄和提示詞注入發生在用戶精心設計提示詞以利用模型漏洞時,目的是生成不當內容。雖然 Claude 對此類攻擊具有內在的抵抗力,但以下是加強您的防護措施的額外步驟,特別是針對違反我們的服務條款或使用政策的使用情況。

  • 無害性篩選:使用輕量級模型(如 Claude Haiku 4.5)對用戶輸入進行預篩選。使用結構化輸出將響應限制為簡單的分類。

  • 輸入驗證:篩選提示詞中的越獄模式。您甚至可以使用 LLM 通過提供已知的越獄語言作為示例來創建通用驗證篩選。

  • 提示詞工程:設計強調倫理和法律邊界的提示詞。

調整響應,並考慮對重複進行濫用行為以試圖規避 Claude 防護措施的用戶進行限流或禁止。例如,如果特定用戶多次觸發相同類型的拒絕(例如"輸出被內容過濾政策阻止"),告知用戶他們的行為違反了相關使用政策並採取相應行動。

  • 持續監控:定期分析輸出中的越獄跡象。 使用此監控來迭代改進您的提示詞和驗證策略。

進階:鏈式防護

結合策略以實現強大的保護。以下是一個包含工具使用的企業級示例:

通過分層這些策略,您可以創建針對越獄和提示詞注入的強大防禦,確保您的 Claude 驅動的應用程序維持最高的安全和合規標準。

Was this page helpful?

  • harmlessness_screen 工具中的提示詞