Salesforce Shield Architecture
Shield is the wrong size of question to answer with "go to Setup → enable
encryption". It's three separately-priced add-on products — Platform
Encryption, Event Monitoring, Field Audit Trail — sold per-org, none
included in any standard edition. The architectural decision is which
components, with what posture, against which fields, and that has to
happen before anyone clicks anything in Setup.
This skill is the architectural decision layer. The setup mechanics for
each component live in their own skills:
security/platform-encryption, security/event-monitoring,
security/field-audit-trail. Compliance certification mapping
(specifically what HIPAA / FedRAMP-High / PCI require from Shield) lives
in a separate skill — Shield is part of the answer to those, not the
whole answer.
Before Starting
- Confirm every Shield license you're about to assume. Setup → Company
Information → Permission Set Licenses. Three distinct lines: Platform
Encryption, Event Monitoring, Field Audit Trail. The most common
Shield-architecture failure is recommending a feature against an org
that doesn't have the license — a 3-month procurement cycle becomes
visible in the design review, not afterwards.
- Inventory the fields. For each candidate-encryption field: data
type (some types can't be encrypted at all), whether filter / sort /
group-by is required, whether full-text search is required, and
whether external IDs depend on it.
- Decide the key-management posture before picking components. A
Cache-Only Key Service design has implications for every Shield
component (single point of unavailability) — choosing it after
picking components forces rework.
- Decide retention up-front. Field Audit Trail retention is set per
object in metadata XML, with a maximum of 10 years. Plan storage
cost and the 18-month-tier vs longer-tier transition.
Core Concepts
Shield's three components, each with its own license
| Component |
What it does |
License (separately purchased) |
| Shield Platform Encryption |
At-rest encryption of selected fields, files, search indexes. Uses Salesforce-managed or customer-supplied keys. |
Platform Encryption PSL |
| Event Monitoring |
Hourly / real-time event log files (Login, API, Apex, Visualforce, etc.) and Real-Time Event Monitoring streams via Pub/Sub. Backs Transaction Security Policies for in-flight blocking. |
Event Monitoring PSL |
| Field Audit Trail |
Per-object configurable history retention up to 10 years; stores history rows in FieldHistoryArchive (queryable). Replaces the 18-month default FieldHistory retention. |
Field Audit Trail PSL |
Standard Salesforce ships with classic encryption (a different
product — single-key, weaker, fewer field types) and 18-month field
history retention in <Object>History (no separate license). Shield
upgrades both, plus adds Event Monitoring.
Platform Encryption: probabilistic vs deterministic
The most consequential per-field decision under Shield Platform
Encryption. Salesforce supports two schemes:
| Scheme |
Same plaintext → same ciphertext? |
Filter / sort / group-by? |
Strength |
| Probabilistic (default) |
No (random IV per encryption) |
Equality filter NO; sort NO |
Stronger — ciphertext analysis cannot infer plaintext distribution |
| Deterministic — case-sensitive |
Yes |
Equality filter YES; sort YES (lexicographic on ciphertext) |
Weaker — ciphertext frequency analysis is possible |
| Deterministic — case-insensitive |
Yes (after case-fold) |
Equality filter YES (case-insensitive); sort YES |
Same as case-sensitive plus case-fold |
Deterministic is the only path if SOQL needs to filter or sort on the
encrypted field. Probabilistic is the right default for everything else.
You cannot change scheme on a populated field without re-encrypting
every row.
Field types you cannot encrypt
The blocklist matters because authors often promise encryption of
fields that physically cannot be encrypted:
- Formula fields — encryption would break the formula evaluation engine.
- Roll-Up Summary fields — same reason; aggregation requires plaintext.
- External ID fields with
Unique checked AND backed by a unique index — the unique index requires plaintext for collision detection.
- Auto-Number fields — generated server-side, value is the index.
- A handful of standard fields (
Id, IsDeleted, RecordTypeId, etc.) — system fields.
If a field on the encryption candidate list is one of these, the
architectural answer is to encrypt the underlying field that the
formula / roll-up reads from, not the derived field.
BYOK vs Cache-Only Key Service (CCKM)
The two customer-supplied-key models have very different operational
shapes:
| Mode |
Key resides where? |
Key fetch path |
Outage impact |
| Salesforce-managed |
Salesforce key infrastructure |
Internal |
Salesforce's standard reliability |
| BYOK (tenant-secret upload) |
Salesforce, after upload from customer |
Customer uploads key material; Salesforce derives data-encryption keys from it |
Customer can rotate / destroy. Loss of key = loss of data |
| Cache-Only Key Service (CCKM) |
Customer HSM (e.g. AWS CloudHSM, Azure Key Vault, on-prem) |
Salesforce fetches just-in-time, holds in cache only |
Strongest posture; KMS outage causes encryption operations to FAIL until cache or KMS is restored |
CCKM is the right answer for high-compliance shops (regulator-audited
key custody). BYOK is the right middle ground for "we want to control
rotation but don't want to operate an HSM for Salesforce traffic".
Salesforce-managed is fine for orgs whose compliance posture doesn't
require customer custody.
Field Audit Trail retention
Not a single dial — set per object in metadata XML:
<HistoryRetentionPolicy>
<archiveAfterMonths>18</archiveAfterMonths>
<archiveRetentionYears>10</archiveRetentionYears>
<description>HIPAA-archived patient records</description>
</HistoryRetentionPolicy>
archiveAfterMonths controls when records move from the standard
<Object>History table (queryable in reports) to FieldHistoryArchive
(queryable via SOQL only). archiveRetentionYears controls deletion
from the archive — capped at 10 years.
Decision Guidance
| Situation |
Approach |
Reason |
| User asks "how do I turn on encryption?" before licensing is confirmed |
Stop. Confirm Platform Encryption PSL first. |
Telling them to go to Setup against a non-Shield org wastes a sprint. |
Field needs SOQL WHERE equality filter AND must be encrypted |
Deterministic case-sensitive (or case-insensitive if business requires) |
Probabilistic blocks the filter |
| Field is a Formula / Roll-Up / Unique-Indexed-External-ID |
Encrypt the source field instead |
The derived field cannot be encrypted; encrypting the source flows the property through |
| HIPAA / FedRAMP / regulator-audited key custody |
CCKM (Cache-Only Key Service) with customer HSM |
Highest posture; KMS outage = encryption ops fail (acceptable trade) |
| Compliance requires customer-controlled rotation but no HSM operations |
BYOK (tenant-secret upload) |
Customer rotates / destroys; Salesforce holds the derived key |
| Internal policy, no specific regulator |
Salesforce-managed keys |
Lowest operational cost, still encrypted-at-rest |
| Audit retention needed > 18 months |
Field Audit Trail with HistoryRetentionPolicy per object |
Standard 18-month History retention is hard-capped |
| Real-time blocking of suspicious sessions / API calls |
Event Monitoring + Transaction Security Policies |
TSP is the only policy-driven block-in-flight mechanism |
| Need event log files but no real-time blocking |
Event Monitoring without TSP — log-only mode |
Cheaper to operate; many orgs don't need real-time |
| Asked for "everything Shield does" without a compliance driver |
Push back. Shield is paid; per-component justification matters |
Buying all three components without a driver is a budget smell |
Recommended Workflow
- Pre-flight: license confirmation. Permission Set Licenses page. Three lines, three independent purchases. If any is missing, the conversation pauses for procurement.
- Compliance driver inventory. What forces Shield to be in scope (regulator, contract, internal control)? Map each requirement to the minimum Shield component that addresses it.
- Field inventory + scheme decision. For Platform Encryption: list every candidate field with its filter / sort / search requirement; pick probabilistic vs deterministic per field. Identify any encryption-blocked field types and reroute to source fields.
- Key-management posture. Salesforce-managed / BYOK / CCKM. Document the outage tradeoff for CCKM.
- Audit retention design. For Field Audit Trail: per-object
HistoryRetentionPolicy XML, with archiveAfterMonths and archiveRetentionYears decided per object.
- Event Monitoring scope. Log-files-only vs Log-files + Real-Time Event Monitoring + Transaction Security Policies. Document which event types are subscribed and why.
- Cost projection. Component licenses + key-management infrastructure (HSM if CCKM) + storage growth from Field Audit Trail archive.
Review Checklist
Salesforce-Specific Gotchas
- Three Shield components, three separate licenses. None included in any standard edition. Verify each PSL before any Setup work. (See
references/gotchas.md § 1.)
- Probabilistic encryption blocks SOQL
WHERE equality filters. Deterministic supports equality filter (and sort). Wrong scheme = wrong queries. (See references/gotchas.md § 2.)
- Formula / Roll-Up / unique-indexed External ID cannot be encrypted. Encrypt the source field instead. (See
references/gotchas.md § 3.)
- Cache-Only Key Service outage = encryption operations fail. A customer-HSM outage stops new writes that need encryption. Trade for the strongest custody posture. (See
references/gotchas.md § 4.)
- Field Audit Trail retention requires metadata XML, not Setup UI.
HistoryRetentionPolicy is set per object via Tooling API or metadata deploy — not a checkbox. (See references/gotchas.md § 5.)
- Tenant secret rotation re-encrypts all data. Plan the operation as a maintenance window for orgs with significant encrypted data volume. (See
references/gotchas.md § 6.)
- Real-Time Event Monitoring is Pub/Sub-only as of recent releases. Old code paths against the streaming-API channels are deprecated. (See
references/gotchas.md § 7.)
Output Artifacts
| Artifact |
Description |
| Shield Architecture Decision Document |
License inventory, component selection, per-field scheme decisions, key-management mode, retention policy, Event Monitoring scope, cost projection |
HistoryRetentionPolicy XML per audited object |
Metadata payloads ready for deploy |
| Pre-flight license-confirmation runbook |
Procurement gate before any Setup work |
| CCKM HSM availability runbook (if CCKM chosen) |
Failure-mode response, KMS outage expected behavior |
Related Skills
security/platform-encryption — Setup mechanics for the Platform Encryption component (this skill ends where that one starts).
security/event-monitoring — Setup for Event Monitoring + Real-Time Event Monitoring + Transaction Security Policies.
security/field-audit-trail — Setup mechanics for the per-object retention policy.
security/byok-key-rotation — Operational runbook for tenant-secret rotation and CCKM cache invalidation.
architect/hybrid-integration-architecture — Adjacent decisions when Shield-encrypted data flows to AWS / Heroku / external systems.
1---
2name: salesforce-shield-architecture
3description: "Salesforce Shield as an architectural choice — Platform Encryption + Event Monitoring + Field Audit Trail as three SEPARATELY-LICENSED components, none of which ship in any standard edition. Covers BYOK vs Cache-Only Key Service (CCKM) tradeoffs, probabilistic vs deterministic encryption schemes, the field-type encryption blocklist (Formula, Roll-Up Summary, indexed External ID), Field Audit Trail's 10-year retention model, and why every Shield design starts with a license confirmation. NOT for individual feature setup steps (see security/platform-encryption, security/event-monitoring, security/field-audit-trail), NOT for compliance certification mapping (HIPAA / FedRAMP / PCI specifics)."
4category: architect
5salesforce-version: "Spring '25+"
6well-architected-pillars:
7 - Security
8 - Reliability
9 - Operational Excellence
10triggers:
11 - "salesforce shield license required which components"
12 - "platform encryption probabilistic vs deterministic decision"
13 - "byok cache-only key service cckm comparison"
14 - "field audit trail retention 10 year configuration"
15 - "shield platform encryption field types blocklist formula rollup"
16 - "salesforce shield architecture compliance design"
17tags:
18 - shield
19 - platform-encryption
20 - event-monitoring
21 - field-audit-trail
22 - byok
23 - cache-only-keys
24 - compliance-architecture
25inputs:
26 - "Compliance driver (HIPAA, FedRAMP, PCI, internal policy) and which Shield components address it"
27 - "Existing Salesforce edition and which Shield licenses are already provisioned"
28 - "Field-level inventory of what must be encrypted vs filtered/sorted"
29 - "Key-management posture (Salesforce-managed, BYOK upload, Cache-Only HSM)"
30 - "Audit retention requirement in years"
31outputs:
32 - "Shield component selection (Platform Encryption / Event Monitoring / Field Audit Trail) with the matching license per component"
33 - "Encryption scheme decision per field (probabilistic vs deterministic) tied to filter/sort requirements"
34 - "Key management mode decision (Salesforce-managed / BYOK / Cache-Only) tied to compliance posture"
35 - "Field Audit Trail retention policy XML for each archived object"
36 - "License-confirmation pre-flight checklist that runs before any Shield Setup work"
37dependencies: []
38version: 1.0.0
39author: Pranav Nagrecha
40updated: 2026-05-04
41metadata:
42 source: https://skillmd.com/skills/aibot88/salesforce-shield-architecture
43---
44
45# Salesforce Shield Architecture
46
47Shield is the wrong size of question to answer with "go to Setup → enable
48encryption". It's three separately-priced add-on products — Platform
49Encryption, Event Monitoring, Field Audit Trail — sold per-org, none
50included in any standard edition. The architectural decision is *which
51components, with what posture, against which fields*, and that has to
52happen before anyone clicks anything in Setup.
53
54This skill is the architectural decision layer. The setup mechanics for
55each component live in their own skills:
56`security/platform-encryption`, `security/event-monitoring`,
57`security/field-audit-trail`. Compliance certification mapping
58(specifically what HIPAA / FedRAMP-High / PCI require from Shield) lives
59in a separate skill — Shield is *part* of the answer to those, not the
60whole answer.
61
62---
63
64## Before Starting
65
66- **Confirm every Shield license you're about to assume.** Setup → Company
67 Information → Permission Set Licenses. Three distinct lines: Platform
68 Encryption, Event Monitoring, Field Audit Trail. The most common
69 Shield-architecture failure is recommending a feature against an org
70 that doesn't have the license — a 3-month procurement cycle becomes
71 visible in the design review, not afterwards.
72- **Inventory the fields.** For each candidate-encryption field: data
73 type (some types can't be encrypted at all), whether filter / sort /
74 group-by is required, whether full-text search is required, and
75 whether external IDs depend on it.
76- **Decide the key-management posture before picking components.** A
77 Cache-Only Key Service design has implications for every Shield
78 component (single point of unavailability) — choosing it after
79 picking components forces rework.
80- **Decide retention up-front.** Field Audit Trail retention is set per
81 object in metadata XML, with a maximum of 10 years. Plan storage
82 cost and the 18-month-tier vs longer-tier transition.
83
84---
85
86## Core Concepts
87
88### Shield's three components, each with its own license
89
90| Component | What it does | License (separately purchased) |
91|---|---|---|
92| **Shield Platform Encryption** | At-rest encryption of selected fields, files, search indexes. Uses Salesforce-managed or customer-supplied keys. | `Platform Encryption` PSL |
93| **Event Monitoring** | Hourly / real-time event log files (Login, API, Apex, Visualforce, etc.) and Real-Time Event Monitoring streams via Pub/Sub. Backs Transaction Security Policies for in-flight blocking. | `Event Monitoring` PSL |
94| **Field Audit Trail** | Per-object configurable history retention up to 10 years; stores history rows in `FieldHistoryArchive` (queryable). Replaces the 18-month default `FieldHistory` retention. | `Field Audit Trail` PSL |
95
96Standard Salesforce ships with **classic encryption** (a different
97product — single-key, weaker, fewer field types) and **18-month field
98history retention** in `<Object>History` (no separate license). Shield
99upgrades both, plus adds Event Monitoring.
100
101### Platform Encryption: probabilistic vs deterministic
102
103The most consequential per-field decision under Shield Platform
104Encryption. Salesforce supports two schemes:
105
106| Scheme | Same plaintext → same ciphertext? | Filter / sort / group-by? | Strength |
107|---|---|---|---|
108| **Probabilistic** (default) | No (random IV per encryption) | Equality filter NO; sort NO | Stronger — ciphertext analysis cannot infer plaintext distribution |
109| **Deterministic — case-sensitive** | Yes | Equality filter YES; sort YES (lexicographic on ciphertext) | Weaker — ciphertext frequency analysis is possible |
110| **Deterministic — case-insensitive** | Yes (after case-fold) | Equality filter YES (case-insensitive); sort YES | Same as case-sensitive plus case-fold |
111
112Deterministic is the only path if SOQL needs to filter or sort on the
113encrypted field. Probabilistic is the right default for everything else.
114You cannot change scheme on a populated field without re-encrypting
115every row.
116
117### Field types you cannot encrypt
118
119The blocklist matters because authors often promise encryption of
120fields that physically cannot be encrypted:
121
122- **Formula** fields — encryption would break the formula evaluation engine.
123- **Roll-Up Summary** fields — same reason; aggregation requires plaintext.
124- **External ID fields with `Unique` checked AND backed by a unique index** — the unique index requires plaintext for collision detection.
125- **Auto-Number** fields — generated server-side, value is the index.
126- A handful of standard fields (`Id`, `IsDeleted`, `RecordTypeId`, etc.) — system fields.
127
128If a field on the encryption candidate list is one of these, the
129architectural answer is to encrypt the *underlying* field that the
130formula / roll-up reads from, not the derived field.
131
132### BYOK vs Cache-Only Key Service (CCKM)
133
134The two customer-supplied-key models have very different operational
135shapes:
136
137| Mode | Key resides where? | Key fetch path | Outage impact |
138|---|---|---|---|
139| **Salesforce-managed** | Salesforce key infrastructure | Internal | Salesforce's standard reliability |
140| **BYOK (tenant-secret upload)** | Salesforce, after upload from customer | Customer uploads key material; Salesforce derives data-encryption keys from it | Customer can rotate / destroy. Loss of key = loss of data |
141| **Cache-Only Key Service (CCKM)** | Customer HSM (e.g. AWS CloudHSM, Azure Key Vault, on-prem) | Salesforce fetches just-in-time, holds in cache only | **Strongest posture; KMS outage causes encryption operations to FAIL** until cache or KMS is restored |
142
143CCKM is the right answer for high-compliance shops (regulator-audited
144key custody). BYOK is the right middle ground for "we want to control
145rotation but don't want to operate an HSM for Salesforce traffic".
146Salesforce-managed is fine for orgs whose compliance posture doesn't
147require customer custody.
148
149### Field Audit Trail retention
150
151Not a single dial — set *per object* in metadata XML:
152
153```xml
154<HistoryRetentionPolicy>
155 <archiveAfterMonths>18</archiveAfterMonths>
156 <archiveRetentionYears>10</archiveRetentionYears>
157 <description>HIPAA-archived patient records</description>
158</HistoryRetentionPolicy>
159```
160
161`archiveAfterMonths` controls when records move from the standard
162`<Object>History` table (queryable in reports) to `FieldHistoryArchive`
163(queryable via SOQL only). `archiveRetentionYears` controls deletion
164from the archive — capped at 10 years.
165
166---
167
168## Decision Guidance
169
170| Situation | Approach | Reason |
171|---|---|---|
172| User asks "how do I turn on encryption?" before licensing is confirmed | **Stop.** Confirm `Platform Encryption` PSL first. | Telling them to go to Setup against a non-Shield org wastes a sprint. |
173| Field needs SOQL `WHERE` equality filter AND must be encrypted | **Deterministic case-sensitive** (or case-insensitive if business requires) | Probabilistic blocks the filter |
174| Field is a Formula / Roll-Up / Unique-Indexed-External-ID | **Encrypt the source field instead** | The derived field cannot be encrypted; encrypting the source flows the property through |
175| HIPAA / FedRAMP / regulator-audited key custody | **CCKM** (Cache-Only Key Service) with customer HSM | Highest posture; KMS outage = encryption ops fail (acceptable trade) |
176| Compliance requires customer-controlled rotation but no HSM operations | **BYOK** (tenant-secret upload) | Customer rotates / destroys; Salesforce holds the derived key |
177| Internal policy, no specific regulator | **Salesforce-managed** keys | Lowest operational cost, still encrypted-at-rest |
178| Audit retention needed > 18 months | **Field Audit Trail** with `HistoryRetentionPolicy` per object | Standard 18-month `History` retention is hard-capped |
179| Real-time blocking of suspicious sessions / API calls | **Event Monitoring + Transaction Security Policies** | TSP is the only policy-driven block-in-flight mechanism |
180| Need event log files but no real-time blocking | Event Monitoring **without** TSP — log-only mode | Cheaper to operate; many orgs don't need real-time |
181| Asked for "everything Shield does" without a compliance driver | **Push back.** Shield is paid; per-component justification matters | Buying all three components without a driver is a budget smell |
182
183---
184
185## Recommended Workflow
186
1871. **Pre-flight: license confirmation.** Permission Set Licenses page. Three lines, three independent purchases. If any is missing, the conversation pauses for procurement.
1882. **Compliance driver inventory.** What forces Shield to be in scope (regulator, contract, internal control)? Map each requirement to the *minimum* Shield component that addresses it.
1893. **Field inventory + scheme decision.** For Platform Encryption: list every candidate field with its filter / sort / search requirement; pick probabilistic vs deterministic per field. Identify any encryption-blocked field types and reroute to source fields.
1904. **Key-management posture.** Salesforce-managed / BYOK / CCKM. Document the outage tradeoff for CCKM.
1915. **Audit retention design.** For Field Audit Trail: per-object `HistoryRetentionPolicy` XML, with `archiveAfterMonths` and `archiveRetentionYears` decided per object.
1926. **Event Monitoring scope.** Log-files-only vs Log-files + Real-Time Event Monitoring + Transaction Security Policies. Document which event types are subscribed and why.
1937. **Cost projection.** Component licenses + key-management infrastructure (HSM if CCKM) + storage growth from Field Audit Trail archive.
194
195---
196
197## Review Checklist
198
199- [ ] Three Shield licenses confirmed in Setup (or marked "not in scope" with rationale).
200- [ ] Per-field encryption scheme matches filter / sort requirements.
201- [ ] No field on the encryption list is a Formula / Roll-Up / unique-indexed External ID; if it was, the source field is encrypted instead.
202- [ ] Key-management posture named (Salesforce-managed / BYOK / CCKM) with one-sentence rationale.
203- [ ] CCKM design documents the HSM outage failure mode.
204- [ ] Field Audit Trail retention XML present for every audited object; `archiveRetentionYears` ≤ 10.
205- [ ] Event Monitoring scope explicit (which event types, log-only vs real-time).
206- [ ] Total cost projection includes component licenses + HSM (if CCKM) + storage growth.
207
208---
209
210## Salesforce-Specific Gotchas
211
2121. **Three Shield components, three separate licenses.** None included in any standard edition. Verify each PSL before any Setup work. (See `references/gotchas.md` § 1.)
2132. **Probabilistic encryption blocks SOQL `WHERE` equality filters.** Deterministic supports equality filter (and sort). Wrong scheme = wrong queries. (See `references/gotchas.md` § 2.)
2143. **Formula / Roll-Up / unique-indexed External ID cannot be encrypted.** Encrypt the source field instead. (See `references/gotchas.md` § 3.)
2154. **Cache-Only Key Service outage = encryption operations fail.** A customer-HSM outage stops new writes that need encryption. Trade for the strongest custody posture. (See `references/gotchas.md` § 4.)
2165. **Field Audit Trail retention requires metadata XML, not Setup UI.** `HistoryRetentionPolicy` is set per object via Tooling API or metadata deploy — not a checkbox. (See `references/gotchas.md` § 5.)
2176. **Tenant secret rotation re-encrypts all data.** Plan the operation as a maintenance window for orgs with significant encrypted data volume. (See `references/gotchas.md` § 6.)
2187. **Real-Time Event Monitoring is Pub/Sub-only as of recent releases.** Old code paths against the streaming-API channels are deprecated. (See `references/gotchas.md` § 7.)
219
220---
221
222## Output Artifacts
223
224| Artifact | Description |
225|---|---|
226| Shield Architecture Decision Document | License inventory, component selection, per-field scheme decisions, key-management mode, retention policy, Event Monitoring scope, cost projection |
227| `HistoryRetentionPolicy` XML per audited object | Metadata payloads ready for deploy |
228| Pre-flight license-confirmation runbook | Procurement gate before any Setup work |
229| CCKM HSM availability runbook (if CCKM chosen) | Failure-mode response, KMS outage expected behavior |
230
231---
232
233## Related Skills
234
235- `security/platform-encryption` — Setup mechanics for the Platform Encryption component (this skill ends where that one starts).
236- `security/event-monitoring` — Setup for Event Monitoring + Real-Time Event Monitoring + Transaction Security Policies.
237- `security/field-audit-trail` — Setup mechanics for the per-object retention policy.
238- `security/byok-key-rotation` — Operational runbook for tenant-secret rotation and CCKM cache invalidation.
239- `architect/hybrid-integration-architecture` — Adjacent decisions when Shield-encrypted data flows to AWS / Heroku / external systems.