Compliance by Design: What It Is and How to Build It
Friday afternoon, a sprint review, and someone wants to add a date-of-birth field to the signup form because the vendor template has one. Nobody in the room can say which legal basis covers it, how long it must be kept, or who would answer that question if an auditor asked. The ticket ships. Eighteen months later, two people spend a week reconstructing why the field exists.
That gap between shipping something and being able to explain what you shipped is the problem compliance by design exists to close. It isn't a document, a launch checklist, or a legal review stapled to the end of a project. It's the practice of deciding legal and security requirements while the system is still a set of open decisions, so the answer lives in code, configuration and logs instead of in someone's memory.
What follows is the working version: what the term means, which laws and standards demand it, which artifacts prove it, and where the automation everyone leans on stops working.
Table of Contents
Legal Frameworks and Standards That Require It - Choosing the standard your customers will ask for
Stage Controls and Pipeline Evidence - Running the controls as pipeline steps
Keeping Controls Working After Launch - What continuous assurance looks like for AI
Enterprise Examples From Design Review to Audit - A bank rewrites its onboarding form - A health analytics team stops shipping identifiers - A recommendation model changes vendor
Start With One Control in Your Next Release - A readiness check before you call it done
What Compliance by Design Means in Practice
Compliance by design means legal, privacy and security requirements get settled while architecture, product and procurement decisions are still open, so that non-compliant processing is hard to build in the first place. The requirement becomes a property of the system instead of a promise in a policy.
Compare it to a building. Fire-resistant materials, a sprinkler main and two protected exit routes are drawn into the floor plan before anyone pours concrete. Nobody waits for a fire and then bolts extinguishers to the wall.

