Loading...
Loading...
Configure Salesforce Shield Platform Encryption — generate deployable encryption settings and encrypted-field metadata, and answer key-model and lifecycle questions. TRIGGER when: user wants to turn on deterministic encryption, encrypt a field, set up Cache-Only Keys, External Key Management, or replay detection, or mentions Shield Platform Encryption, encryption at rest, deterministic vs probabilistic encryption, encryptionScheme, PlatformEncryptionSettings, EncryptionKeySettings, BYOK, BYOKMS, tenant secrets, key rotation, or .settings-meta.xml / .field-meta.xml for encryption — even when they don't say 'Shield'. SKIP when: user needs a generic custom field with no encryption (use platform-custom-field-generate), needs the raw Metadata API type reference (use platform-metadata-api-context-get), or asks about Classic Encryption (encrypted text fields), which is a different feature. Use this skill for any Platform Encryption configuration, field-encryption, or key-model question.
npx skill4agent add forcedotcom/sf-skills platform-encryption-configure*.settings-meta.xml*.field-meta.xmlencryptionSchemePlatformEncryptionSettingsEncryptionKeySettingsplatform-custom-field-generateplatform-metadata-api-context-getEncryptedTextassets/references/*.settings-meta.xmlcanExternalKeyManagementenableCacheOnlyKeysEncryptionKey.settings-meta.xmlanswer.md*.settings-meta.xml*.field-meta.xmlDeterministic*enableDeterministicEncryptioncanExternalKeyManagement*.field-meta.xml*.settings-meta.xmlDEPLOYMENT_GUIDE.mdREADME.mdEXPLANATION.mdsettingsreferences/encryption-schemes.mdassets/encrypted-field.field-meta.xmlencryptionSchemeDeterministic*Write the field file at the SFDX source path, not the root. Amust live at*.field-meta.xml(e.g.objects/<ObjectApiName>/fields/<FieldApiName>__c.field-meta.xml) — the object folder uses the object's API name (objects/Patient__c/fields/Diagnosis_Notes__c.field-meta.xmlfor a custom object,Patient__cfor a standard one) and the file is named after the field API name. Emitting the file at the repo root, in a flat directory, or under any other folder is a structural miss even when the XML itself is correct.Contact
assets/PlatformEncryption.settings-meta.xmlassets/EncryptionKey.settings-meta.xmlreferences/key-models.mdName the output file after the Settings member, not the root element, and write it under. Asettings/file must beSettings, wheresettings/<member>.settings-meta.xmlis the org's metadata member name —<member>(rootEncryptionKey) and<EncryptionKeySettings>(rootPlatformEncryption). Put it in the<PlatformEncryptionSettings>source folder (e.g.settings/), not the repo root. Naming the key-settings filesettings/EncryptionKey.settings-meta.xmlorEncryption.settings-meta.xmlfails deployment with "The object '…' of type Settings metadata does not exist."EncryptionKeySettings.settings-meta.xml
Cache-Only Keys and replay detection are a one-way dependency, not an auto-enable. You may setonly afterenableReplayDetectionisenableCacheOnlyKeys; enabling Cache-Only does not turn replay detection on by itself. An org can validly run Cache-Only with replay detection off.true
references/tenant-secret-lifecycle.mdscripts/validate-encryption-metadata.shencryptionSchemeEncryptionKeySettingsexamples/cache-only-keys.settings-meta.xml| Constraint | Rationale |
|---|---|
| These are the only values the Metadata API accepts ( |
Set | The contract is "Requires enableCacheOnlyKeys=true before setting enableReplayDetection to true" — a one-way dependency. |
| Use deterministic schemes only when the field must be filtered, sorted, or grouped | Probabilistic is stronger but non-filterable; deterministic trades some cryptographic strength for queryability. |
| Never claim a filter/sort/group on a probabilistically-encrypted field silently returns zero rows | The platform rejects the query with |
Do not emit | The WSDL element is |
| Transactional-DB, EKM, and Data 360 key fields require API 63.0+ | |
A guidance question produces exactly one markdown answer file — never a deployable | The answer file is the user's reference document — it persists in the workspace and can be shared or revised. Emitting a deployable metadata file for a guidance question is unsolicited configuration that could be accidentally applied; emitting no file leaves the user without a tangible deliverable. |
| An artifact request emits only the metadata file(s) asked for — no companion files | Adding a |
| Issue | Resolution |
|---|---|
| Filtering/sorting/grouping on a probabilistically-encrypted field | The query is rejected with |
| Assuming Cache-Only Keys auto-enables replay detection | It does not. Set |
| Case sensitivity in deterministic matching | |
| Confusing BYOK with BYOKMS/EKM | BYOK = you upload key material Salesforce stores; BYOKMS/EKM = key material stays in your external KMS. See |
Using | Wrong element. The field is |
| Classic Encryption vs Shield | |
answer.md*.settings-meta.xml*.field-meta.xml*.field-meta.xmlencryptionSchemeobjects/<ObjectApiName>/fields/<FieldApiName>__c.field-meta.xml<type>TextLongTextAreaTextLongTextAreasettings/<member>.settings-meta.xmlsettings/PlatformEncryption.settings-meta.xml<PlatformEncryptionSettings>settings/EncryptionKey.settings-meta.xml<EncryptionKeySettings>DEPLOYMENT_GUIDE.mdREADME.mdassets/| Need | Delegate to |
|---|---|
| A custom field with no encryption | |
| The raw Metadata API type/field reference | |
| File | When to read |
|---|---|
| Before generating an encrypted custom field |
| Before generating org encryption-policy settings (member |
| Before generating key-management settings — Cache-Only, EKM, Data 360 (member |
| When choosing deterministic vs probabilistic, or explaining encrypted-field query behavior |
| When configuring or explaining BYOK / BYOKMS / EKM / Cache-Only key models |
| When the user asks about key rotation, destruction, or BYOK upload |
| To verify a generated Cache-Only key-settings file |
| After generating any settings XML — validates the replay dependency and scheme enum |