Skip to content
← All posts

PCI-DSS Architecture for Custom Software: A 2026 Engineer's Guide

PCI-DSS Architecture for Custom Software: A 2026 Engineer's Guide

PCI-DSS Architecture for Custom Software: A 2026 Engineer's Guide

PCI-DSS isn't a feature you add. It's an architectural posture you commit to — and the cost of that posture scales directly with the number of systems in your "in-scope" footprint.

This is the engineering view of PCI-DSS architecture in 2026: what's actually required, the patterns that minimize scope, what PCI-DSS 4.0 changed about continuous compliance, and the specific decisions we make on fintech engagements that handle cardholder data.

Key Takeaways

  • The single highest-leverage PCI-DSS decision is scope reduction. Every server in scope multiplies compliance cost — well-architected systems run 5–10 in-scope systems, poorly-architected ones 50+.
  • Tokenization at the edge (Stripe / Adyen iframes, hosted fields) keeps application servers entirely out-of-scope. This one decision removes 80%+ of PCI surface.
  • PCI-DSS 4.0 became mandatory in March 2025. It shifted from annual audit to continuous compliance: monthly vulnerability scans, change-management evidence at the time of changes, and an explicit inventory of scripts loaded on payment pages.
  • Webhook endpoints that don't verify signatures are both a PCI finding and a fraud vector. Verify the raw body, enforce replay protection, and reject unsigned requests at the edge.
  • "We have backups" doesn't pass audit. "We have tested restore" does. Same pattern as HIPAA — schedule the drill, capture the evidence.

The first decision: scope reduction is the architecture

PCI-DSS classifies your systems into scope categories:

  • In-scope — stores, processes, or transmits cardholder data (PAN, sensitive authentication data). Subject to all PCI controls.
  • Connected-to in-scope — systems that connect to in-scope systems. Subject to many controls.
  • Out-of-scope — neither stores, processes, transmits, nor connects to systems that do. No PCI controls.

Every server, every database, every developer laptop, every backup, every log destination in the in-scope footprint multiplies the cost of compliance. Auditors validate every in-scope system. Each requires logging, vulnerability scanning, access controls, evidence collection.

The architectural goal isn't "be PCI-DSS compliant." It's "keep the in-scope footprint as small as humanly possible."

A well-architected payment-handling product has 5-10 in-scope systems. A poorly-architected one has 50+. The compliance cost differs by an order of magnitude.

The single most important pattern: tokenization at the edge

The highest-leverage architectural decision in any payment-handling product is to never let raw card data touch your application servers.

Modern payment processors (Stripe, Adyen, Worldpay, Braintree, etc.) all provide hosted payment forms — iframes or SDKs that capture card data inside the processor's domain, exchange it immediately for a token, and pass only the token back to your application. The token can be used for charges, refunds, recurring billing, etc., but it's not actual card data.

With tokenization at the edge: your application servers are out-of-scope. The browser submits card data directly to the processor; your code never sees a PAN. Your in-scope footprint shrinks to the small number of services that handle tokens (which is "connected-to in-scope" with much lighter requirements).

Without it: every service that touches the card data, every server it crosses, every log destination, every backup — all in-scope. The compliance overhead dominates engineering capacity.

The trade-off is that tokenization-at-the-edge means accepting the processor's hosted form UX. For most products this is fine; some custom checkout flows require more control. When you need full control, the architecture changes — but the cost is dramatically higher.

What PCI-DSS 4.0 changed in 2024-2025

PCI-DSS 4.0 reached mandatory compliance in March 2025. The changes that matter most for software architecture:

Stricter MFA requirements. All access to in-scope systems requires MFA, not just remote access. This includes service-account access where feasible.

More aggressive script controls. Payment pages need explicit inventories of every script loaded. Inline scripts and external scripts must be vetted. Subresource Integrity (SRI) is increasingly expected. This catches a lot of teams who had third-party analytics, chat widgets, or tag managers loading on their checkout pages without realizing those scripts were now in-scope for PCI.

Continuous compliance, not annual audit. Previously the compliance posture was validated annually. PCI-DSS 4.0 expects ongoing evidence — monthly vulnerability scans, continuous monitoring, change-management evidence produced at the time of changes (not retrofitted before audit).

Targeted risk analyses required. For certain controls, you have to document your specific risk analysis rather than implementing a one-size-fits-all baseline. This means more compliance documentation work.

Customized approach option. PCI-DSS 4.0 allows a "customized approach" where you implement an alternative control that achieves the same outcome. Useful for teams with modern architecture that doesn't fit the prescriptive defaults — but requires more documentation upfront.

The patterns we ship for PCI-DSS architecture

1. Explicit PCI envelope

The in-scope systems are tagged in code, enforced at the network layer:

  • Dedicated VPC subnet for in-scope services
  • Network policies preventing direct calls from out-of-scope to in-scope
  • Cross-envelope calls only through documented API gateways
  • Out-of-scope services literally cannot reach in-scope services on the network

The architecture documents the envelope; the network enforces it.

2. HSM-backed key custody for encryption

Encryption keys for sensitive data live in a Hardware Security Module (cloud KMS with HSM-backed key material, or dedicated HSM appliance for highest-sensitivity workloads).

  • Keys never exist in plaintext outside the HSM
  • Encryption/decryption operations happen via the HSM API
  • Key access is granted to service principals, not to humans
  • Human access requires documented approval flow with audit logging
  • Split-knowledge / dual-control policies apply to root keys

