Most AI projects reach production with security requirements that were never written down, so nobody can say what "secure enough" meant or test against it. This template gives architects, AI product owners and procurement teams a set of numbered, testable security requirements to put into a design document, a statement of work or a tender for any large language model (LLM) or machine learning (ML) project, whether it is built in house or assembled from a hosted model and third-party tools. Each requirement has an ID, a rationale, a verification method and a mapping to the OWASP Top 10 for LLM Applications 2025 and the NIST AI Risk Management Framework (AI RMF). It is the specification side of the work: use the AI Procurement Checklist and the AI Vendor Security Questionnaire Template to assess a supplier, and the Agentic AI Security Policy Template for organisation-wide policy.
How to use this template
- Replace text in square brackets, such as [Organisation], [System name], [risk tier] and [AI security lead], with your own values.
- Copy sections 1 to 7 into the project's design document or the requirements annex of a contract. Keep the IDs stable so test results, exceptions and audit evidence can refer to them.
- Mark each requirement Mandatory, Conditional or Not applicable using the tailoring table in Implementation guidance. Record a reason for every "Not applicable".
- Requirements use "shall" for obligations and "should" for recommendations. Each has a verification method: Design review, Test, Configuration evidence or Contract evidence.
- The mapping column cites OWASP LLM risk IDs (LLM01 to LLM10, 2025 edition) and NIST AI RMF subcategories. Mappings show which risk a requirement addresses; they are not a claim of compliance with either document.
- Classic ML projects without a generative model can skip requirements marked "LLM only" and keep the rest.
1. Purpose and scope
1.1 This document sets the security requirements for [System name], owned by [Business owner] at [Organisation], classified as [risk tier] in the AI register. See the AI Register and AI Inventory Template.
1.2 Scope covers the model (built, fine-tuned or consumed through an API), training and evaluation data, retrieval stores, prompts and system instructions, orchestration code, tools and agents the model can call, user interfaces, logs and the hosting environment.
1.3 These requirements apply in addition to [Organisation]'s secure development standard and application security baseline. See Application Security Requirements from ASVS for the conventional web and API layer.
1.4 Roles: the [AI security lead] approves exceptions, the [System owner] holds the residual risk, and the [Data protection officer] signs off requirements in section 2.
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| SC-01 | The system shall have a documented intended purpose, users, prohibited uses and a named owner before build starts. | Requirements cannot be tailored without a defined use | Design review | AI RMF GOVERN 2.1, MANAGE 1.1 |
| SC-02 | A threat model shall be produced covering prompt injection, data leakage, poisoning, tool misuse and abuse of cost, and refreshed at each major change. | AI attack paths differ from conventional applications | Design review | LLM01 to LLM10; AI RMF MEASURE 2.7 |
| SC-03 | Applicable legal and regulatory requirements shall be listed with an owner for each. | Obligations shape logging, data and transparency choices | Design review | AI RMF GOVERN 1.1 |
2. Data protection requirements
2.1 Training, fine-tuning, evaluation and retrieval data shall be classified using [Organisation]'s data classification scheme before use.
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| DP-01 | Personal and confidential data shall not be used for training or fine-tuning without an approved assessment and a recorded legal basis. | Models can memorise and reproduce training data | Design review | LLM02; AI RMF MEASURE 2.10 |
| DP-02 | Where a hosted model is used, the contract shall state that prompts and outputs are not used to train the provider's models and shall state retention periods. | Data leaves the organisation's control at the API boundary | Contract evidence | LLM02; AI RMF GOVERN 6.1 |
| DP-03 | Retrieval stores shall enforce the source system's access rights at query time, so users only retrieve documents they could open directly. | Retrieval-augmented generation can bypass document permissions | Test | LLM08, LLM02 |
| DP-04 | Data at rest (datasets, embeddings, logs) shall be encrypted with keys managed under [Organisation]'s key management standard. | Embeddings and logs contain sensitive content | Configuration evidence | LLM08 |
| DP-05 | Data provenance shall be recorded for every training and retrieval dataset: source, owner, licence, date and integrity hash. | Supports poisoning investigation and deletion requests | Configuration evidence | LLM04; AI RMF GOVERN 1.6 |
| DP-06 | A process shall exist to remove a data subject's data from retrieval stores and to assess retraining where it is in training data. | Privacy rights extend to AI systems | Test | LLM02; AI RMF MEASURE 2.10 |
Further guidance: the GenAI Data Security Risks and Mitigations Guide.
3. Model and supply chain requirements
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| MS-01 | Every model, adapter, dataset, library and tool server shall be listed in an AI bill of materials (AI-BOM) with version and source. | You cannot patch or withdraw what you have not listed | Configuration evidence | LLM03; AI RMF MANAGE 3.2 |
| MS-02 | Third-party model files shall come only from [approved registries], with integrity verified by hash or signature before loading. | Tampered models and unsafe serialisation formats can run code on load | Test | LLM03, LLM04 |
| MS-03 | Model formats that execute code on deserialisation should be avoided; where used, they shall be scanned and loaded in an isolated environment. | Reduces code execution risk from model files | Configuration evidence | LLM03 |
| MS-04 | Model providers and tool suppliers shall be assessed under [Organisation]'s third-party risk process before production use. | Third-party AI is a shared responsibility | Contract evidence | AI RMF GOVERN 6.1, MANAGE 3.1 |
| MS-05 | Model or provider version changes shall go through change control with regression and security evaluation (section 6) before release. | A silent model update changes behaviour and safety | Test | AI RMF MANAGE 3.2, MEASURE 2.3 |
| MS-06 | Model weights and system prompts for in-house models shall be stored with access restricted to named roles and logged. | Weights and prompts are high-value assets | Configuration evidence | LLM07 |
See the AI Supply Chain and AI-BOM Guide.
4. Input, output and prompt handling
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| IO-01 | All content from users, documents, web pages, emails and tool results shall be treated as untrusted input to the model (LLM only). | Indirect prompt injection arrives through data, not only through users | Design review | LLM01 |
| IO-02 | Security decisions (authorisation, payments, data release) shall be enforced by deterministic code outside the model, never by instructions in the prompt. | Prompt instructions can be overridden | Design review | LLM01, LLM06 |
| IO-03 | System prompts shall contain no secrets, credentials or access rules that must stay confidential (LLM only). | System prompts should be assumed to leak | Test | LLM07 |
| IO-04 | Model output shall be encoded or validated for its destination (HTML, SQL, shell, code, file paths) before use. | Unvalidated output becomes injection into downstream systems | Test | LLM05 |
| IO-05 | Input and output filtering for [defined content categories and sensitive data patterns] shall be applied, with blocked events logged. | Reduces leakage and harmful output | Test | LLM02, LLM01 |
| IO-06 | Rate limits, token limits, request size limits and spend caps shall be set per user, per tenant and per service identity. | Prevents denial of wallet and resource exhaustion | Configuration evidence | LLM10 |
| IO-07 | Where outputs inform decisions, the interface shall show sources or confidence and state that output may be wrong. | Over-reliance on incorrect output | Design review | LLM09; AI RMF MEASURE 2.9 |
See the OWASP LLM Top 10 LLM01 Prompt Injection Guide and the AI Guardrails and AI Firewalls Guide.
5. Access, identity and agents
5.1 This section applies whenever the model can call tools, APIs, Model Context Protocol (MCP) servers or other agents, or act for a user.
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| AG-01 | Each agent or AI service shall have its own non-human identity with a named human owner; shared or personal credentials shall not be used. | Actions must be attributable and revocable | Configuration evidence | LLM06; AI RMF GOVERN 2.1 |
| AG-02 | Tool permissions shall be listed in a permission matrix and limited to the minimum functions, scopes and data needed for the use case. | Excessive functionality and permissions widen the blast radius | Design review | LLM06 |
| AG-03 | Agents acting for a user shall operate with that user's delegated rights (for example OAuth on-behalf-of tokens), not a broad service credential. | Prevents privilege escalation through the agent | Test | LLM06, LLM02 |
| AG-04 | Credentials shall be short-lived, held in a secrets manager and never placed in prompts, context windows or model-visible files. | Model context can be extracted | Configuration evidence | LLM02, LLM07 |
| AG-05 | Actions classed as [high impact: payments, deletion, external send, privilege change] shall require human approval with the full action shown to the approver. | Limits damage from injected or mistaken actions | Test | LLM06; AI RMF MANAGE 2.4 |
| AG-06 | Tool and MCP servers shall be allow-listed, version-pinned and authenticated; tool descriptions from third parties shall be reviewed before enablement. | Tool metadata is an injection and supply chain path | Configuration evidence | LLM03, LLM01 |
| AG-07 | Agent sessions shall have limits on steps, run time and spend, and a kill switch that revokes the agent's credentials. | Stops runaway loops and contains compromise | Test | LLM10; AI RMF MANAGE 2.4 |
| AG-08 | Agent identities and permissions shall be included in [quarterly] access reviews. | Agent permissions drift over time | Configuration evidence | AI RMF GOVERN 1.6 |
Build the matrix with the AI Agent Permission Matrix Template. See also OWASP LLM Top 10 LLM06 Excessive Agency Guide and the Human-in-the-Loop for AI Agents Guide.
6. Logging, monitoring and evaluation
Logging and monitoring
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| LM-01 | The system shall log prompts, retrieved sources, model and version, tool calls with parameters, approvals, and outputs, linked by a trace ID and the acting identity. | Needed to investigate injection and misuse | Test | AI RMF MANAGE 4.1 |
| LM-02 | Logs containing personal data shall be access-restricted and kept for [retention period] in line with the privacy notice. | Logs are a new store of sensitive data | Configuration evidence | LLM02; AI RMF MEASURE 2.10 |
| LM-03 | Alerts shall exist for filter blocks above [threshold], unusual tool call patterns, spend spikes and access to sensitive retrieval collections. | Detects attacks in progress | Test | LLM01, LLM06, LLM10 |
| LM-04 | AI logs shall be forwarded to [SIEM] and covered by SOC use cases. | AI events need the same triage as other security events | Configuration evidence | AI RMF MANAGE 4.1 |
See the LLM Observability Guide.
Evaluation and red team acceptance criteria
| ID | Acceptance criterion | Verification | Maps to |
|---|---|---|---|
| EV-01 | Before release, the system shall pass a security test suite covering direct and indirect prompt injection, system prompt extraction, sensitive data disclosure, output injection and excessive agency, with no open finding rated [high] or above. | Test | LLM01, LLM02, LLM05, LLM06, LLM07; AI RMF MEASURE 2.7 |
| EV-02 | Attack success rate on the agreed injection test set shall be at or below [target %], measured on the release candidate in a production-like configuration. | Test | LLM01; AI RMF MEASURE 2.3 |
| EV-03 | High and critical risk systems shall have an independent red team exercise before first release and after major change, with a written report and retest. | Test | AI RMF MEASURE 2.7 |
| EV-04 | Accuracy, safety and fairness evaluations relevant to the use case shall meet [defined thresholds], with results documented. | Test | LLM09; AI RMF MEASURE 2.5, 2.6, 2.11 |
| EV-05 | The regression suite shall be re-run on every model, prompt, retrieval or tool change, and results compared with the last accepted baseline. | Test | AI RMF MEASURE 2.3, MANAGE 3.2 |
Plan the exercise with the AI Red Team Test Plan Template.
7. Incident and retirement
| ID | Requirement | Rationale | Verification | Maps to |
|---|---|---|---|---|
| IR-01 | AI-specific incident types (prompt injection with impact, data leakage through output, poisoning, unsafe agent action, provider breach) shall be added to the incident response plan with playbooks. | Responders need to recognise AI incidents | Design review | AI RMF MANAGE 2.3, MANAGE 4.3 |
| IR-02 | The system shall support rapid disablement: feature flag off, agent credentials revoked, fallback to a non-AI process. | Containment must not depend on the model | Test | AI RMF MANAGE 2.4 |
| IR-03 | Providers shall notify [Organisation] of security incidents affecting its data within [hours] and support investigation. | Third-party failure is a common source of AI incidents | Contract evidence | AI RMF GOVERN 6.2 |
| IR-04 | Incidents and material errors shall be communicated to affected users and regulators where required. | Transparency and legal duties | Design review | AI RMF MANAGE 4.3 |
| IR-05 | On retirement, credentials, API keys and agent identities shall be revoked; datasets, embeddings, fine-tuned weights and logs shall be deleted or archived per retention rules; the AI register shall be updated. | Orphaned AI assets keep access and data | Configuration evidence | AI RMF GOVERN 1.7 |
See the AI Incident Management and Escalation guide.
Implementation guidance
Tailoring by risk
| Risk tier | Typical example | Mandatory sections | Evaluation |
|---|---|---|---|
| Low | Internal drafting assistant, no tools, no confidential data | 1, 2 (DP-02), 4, 6 (LM-01) | EV-01 by the project team |
| Medium | Retrieval assistant over internal documents | 1 to 4, 6, 7 | EV-01, EV-02, EV-05 |
| High | Customer-facing assistant, or agent with write tools | All sections | EV-01 to EV-05, independent red team |
| Critical | Autonomous agent touching payments, health, safety or privileged systems | All, with AG-05 approval on every high-impact action | All, plus retest after every major change |
Rollout steps
- Agree the risk tier and tailor the requirement list at the design gate, with the [AI security lead] and [System owner] signing it.
- Put the tailored list into the backlog or contract annex as acceptance criteria, keeping the IDs.
- Run design review items before build; set up logging and limits (LM, IO-06, AG-07) before the first internal pilot.
- Pilot with a small user group and limited tools, with filters in monitor mode first, then enforcing once false positives are understood.
- Run the evaluation suite and red team; record results against each EV ID.
- Release only with all Mandatory requirements met or an approved, time-limited exception. Keep rollback ready: the IR-02 disablement path and the previous model version.
- Re-run the suite on every change and review the tailoring yearly or when the use case grows.
Measuring whether it works
- Coverage: percentage of AI systems in the register with a signed requirements set.
- Exceptions: number of open exceptions and their average age.
- Attack success rate: trend of EV-02 across releases.
- Agent hygiene: percentage of agent identities with an owner and a review in the last cycle.
- Response: time from AI security alert to disablement in exercises.
Common mistakes
- Relying on system prompt instructions as a security control instead of IO-02.
- Giving agents a broad service account because delegated access was hard to build.
- Testing the model once, then letting the provider update it without re-running EV-05.
- Logging prompts and outputs without treating the logs as sensitive data.
- Writing requirements without verification methods, so acceptance becomes opinion.
Sources behind this template
Requirements draw on the OWASP Top 10 for LLM Applications 2025, the NIST AI RMF Playbook, NIST AI 600-1 Generative AI Profile (July 2024) and the NCSC Guidelines for secure AI system development (November 2023), whose four stages of secure design, development, deployment, and operation and maintenance this template follows. For the frameworks themselves, see the NIST AI RMF Guide and the NIST AI 600-1 Generative AI Profile Guide.
Related NHI Mgmt Group resources: AI Procurement Checklist · Agentic AI Security Policy Template · AI Agent Permission Matrix Template · AI Red Team Test Plan Template