OWASP LLM Top 10: SAMM

# OWASP Top 10 for LLMs Mapped to SAMM

This document outlines the application of the [Software Assurance Maturity Model (SAMM)](https://owaspsamm.org/model/) to address the [OWASP Top 10 for Large Language Model Applications](https://owasp.org/www-project-top-10-for-large-language-model-applications/#). SAMM provides a comprehensive framework for ensuring software security that can be adapted to mitigate risks associated with LLMs.

## SAMM Security Practices and LLM Vulnerabilities

For each LLM vulnerability, relevant SAMM activities and practices are suggested to help mitigate associated risks:

### LLM01: Prompt Injection

- **Design**: Incorporate threat modeling to identify and mitigate potential injection points.
- **Implementation**: Enforce input validation and sanitization to prevent prompt injection attacks.

### LLM02: Insecure Output Handling

- **Implementation**: Use secure coding practices to encode and safely handle all outputs.
- **Verification**: Perform regular security testing to identify and rectify insecure output handling.

### LLM03: Training Data Poisoning

- **Design**: Establish secure design principles that include validation and verification of training data sources.
- **Implementation**: Implement controls to ensure the integrity and security of training data.

### LLM04: Model Denial of Service

- **Operations**: Monitor and manage operational loads to prevent denial of service. Implement rate limiting and resource management strategies.
- **Verification**: Conduct performance and security testing to ensure resilience against DoS attacks.

### LLM05: Supply-Chain Vulnerabilities

- **Governance**: Develop and enforce policies for secure third-party component use.
- **Design**: Assess the security posture of third-party components and services integrated with LLMs.

### LLM06: Sensitive Information Disclosure

- **Design**: Classify data and define controls for handling sensitive information.
- **Implementation**: Apply encryption and access controls to protect sensitive data processed by LLMs.

### LLM07: Insecure Plugin Design

- **Design**: Ensure security considerations are integrated into the design of plugins and extensions.
- **Implementation**: Securely develop and maintain plugins, including regular security assessments.

### LLM08: Excessive Agency

- **Design**: Define clear boundaries for LLM decision-making capabilities within the system design.
- **Governance**: Establish oversight mechanisms for ethical and secure use of LLM technologies.

### LLM09: Overreliance

- **Education & Guidance**: Provide training on the capabilities and limitations of LLMs to prevent overreliance.
- **Governance**: Monitor and evaluate the use of LLM technologies to ensure balanced and secure application.

### LLM10: Model Theft

- **Implementation**: Protect LLM intellectual property through robust access controls and encryption.
- **Verification**: Regularly audit and test the security measures in place to protect LLM models from theft.

Note: The application of SAMM practices to LLM vulnerabilities requires a tailored approach that considers the specific context and use cases of LLM technologies within an organization. Regular assessments and improvements to the software security assurance program are essential to address evolving risks and ensure the secure deployment of LLMs.