Software has the same shape. A retention job scheduled in the platform, an access model that denies by default, and a schema with no field for data you don't need are structural. A privacy notice promising deletion after 90 days is an extinguisher.
Bolt-on compliance is a policy document, a questionnaire before launch, a scramble after an incident or an audit letter. Built-in compliance is a schema diff, a retention job with logs, and a role definition that cannot read the field it doesn't need.
The idea has a longer pedigree than many assume. It grew out of privacy-enhancing technologies, a research direction that treated data protection as prevention rather than remediation, and the 1995 report published jointly by the Information and Privacy Commissioner of Ontario, the Dutch Data Protection Authority and the Netherlands Organisation for Applied Scientific Research turned data minimization into an engineering objective rather than only a legal constraint. Regulators meeting in Jerusalem in October 2010 unanimously adopted a resolution recognizing Privacy by Design as an essential component of privacy protection.
Four objectives run through everything that follows:
Minimise collection, field by field, with a purpose recorded for each one.
Limit retention through a job that deletes rather than a paragraph that promises.
Separate identifiers so operational systems work on tokens, not people.
Make privacy-preserving defaults operational, so the safe setting is the one already switched on.
Those objectives condense the seven privacy by design principles, which Ryshe's overview of privacy by design walks through one by one if you want the source framing.
One test decides whether you designed a control or merely documented one. Can someone carry out a non-compliant action with the system as configured? If the answer is yes, you have a policy on your hands. If it's no, you have a design.
Legal Frameworks and Standards That Require It
A buyer opens a security questionnaire the week after you ship an export button. The form does not ask whether the team cares about privacy. It asks which artifact proves the button was built against a named rule, and whether that artifact will still exist after the engineer who wrote it has moved to another squad.
Start with the law that covers your data subjects, then add the standard your customers and auditors ask for. In the EU and EEA the first part is settled. Article 25 of the GDPR requires controllers to apply appropriate technical and organisational measures both when determining the means of processing and during processing itself. It names pseudonymisation, data minimization and privacy-protective defaults among the expected safeguards. Timing is part of the rule. By design and by default have to be considered while a processing operation is being planned, not during an audit and not after an incident. The GDPR Article 25 guidance summary sets out that expectation in detail.
The matching artifact is the design record, not the policy PDF. It shows the default that was already on, the retention job that deletes, the access model, and a test that fails the build if someone turns the safe setting off. A wiki page does not run in the pipeline. A failing test does.
Serious infringements can draw administrative fines large enough to sit beside revenue risk in a budget meeting. That exposure is why those defaults, retention rules, access models and test records belong in the design record. A control that lives only as a paragraph will lose to a release deadline, because engineers are rewarded for shipping. Treat that incentive as a compliance risk: if the proof is a manual checklist with no failing check, the busy week will skip it.
Framework | Scope | Pipeline artifact that proves it |
|---|---|---|
GDPR Article 25 | Personal data processing in the EU and EEA | Design record of defaults, minimization and a test that blocks the unsafe path |
ISO/IEC 27701 | Privacy information management within an organisation's management system | Documented privacy controls inside the management system, tied to a named process |
NIST Privacy Framework | Privacy risk management | Outcome statements mapped to controls a team can demonstrate |
SOC 2 | Service organization controls | Operating evidence that the same control ran across the audit window |
EU AI Act | AI systems placed on the EU market | Risk classification plus the governance and documentation that travel with the system |
Choosing the standard your customers will ask for
If you sell software to enterprise buyers, SOC 2 shows up in procurement long before a privacy regulator does. It asks for proof that controls run the same way over time, which means logs and samples from the audit window, not a design slide from launch week. The NIST Privacy Framework suits teams that want outcome-based privacy objectives without a certification program. ISO/IEC 27701 fits organizations already running a management system, because the privacy controls have somewhere to live. The EU AI Act reaches AI systems placed on the EU market, with obligations graded by risk, so the artifact is the classification and the documentation that goes to market with the system.
None of these frameworks decides whether a design is lawful. They tell you what to show and how to show it. Have counsel confirm the legal basis for each processing purpose before the architecture hardens. Retrofitting a lawful basis is considerably harder than retrofitting a field.
Scope keeps moving too. If your product bills subscriptions into the EU, how ViDA affects subscription billing shows the same pattern in tax: a rule that lands in product configuration and invoice data instead of in a memo. The same translation, obligation to something a team can build and test, is what a security compliance framework does for privacy and security controls. Map one framework to one testable artifact first. Covering every row in the table in a single sprint is how the evidence gets thin.
Governance and Risk Controls for Compliance by Design
Governance is what stops a design decision from being anonymous. Every personal data flow needs one named accountable owner, usually the product owner carrying the roadmap, with a data protection lead or DPO consulted on legal basis and on anything that qualifies as high-risk processing. Without a name attached, the team owns the risk and nobody can answer the auditor who asks who decided.
Decide up front which changes force a data protection impact assessment. The GDPR expects one for high-risk processing, and the recurring triggers are large-scale profiling, special-category data such as health or biometric records, systematic monitoring of behavior, and a new vendor that changes where data goes or who can see it.
Keep a single risk register with an entry per processing activity, and give each entry the same shape:
The activity and its purpose, stated in one sentence a non-specialist can follow.
A risk rating for individuals, not for the company's reputation.
The control chosen, named as a system function rather than an intention.
Residual risk and the person who accepted it, with a date.
Approval then follows risk tier. A low-risk change that reuses an approved pattern passes a standard review. A high-risk change goes to a privacy review board with legal sign-off before the first line of code is written. Log the outcome against the design review so the decision has a timestamp.
Who signs: residual risk belongs to a business leader with budget authority. An engineering team can implement a control; it can't accept the commercial consequence of the risk that remains.
Revisit the register at least once a year and whenever a system changes materially, including a vendor swap or a new integration. The register earns its keep when it becomes the single source for audit questions, so "why do we collect this field" is one lookup rather than a search through old threads. Treat the whole thing as part of enterprise risk management and compliance rather than a parallel privacy workstream, because a control nobody funds is a control nobody runs.
Stage Controls and Pipeline Evidence
A design decision that leaves no artifact behind is a story, not evidence. NIST's Secure Software Development Framework organizes the lifecycle around preparing the organization, protecting software from tampering and unauthorized access, producing releases with minimized vulnerabilities, and responding to residual ones. Its NIST SP 800-218 secure software development guidance recommends automation because it improves the accuracy, reproducibility and thoroughness of security practice while documenting that the practice happened. That's the difference between a team saying it scans dependencies and a build record proving it.
SDLC stage | Design control | Evidence to keep |
|---|---|---|
Requirements | Map legal basis and purpose for each data field | Records of processing and purpose statements |
Design | Minimize data, separate identifiers, define access model | Architecture decision records and DPIA for high-risk processing |
Build | Secure coding, secret detection, dependency checks | Scanner reports and SBOM for each build |
Test | Privacy and retention test cases, role-based access tests | Test results linked to the commit ID |
Release | Deployment gates and signed artifacts | Approval record and signed build provenance |
Operate | Access reviews, retention jobs, monitoring | Access review sign-offs and job logs |
Retire | Deletion and decommissioning of data stores | Deletion logs and destruction records |
Running the controls as pipeline steps
The control stays constant across teams; the owner changes by stage. Product owners own requirements, architects own design, platform engineers own build and operate. Here's the order that works.
Commit. Require a second reviewer and signed commits, so every change has a person behind it.
Build. Run dependency, container and secret scanning, and generate an SBOM for the artifact.
Infrastructure. Check configuration against an approved baseline before anything deploys.
Test. Run static, dynamic and privacy tests, including one that deletes a record and confirms search no longer returns it.
Gate. Block releases above agreed thresholds, such as any high-severity finding.
Release. Sign the artifact and link it to the commit, build and release record.
Operate. Retain logs and scan results for the period your policy states, not until the disk fills.
The common failure is documenting a control at the requirements stage and never linking it to a build or a release, so nothing can be reproduced months later. Replaying real traffic against a changed build is one way to confirm a control still behaves, and regulatory checks with GoReplay traffic replay covers that testing angle in depth.
Gate only on high-impact findings. A pipeline that fails on everything gets bypassed within a quarter, so give every exception a named owner and an expiry date. To check your own setup, trace one live feature through all seven rows above. Any row where you can't produce the evidence is the first gap to close. Our software compliance checklist lists the same stages in a form you can hand to a reviewer.
Implementation Patterns Engineers Can Reuse
Under GDPR Article 25 the obligation is engineering work rather than documentation: measures proportionate to the state of the art, implementation cost, processing context and risks to individuals' rights, applied both when processing is designed and throughout the lifecycle, as the European Commission's summary of GDPR principles describes. The practical translation is a set of system invariants, so that non-compliant processing is difficult or impossible with the system as configured.

