概念
AI security threats and defenses
The main ways an AI application can be attacked or leak data, and what defends against each.
本课尚未翻译,暂以英文显示。
Prompt injection
- Input checks, prompt attack filters, least privilege
Data leakage
- Sensitive information filters, encryption, access control
Toxic output
- Content filters on inputs and outputs
Unauthorized access
- IAM roles and least privilege
Weak software
- Vulnerability scanning and patching
Poisoned data
- Trusted sources, integrity checks
No record of use
- Audit trail and logging
| Threat | Defense |
|---|---|
| Prompt injection | Input checks, prompt attack filters, least privilege |
| Data leakage | Sensitive information filters, encryption, access control |
| Toxic output | Content filters on inputs and outputs |
| Unauthorized access | IAM roles and least privilege |
| Weak software | Vulnerability scanning and patching |
| Poisoned data | Trusted sources, integrity checks |
| No record of use | Audit trail and logging |
1 / 2
Prompt injection
- Input checks, prompt attack filters, least privilege
Data leakage
- Sensitive information filters, encryption, access control
Toxic output
- Content filters on inputs and outputs
Unauthorized access
- IAM roles and least privilege
| Threat | Defense |
|---|---|
| Prompt injection | Input checks, prompt attack filters, least privilege |
| Data leakage | Sensitive information filters, encryption, access control |
| Toxic output | Content filters on inputs and outputs |
| Unauthorized access | IAM roles and least privilege |
2 / 2
Weak software
- Vulnerability scanning and patching
Poisoned data
- Trusted sources, integrity checks
No record of use
- Audit trail and logging
| Threat | Defense |
|---|---|
| Weak software | Vulnerability scanning and patching |
| Poisoned data | Trusted sources, integrity checks |
| No record of use | Audit trail and logging |
- 1The user sends a prompt.
- 2An input check blocks attacks and sensitive data.
- 3The model writes an answer.
- 4An output filter removes unsafe content before the user sees it.
分步说明
- 1The user sends a prompt.
- 2An input check blocks attacks and sensitive data.
- 3The model writes an answer.
- 4An output filter removes unsafe content before the user sees it.
Check what goes in and what comes out.
是什么
An AI application has the same weaknesses as any application, plus some of its own. Application security covers the code and the APIs. Infrastructure protection covers networks and servers. Vulnerability management finds and fixes weak software. Threat detection spots attacks as they happen. All of these still apply.
New risks come from the model. Prompt injection hides instructions in a prompt or a document to make the model ignore its rules. Data leakage lets the model reveal private data from its prompt, its training data or its sources. Toxicity is harmful, hateful or abusive output. Poisoned training data can bend a model’s behavior.
是什么
Defend in layers. Check inputs before the model and filter outputs after it. Encrypt data at rest and in transit. Grant least privilege. Keep an audit trail: log who called the model, and log the prompts and answers where rules allow. Output validation means checking that answers have the expected shape and contain nothing unsafe before the application uses them.
要记住
- Prompt injection: instructions hidden in input that override the rules. Defend with input checks, guardrails and least privilege.
- Data leakage: private data in an answer. Defend with sensitive information filters, encryption and access control.
- Toxicity: harmful output. Defend with content filters.
- Filter inputs before the model and validate outputs after it.
要记住
- Keep an audit trail of AI interactions: who called what, and when.
- Old rules still apply: patch software, protect the network, detect threats.
考试中
- “A user hides instructions in a prompt to override the system rules” describes prompt injection.
- “Stop a model from showing customers’ personal data in answers” points to sensitive information filters in Amazon Bedrock Guardrails.
- “Prove who invoked a model and when” points to an audit trail, with AWS CloudTrail.
别和这些弄混
- Prompt risks and limitsExposure, poisoning, hijacking and jailbreaking: how prompts get attacked and how to defend.
- Amazon Bedrock GuardrailsSafeguards that check what goes into a generative AI application and what comes out.
- Hallucination detection and groundingMake a model’s answers match real sources, and catch the ones that do not.