Security is not a feature you add at the end. It is an architectural property that comes from many design decisions: how identities work, how data flows, where trust boundaries sit, and what happens when something fails. Decisions made early are far cheaper to get right than fixes after launch.
Architects don't need to be security specialists, but they do need to design with security principles in mind and involve specialists at the right moments.
Key principles
- Least privilege
- Each component and identity has only the permissions it needs.
- Defence in depth
- Several independent layers of control: network, identity, application, data.
- Zero trust
- Authenticate and authorise every request, whatever its network location.
- Secure by default
- Safe configuration out of the box; risky options require deliberate choice.
- Fail securely
- When something breaks, it should deny access rather than allow it.
Threat modelling in design
For each new system or major change, sketch data flows and trust boundaries and ask what could go wrong, using a structure such as STRIDE. Record the main threats and mitigations in the design document. An hour here prevents expensive flaws later.
Identity and data protection
Centralise authentication, use standards such as OAuth 2.0 and OpenID Connect, and give services and pipelines their own identities with short-lived credentials. Encrypt data in transit and at rest, classify it by sensitivity, minimise what you collect, and keep secrets in a managed secret store.
Observability for security
Design logging for investigation from the start: who did what, when, from where, on which resource. Protect logs from tampering, never log secrets or sensitive personal data, and make sure security events reach a team that will act on them.
Designing AI features safely
Features that use language models or agents introduce new trust boundaries. Treat user prompts and retrieved documents as untrusted input, filter outputs for sensitive data, give agents scoped permissions, and keep humans in the loop for consequential actions.
Working with security teams
Bring security specialists in early, when the design is still flexible, rather than at the end for approval. Share the design document and threat model ahead of the review so the conversation focuses on real risks.
Over time, turn repeated advice into reusable patterns, such as a standard authentication approach or a reference architecture for handling personal data, so most teams can design securely without waiting for a review.
Security requirements in the spec
Write security requirements down like any other requirement: who can access what, what data is sensitive, what must be logged and retained, and what compliance rules apply. Requirements that are written down get designed, built and tested; requirements that are assumed often get missed.
How to put it into practice
- Add a security and threat-model section to the design template.
- Use a central identity provider and workload identity for services.
- Classify data and choose controls by sensitivity.
- Store secrets only in a managed secret store.
- Define security logging requirements in every design.
- Involve a security champion or specialist in reviews of high-risk designs.
Common mistakes
- Treating security as a review at the end of the project.
- Relying on a network perimeter instead of strong identity.
- Logging sensitive data, or not logging enough to investigate incidents.
- Designing AI features without considering prompt injection and data leakage.
How to measure progress
- Share of designs with a threat model.
- Security findings in design versus after release.
- Long-lived credentials remaining, trending to zero.
- Time to investigate security events using available logs.