Six patterns you can adopt inside a sprint, roughly in order of payoff:
Split the identifying key from operational data. Analytics services receive tokens; one tightly controlled vault can link tokens back to a person, and access to it is logged and rare.
Enforce purpose-specific schemas at the API boundary. If the stated purpose doesn't need a field, reject it at the edge rather than trusting every client to behave. A marketing preference endpoint has no reason to accept a national ID number.
Deny by default and grant by role. Define each role against the fields it needs, then log every read of a sensitive field. Silent over-permission is the most common finding in access reviews.
Make retention a scheduled job. A nightly job that deletes or anonymises records past their period, writing a log line per run, satisfies the requirement in a way a policy sentence never will. The log is also the artifact that answers the auditor.
Require an explicit action before broader disclosure. A separate, ungreeted opt-in before data goes to a partner is a design control. Pre-ticked boxes are the opposite.
Trace the data flow and kill the copies. Snapshots, exports, caches, staging refreshes and analytics sandboxes multiply the places a record exists. Each copy is a place that must also honour the retention job.
What these produce is inspectable: schema definitions, authorization policies, retention job logs and configuration baselines. That's the evidence set an auditor can read.
One caveat before anyone declares victory. Pseudonymised data is still personal data under the GDPR. Separating identifiers reduces exposure and shrinks the blast radius of a breach; it doesn't remove legal duties, and treating tokens as anonymous is a mistake regulators have corrected more than once.
Start with the pattern that touches the most sensitive field in the product you're shipping right now. Fix that one properly, with the log to prove it, then move to the next.
Keeping Controls Working After Launch
Friday's release cleared every gate. On Tuesday a vendor swaps the model endpoint, someone edits a prompt in the console, and a new analytics export lands in a sandbox the design review never listed. The approval from March now describes a system that no longer runs. What still matters is the trail: what changed, who accepted it, and which pipeline artifact still proves the rule.
Whether a control survives a delivery team depends on authority, tooling, and a reason to run it when the sprint is already full. Added workload is a common reason privacy-by-design controls lose adoption. Treat that as a design constraint on the program itself. If compliance work only adds tasks and never removes one, adoption fades, and nobody files a ticket about the fade. Engineer workload and incentives are a compliance risk in the same family as an unlogged exception. Both let the path people take split from the path the policy describes.
Three levers keep the control alive after launch. Put control health on the engineering dashboard beside latency and error rate, so a retention job that stopped running is as visible as a deploy that failed. Recognise the teams that delete fields and retire data stores, not only the ones that ship features. Deletion is the evidence that a purpose ended. Make the approved pattern the fastest route. A developer reaching for a new datastore should find a pre-approved template with retention and access already wired in. The pull request then carries the schema, the authorization policy, and the job config an auditor can read, instead of a form completed after the merge.

