Organisations have spent the last eighteen months shipping AI features quickly. Now the frameworks and regulations are arriving:
- In April, NIST released a draft Secure Software Development Practices for Generative AI and Dual-Use Foundation Models (SP 800-218A), a community profile extending its Secure Software Development Framework (SSDF) to AI.
- Also in April, CISA, the NSA and international partners published joint guidance on deploying AI systems securely.
- In May, the EU's Council gave final approval to the AI Act, which will impose obligations on providers and deployers of AI systems according to their risk level.
For product and engineering leaders, the message is that AI features need a secure development lifecycle with the same discipline as other software, plus some additions.
Principle: extend, don't fork
The biggest mistake is creating a separate, parallel process for AI that teams see as bureaucracy. Instead, extend the SDLC you already have with AI-specific activities at the right points.
Phase 1: assess the use case
Before building, answer:
- What will the AI do, and what decisions or actions does it influence?
- What is the risk tier? A drafting assistant for internal emails is different from a system that affects credit, employment or health decisions, which may fall into high-risk categories under the EU AI Act.
- What data is involved? Personal data, confidential data, customer data, regulated data?
- Which models and providers, and are they approved for this data?
The output is a risk tier that determines the depth of everything that follows.
Phase 2: design
- Threat model the feature, including AI-specific threats: prompt injection (direct and indirect), oversharing through retrieval, excessive agency, unsafe output handling and cost abuse.
- Choose controls: permission-aware retrieval, tool scoping, human approval points, output validation, rate limits.
- Plan evaluation: what does "good" mean for this feature, and how will you measure quality, safety and security?
Phase 3: build
- Version everything: prompts, system instructions, model identifiers, retrieval configuration, tool definitions. These are code.
- Review changes to prompts and tool permissions like any other change.
- Apply standard secure coding and pipeline controls to the surrounding application.
- Keep secrets and sensitive data out of prompts and logs.
ai-feature/
├── prompts/
│ ├── system.v7.md # reviewed, versioned
│ └── answer_with_sources.v3.md
├── config/
│ ├── model.yaml # provider, model version, temperature, max tokens
│ └── retrieval.yaml # index, filters, top_k, re-ranker
├── tools/
│ └── definitions.json # schemas, scopes, approval requirements
└── evals/
├── quality.jsonl
├── safety.jsonl
└── security.jsonl # injection, oversharing, tool misuse casesPhase 4: verify
- Evaluations for quality and safety on representative data, with thresholds.
- Security tests: injection, cross-user retrieval, tool misuse, output handling and rate limits.
- Red teaming proportionate to the risk tier.
- Classic AppSec testing of the application, APIs and infrastructure.
All of it should run in CI where possible, and gate releases.
flowchart LR
C[Change to prompt,<br/>model, retrieval or tools] --> Q[Quality evals]
C --> S[Safety evals]
C --> Sec[Security evals &<br/>AppSec checks]
Q --> G{Thresholds met?}
S --> G
Sec --> G
G -->|yes| Rel[Release with<br/>evidence recorded]
G -->|no| Fix[Fix & retest]Phase 5: release and operate
- Staged rollout with monitoring of quality, safety signals and cost.
- Logging and tracing of prompts, retrievals, tool calls and outputs, with privacy controls.
- Incident response: the ability to disable the feature or specific tools quickly, rotate keys and purge indexes.
- Re-evaluation whenever the model provider changes a model, or on a regular schedule.
Evidence and governance
Regulations and customers increasingly ask not just whether AI systems are safe, but how you know. Keep:
- risk assessments and their tiering decisions,
- threat models and design decisions,
- evaluation results for each release,
- red-team findings and remediation, and
- records of model versions and data sources.
Much of this can be generated automatically by the pipeline, which makes compliance a by-product of good engineering rather than a separate effort.
The bottom line
A secure AI SDLC is the existing SDLC with AI-aware additions: use-case risk assessment, AI threat modelling, versioned prompts and configuration, evaluation and red teaming as release gates, and operational monitoring and response. Build it into how teams already work, keep the evidence as you go, and it scales from a single feature to an AI-first product portfolio.
Our application security testing, risk assessment and agentic AI security teams help organisations put a secure AI SDLC into practice.