This satisfies the PCI requirement for documented key management and is what auditors actually verify.

3. Webhook security as a first-class concern

Every inbound webhook from a payment processor needs signature verification:

const signature = req.headers['stripe-signature'];
const event = stripe.webhooks.constructEvent(
  req.body,  // raw body, not parsed JSON
  signature,
  process.env.STRIPE_WEBHOOK_SECRET
);

Three properties that matter:

  • Raw body verification — signatures verify the bytes that were sent, not a re-serialized version
  • Replay protection — webhook secrets prevent forged events; consumer-side idempotency prevents duplicate processing
  • Endpoint authentication — webhooks should only accept requests with valid signatures; reject unsigned requests at the edge

Webhook endpoints that don't verify signatures are a PCI finding. They're also a fraud vector.

4. Audit logging for every cardholder-data operation

Same pattern as for HIPAA: append-only audit log with cryptographic chaining, separate from operational database. Every action that touches token data or initiates a charge is logged with user identity, action, target, timestamp.

For PCI-DSS, log retention is at least one year, with at least three months immediately available for forensic review. The longer retention is on lower-cost archival storage.

5. Continuous vulnerability management

PCI-DSS requires regular vulnerability scans of in-scope systems. The pattern that works:

  • Internal scans monthly (or on every deploy, automated via CI)
  • External scans quarterly by an Approved Scanning Vendor (ASV)
  • Penetration testing annually for in-scope systems
  • Continuous monitoring for known CVEs in your dependencies

The remediation SLA per PCI: critical findings within 30 days, high within 90 days. Build the alerting and tracking into your CI/CD so this isn't a quarterly scramble.

6. Backup and tested restore

Backups encrypted, stored separately, with restore tested at least quarterly. Captured evidence per restore. Same pattern as HIPAA, same audit-finding pattern when teams skip the "tested" part.

7. Strong customer authentication and session management

MFA for all admin access to in-scope systems. Risk-based step-up authentication for high-value transactions. Session timeouts tuned for the workflow (operations staff need longer sessions than customer-facing flows; tune per role).

SAQ types and what they mean for architecture

PCI-DSS compliance is validated via Self-Assessment Questionnaires (SAQs), with the type depending on your architecture:

  • SAQ A — for merchants who fully outsource card handling to compliant processors. Minimal architectural overhead. Goal: get here when possible.
  • SAQ A-EP — for merchants whose website redirects to a processor but where the merchant has some script control over the payment page. Common for tokenization-at-the-edge setups.
  • SAQ D — for merchants who process cardholder data on their own systems. Full PCI control set. Heaviest compliance burden.

The architectural goal for most fintech products: design for SAQ A or SAQ A-EP. Use tokenization at the edge. Don't store card data unless you absolutely have to.

When SAQ D is necessary (e.g., you operate as a payment processor yourself), accept the architectural overhead and design for it from day one.

Common mistakes we see in pre-engagement reviews

When we audit existing fintech codebases, the patterns of trouble we see most often:

  • Card data flowing through application servers because the team prototyped with a "form posts to server" flow and never migrated to tokenization. Easy to fix; the fix is non-trivial because it means rebuilding the checkout flow.
  • Webhooks without signature verification because someone followed an example that skipped it. Trivially fixable but operationally important.
  • Production access logs going to a shared APM (DataDog, Sentry, etc.) that includes the in-scope services. Logs that include PAN data or cardholder identifiers go outside the BAA/PCI envelope. Logs should be sanitized at the source.
  • Vulnerability scanning happening in a separate process from CI, with delays of weeks between findings and fixes. The fix: integrate scanning into CI; gate deploys on the scan passing.
  • Backups not actually tested. "We have backups" without "we have tested restore" fails audits. Schedule the drill; capture evidence.
  • Inline scripts on payment pages added by marketing, tag managers, or analytics tools, never reviewed by engineering. PCI-DSS 4.0 makes this a more pointed finding than it used to be.

Pricing implications

PCI-DSS architecture cost shows up in three places:

  • One-time architectural setup — designing the envelope, tokenization integration, control mapping, evidence collection systems. Typically 4-8 weeks for a new build.
  • Ongoing compliance overhead — monthly scans, quarterly external scans, annual pen tests, continuous monitoring tooling, evidence collection. Roughly 5-15% of engineering capacity for a well-architected system; 30%+ for a poorly-architected one.
  • Annual QSA validation for larger merchants — typically $30-80K depending on scope. SAQ-self-assessment for smaller merchants is much cheaper.

The compounding benefit of investing in good PCI-DSS architecture upfront: the ongoing cost stays at the lower end. Skimping upfront means paying 3-5x the ongoing cost.


If you're building a custom fintech product that handles cardholder data, or modernizing an existing one whose PCI posture has accumulated debt, we'd be glad to talk. See our fintech software development services for how we approach regulated fintech builds end-to-end. For the AI side of regulated fintech, see our piece on why MCP is quietly becoming the most important layer in fintech AI.

Let's Connect

Have a project in mind or just want to chat about how we can help?
We'd love to hear from you! Fill out the form, and we'll get back to you soon. Let's create something amazing together!

Alejandro Rama

Co-Founder & CEO
Schedule a call