Exceptions need the same discipline as controls: an owner, a stated reason, a compensating control, and an expiry date. An exception without a date is a permanent exemption wearing a temporary label. When the date arrives, the ticket closes or the owner renews it with fresh evidence.
Silence is not renewal.
What continuous assurance looks like for AI
Models, prompts, data sources, and vendors move on a different clock from the release train. A change on a Tuesday can retire the system you assessed in March. The gap is real. A 2026 survey found that only 17% of organizations had reached the highest operating state, where AI governance is embedded by design and enables innovation, even though 52% described their programs as integrated into the AI lifecycle, according to the AI compliance survey from Compliance Week and konaAI. Claiming lifecycle integration is easier than demonstrating it.
Continuous assurance is a set of machines, and each one leaves an artifact. Runtime monitoring of outputs produces alert logs. Lineage for models, prompts, and data sources records which version ran. Reassessment triggers fire when any of those change. Human override paths log the decision and the person who made it. Incident thresholds open a review instead of waiting for the next annual audit. The preserved logs are what you hand over when someone asks what the system did last month.
A pre-launch assessment is a photograph. What regulators and customers increasingly ask for is the film.
A heavy gate on every experiment slows product teams, and shadow AI grows in the gaps, because someone always has a credit card and an API key. Route low-risk experiments through a lighter path with logging on by default. Reserve the full review for systems that touch sensitive data or make autonomous decisions. The lighter path still has to produce proof: who ran the experiment, which data it touched, and the date it must be shut off. Assurance then follows how the system behaves, not a checklist frozen at launch.
Enterprise Examples From Design Review to Audit
The examples below combine common enterprise patterns. They are illustrative, not reported case studies. Each shows how a design decision can leave evidence that an auditor can inspect later.

