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的越狱和提示词注入攻击

Was this page helpful?

  • harmlessness_screen工具内的提示

越狱和提示词注入发生在用户精心设计提示词来利用模型漏洞,旨在生成不当内容的情况下。虽然Claude本身对此类攻击具有很强的抵抗力,但以下是加强防护的额外步骤,特别是针对违反我们的服务条款或使用政策的使用。

  • 有害内容筛选:使用轻量级模型(如Claude Haiku 4.5)对用户输入进行预筛选。使用结构化输出将响应限制为简单的分类。

  • 输入验证:过滤提示词中的越狱模式。您甚至可以通过提供已知的越狱语言作为示例,使用LLM创建一个通用的验证筛选器。

  • 提示词工程:设计强调伦理和法律边界的提示词。

调整响应,并考虑对重复进行滥用行为试图规避Claude防护的用户进行限流或封禁。例如,如果某个特定用户多次触发相同类型的拒绝(例如"输出被内容过滤政策阻止"),告知用户他们的行为违反了相关使用政策并采取相应措施。

  • 持续监控:定期分析输出中的越狱迹象。 使用此监控来迭代改进您的提示词和验证策略。

高级:链式防护

结合策略以实现强大的保护。以下是包含工具使用的企业级示例:

通过分层这些策略,您可以创建针对越狱和提示词注入的强大防御,确保您的Claude驱动的应用程序维持最高的安全和合规标准。