A bank rewrites its onboarding form
A retail banking team drafts an onboarding flow using a legacy template that asks for a full date of birth. The product only needs to confirm that applicants are over 18. In design review, the team traces the field back to its purpose and replaces it with an over-18 flag. This removes three stored attributes, while a retention job clears incomplete applications after a set period.
The evidence is concrete: a schema diff in the pull request shows the change, and the first scheduled deletion log shows the retention control ran. Without that review, the unnecessary date could have persisted, leaving the team to justify its collection later. The artifact connects the decision to the implementation.
A health analytics team stops shipping identifiers
An analytics group wants to study usage patterns across patient-facing screens. Rather than export patient identifiers, it sends pseudonymous tokens to the warehouse and restricts re-identification to a vault governed by its own access policy. The authorization policy and vault access log provide evidence of the boundary.
This control reduces exposure, but it does not eliminate the need for oversight. Teams still need to check who can access the vault and whether the policy matches actual use. A dashboard built from exports that include identifiers would create a different risk, one that access evidence alone could not undo.
A recommendation model changes vendor
An e-commerce team replaces the vendor for its recommendation model. The change appears to be configuration, but the new vendor uses a different data source and brings in a data category missing from the original assessment. Since vendor changes trigger reassessment, review begins before release. The team can remove the field or document a basis for retaining it.
The reassessment record and updated lineage map show what changed and how the decision was handled. A configuration diff by itself would not reveal the new data category. The review therefore needs both a change trigger and evidence that follows data through the system.
Across the examples, the useful pattern is traceability: a requirement or risk leads to a control, and the control leaves an artifact tied to the build or operation. Fewer unnecessary fields mean less data to protect and explain. Reviewers can examine a schema diff, policy, log, or lineage map instead of relying solely on interviews or records assembled long after release.
These are typical patterns, not measured results from named organizations. Their value depends on whether teams maintain the controls and evidence as systems change. Automation can produce logs and flag triggers, but it cannot decide whether a purpose is justified or whether a reassessment is adequate. If engineers are rushed, rewarded only for shipping, or asked to work around cumbersome gates, required reviews may become paperwork or be skipped. Design the workflow so producing evidence fits normal development, and assign people time and ownership to act on what it reveals.
Start With One Control in Your Next Release
Choose one personal data flow in your next release, such as a signup, quote request or support ticket attachment. Trace it from requirements through retirement, and record what each stage should produce. This keeps the first exercise small enough to complete while still connecting a legal obligation to evidence the team can show.
Add one pipeline gate that creates evidence automatically. For example, block a release when a dependency scan finds a high-severity issue. The rule is clear, and the resulting scan report can be tied to the commit and release record. Automation does not decide whether a finding is acceptable; a named person still needs to review exceptions and record the reason.
A readiness check before you call it done
Named owner: identify one person, not a team alias, who is responsible for the control.
Stated purpose per field: write a sentence explaining why each field is needed, in language that would make sense to a customer.
Retention with a deletion job: define when data should be deleted and retain a log showing that the job ran.
Scan result tied to the build: link the scan artifact to the commit and release record.
A control is ready when the team can produce its evidence bundle without reconstructing events by hand. Then apply the same method to another flow and control. Choose standards according to the data subjects covered by law, followed by requirements customers and auditors ask for. Keep the workload visible: if the gate creates repeated manual exceptions or slows releases without clear ownership, teams may work around it. A written policy alone cannot prevent that.
Freeform Company describes compliance assessments that map a planned system to GDPR Article 25 and relevant frameworks, with legal conclusions left to qualified counsel. For a team applying the method, the practical question is whether the assessment connects each requirement to a control and an artifact, such as a data model, identity workflow, code review or release record. Those records make the design decision easier to examine later.
A small, repeatable control is a better starting point than a broad policy that produces no evidence. Freeform's comparison of agency options and account of ProfitHack 2.0 discuss marketing services, not evidence that a compliance control works. For your release, judge the control by its own record: the rule applied, the result produced, and the person responsible for handling exceptions.
One release at a time: compliance by design is a habit you build, not a project that ends at launch.
For a compliance assessment, Freeform Company invites teams to bring a data flow from an upcoming release and examine it stage by stage, from requirements through retirement. The aim is to identify where a single gate can produce evidence that supports review. Start at Freeform Company and describe the flow you want to assess.
