@salesforce/afv-skills 1.67.0 → 1.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -5
- package/package.json +1 -1
- package/skills/afcc-setup-coordinate/SKILL.md +348 -0
- package/skills/afcc-setup-coordinate/assets/console-app/AFCC_Service_Console.app-meta.xml +19 -0
- package/skills/afcc-setup-coordinate/assets/console-app/Admin.profile-meta.xml +8 -0
- package/skills/afcc-setup-coordinate/assets/console-app/Standard.profile-meta.xml +8 -0
- package/skills/afcc-setup-coordinate/assets/gap_report_template.md +35 -0
- package/skills/afcc-setup-coordinate/assets/org_profile_template.json +16 -0
- package/skills/afcc-setup-coordinate/references/gotchas.md +22 -0
- package/skills/afcc-setup-coordinate/scripts/audit_org.sh +159 -0
- package/skills/agentforce-bot-upgrade/SKILL.md +117 -66
- package/skills/agentforce-bot-upgrade/assets/_vendored/agent-spec-template.md +139 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-design-and-spec-creation.md +1211 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-script-core-language.md +1390 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-subagent-map-diagrams.md +341 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-user-setup.md +672 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-validation-and-debugging.md +904 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agentscript-toolchain.md +112 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/architecture-patterns.md +277 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/common-control-flow-pitfalls.md +255 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-actions-sequencing.md +198 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-lifecycle-side-effects.md +87 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/data-library-reference.md +891 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/instruction-resolution.md +658 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/org-setup-for-adl.md +551 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/patterns-by-requirement.md +88 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/posture-and-determinism.md +215 -0
- package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +11 -4
- package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +19 -3
- package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +82 -52
- package/skills/agentforce-bot-upgrade/references/input-contract.md +8 -8
- package/skills/agentforce-bot-upgrade/references/mapping-rules.md +19 -6
- package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +65 -6
- package/skills/agentforce-bot-upgrade/references/quality-checklist.md +4 -4
- package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +17 -3
- package/skills/agentforce-hyperclassifier-configure/README.md +24 -0
- package/skills/agentforce-hyperclassifier-configure/SKILL.md +111 -0
- package/skills/agentforce-hyperclassifier-configure/assets/customer-org.env.example +4 -0
- package/skills/agentforce-hyperclassifier-configure/assets/sample_descriptions.json +8 -0
- package/skills/agentforce-hyperclassifier-configure/assets/sample_evals.csv +17 -0
- package/skills/agentforce-hyperclassifier-configure/references/api-contract.md +41 -0
- package/skills/agentforce-hyperclassifier-configure/references/authentication.md +35 -0
- package/skills/agentforce-hyperclassifier-configure/references/evaluation.md +46 -0
- package/skills/agentforce-hyperclassifier-configure/references/installation.md +35 -0
- package/skills/agentforce-hyperclassifier-configure/references/onboarding.md +93 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/__init__.py +1 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/client.py +219 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/eca.py +178 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/evaluation.py +207 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/onboarding.py +191 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/optimizer.py +187 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hyperclassifier.py +111 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/report_hyperclassifier.py +149 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/setup_hyperclassifier.py +74 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/tests/test_hyperclassifier_skill.py +887 -0
- package/skills/agentforce-offline-experimentation-run/SKILL.md +14 -22
- package/skills/agentforce-offline-experimentation-run/scripts/bt_compare.py +81 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_fetch.py +358 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_patch_agent.py +110 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/__init__.py +34 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentpatch.py +483 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentsrc.py +565 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/cache.py +95 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/compare.py +617 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/fetch.py +1012 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +140 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +93 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/patch.py +327 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/redact.py +40 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/results.py +288 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/scoring.py +340 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +354 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/splits.py +136 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/stdm.py +98 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/tokens.py +173 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/units.py +199 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/versions.py +194 -0
- package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +367 -379
- package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +23 -6
- package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +483 -796
- package/skills/commerce-react-storefront-create/SKILL.md +54 -21
- package/skills/dx-lifecycle-center/SKILL.md +22 -13
- package/skills/dx-lifecycle-center/examples/workflows.md +54 -17
- package/skills/dx-lifecycle-center/references/connect-api.md +33 -4
- package/skills/dx-lifecycle-center/references/connect-org.md +62 -12
- package/skills/dx-lifecycle-center/references/deploy.md +3 -3
- package/skills/dx-lifecycle-center/references/hub-org.md +19 -3
- package/skills/dx-lifecycle-center/references/list-orgs.md +50 -24
- package/skills/dx-lifecycle-center/references/troubleshooting.md +22 -1
- package/skills/dx-lifecycle-center/scripts/hub-get.sh +41 -0
- package/skills/dx-lifecycle-center/scripts/resolve-environment.sh +151 -4
- package/skills/dx-org-devhub-configure/SKILL.md +85 -84
- package/skills/dx-org-devhub-configure/examples/status-output.md +25 -2
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +265 -140
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +100 -15
- package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +63 -0
- package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +252 -0
- package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +88 -0
- package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +167 -0
- package/skills/dx-packaging-push-upgrade-configure/README.md +47 -0
- package/skills/dx-packaging-push-upgrade-configure/SKILL.md +355 -0
- package/skills/dx-packaging-push-upgrade-configure/references/best-practices.md +61 -0
- package/skills/dx-packaging-push-upgrade-configure/references/cli-reference.md +148 -0
- package/skills/dx-packaging-push-upgrade-configure/references/objects.md +106 -0
- package/skills/dx-packaging-push-upgrade-configure/references/soql-recipes.md +144 -0
- package/skills/dx-scratch-def-configure/SKILL.md +163 -0
- package/skills/dx-scratch-def-configure/examples/confirm-card.md +53 -0
- package/skills/dx-scratch-def-configure/examples/report-recipes.md +100 -0
- package/skills/dx-scratch-def-configure/references/features.json +3270 -0
- package/skills/dx-scratch-def-configure/references/project-scratch-def.schema.json +1841 -0
- package/skills/dx-scratch-def-configure/references/settings-map.json +682 -0
- package/skills/dx-scratch-def-configure/scripts/lib_scratch_def.py +1306 -0
- package/skills/dx-scratch-def-configure/scripts/requirements.txt +3 -0
- package/skills/dx-scratch-def-configure/scripts/scrape_config_values.py +848 -0
- package/skills/education-cloud-domain-configure/SKILL.md +1 -1
- package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -1
- package/skills/experience-afv-analytics-query/SKILL.md +239 -0
- package/skills/experience-afv-analytics-query/references/references.md +176 -0
- package/skills/experience-app-mcp-delivery-generate/SKILL.md +142 -0
- package/skills/experience-app-mcp-delivery-generate/references/eca-consumer-key.md +26 -0
- package/skills/experience-app-mcp-delivery-generate/references/mcp-config-delivery.md +38 -0
- package/skills/experience-app-mcp-delivery-generate/references/plugin-format-and-publishing.md +80 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/developer_name.mjs +9 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/discover_mcp_context.mjs +114 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/generate_mcp_config.mjs +27 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/generate_plugin.mjs +184 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/mcp_config.mjs +57 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/preflight.mjs +109 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/retrieve_eca_consumer_key.mjs +143 -0
- package/skills/experience-app-mcp-generate/SKILL.md +174 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.eca-meta.xml +7 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaGlblOauth-meta.xml +15 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauth-meta.xml +6 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauthPlcy-meta.xml +12 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME___defaultPolicy.ecaPlcy-meta.xml +7 -0
- package/skills/experience-app-mcp-generate/assets/__MCP_SERVER_NAME__.mcpServerDefinition-meta.xml +5 -0
- package/skills/experience-app-mcp-generate/references/eca-fields.md +76 -0
- package/skills/experience-app-mcp-generate/references/mcp-objects.md +66 -0
- package/skills/experience-app-mcp-generate/references/tool-bindings.md +85 -0
- package/skills/experience-app-mcp-generate/references/troubleshooting.md +41 -0
- package/skills/experience-app-mcp-generate/references/ui-frameworks.md +19 -0
- package/skills/experience-app-mcp-generate/references/widget-resources.md +96 -0
- package/skills/experience-app-mcp-generate/scripts/activate_server.mjs +166 -0
- package/skills/experience-app-mcp-generate/scripts/check_setup_progress.mjs +212 -0
- package/skills/experience-app-mcp-generate/scripts/list_sites.mjs +211 -0
- package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +407 -0
- package/skills/experience-app-mcp-generate/scripts/preflight.mjs +127 -0
- package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +144 -0
- package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +64 -0
- package/skills/experience-app-mcp-generate/scripts/retrieve_existing_prompts.mjs +145 -0
- package/skills/experience-app-mcp-generate/scripts/retrieve_existing_tools.mjs +72 -0
- package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +195 -0
- package/skills/experience-app-mcp-generate/scripts/utils/callback_url.mjs +36 -0
- package/skills/experience-app-mcp-generate/scripts/utils/developer_name.mjs +9 -0
- package/skills/experience-app-mcp-generate/scripts/utils/eca_check.mjs +156 -0
- package/skills/experience-app-mcp-generate/scripts/utils/metadata_path.mjs +13 -0
- package/skills/experience-app-mcp-generate/scripts/verify_server.mjs +118 -0
- package/skills/experience-cms-content-type-generate/SKILL.md +1 -1
- package/skills/experience-design-validate/SKILL.md +1 -1
- package/skills/experience-search-coordinate/SKILL.md +18 -12
- package/skills/experience-search-coordinate/references/content-route.md +79 -1
- package/skills/field-service-data-capture-migrate/SKILL.md +1 -1
- package/skills/nonprofit-fundraising-configure/SKILL.md +1 -1
- package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +52 -4
- package/skills/nonprofit-fundraising-configure/references/permission-targeting.md +19 -2
- package/skills/platform-apex-generate/SKILL.md +14 -11
- package/skills/platform-apex-test-generate/SKILL.md +2 -1
- package/skills/platform-custom-field-generate/SKILL.md +24 -16
- package/skills/platform-custom-metadata-type-generate/SKILL.md +1 -0
- package/skills/platform-custom-setting-generate/SKILL.md +1 -0
- package/skills/platform-datamask-run/SKILL.md +52 -71
- package/skills/platform-datamask-run/references/api-surface.md +10 -4
- package/skills/platform-datamask-run/references/policy-authoring.md +56 -7
- package/skills/platform-datamask-run/references/run-and-abort.md +17 -10
- package/skills/platform-datamask-run/scripts/poll-job.sh +15 -25
- package/skills/platform-dataspace-access-configure/SKILL.md +43 -10
- package/skills/platform-flexipage-generate/SKILL.md +7 -10
- package/skills/platform-flexipage-generate/references/mcp_action_examples.md +42 -38
- package/skills/platform-metadata-discovery-get/SKILL.md +185 -0
- package/skills/platform-metadata-discovery-get/references/api-map.md +25 -0
- package/skills/platform-metadata-discovery-get/references/h360-routes.md +30 -0
- package/skills/platform-metadata-discovery-get/references/scoped-soql.md +52 -0
- package/skills/platform-metadata-grounding-get/SKILL.md +170 -0
- package/skills/platform-policy-rule-generate/SKILL.md +85 -231
- package/skills/platform-policy-rule-generate/references/condition-model.md +47 -0
- package/skills/platform-policy-rule-generate/references/condition-templates.md +89 -0
- package/skills/platform-policy-rule-generate/references/conjunction-compiler.md +25 -0
- package/skills/platform-policy-rule-generate/references/conjunction-expression.md +30 -0
- package/skills/platform-policy-rule-generate/references/consumer-all.md +9 -0
- package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +99 -0
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +24 -36
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition +91 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitions/FieldReadDeny_Rule_1.policyRuleDefinition +72 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitions/LastCharactersFieldMasking_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitions/PrincipalFieldMatchRLS_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitions/TaggedObjectAccess_Rule_1.policyRuleDefinition +65 -0
- package/skills/platform-policy-rule-generate/references/headless-transport.md +87 -0
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +18 -11
- package/skills/platform-policy-rule-generate/references/policy-shapes.md +107 -0
- package/skills/platform-policy-rule-generate/references/principal-expression.md +31 -0
- package/skills/platform-policy-rule-generate/references/reference-resolution.md +51 -0
- package/skills/platform-policy-rule-generate/references/resource-expression.md +48 -0
- package/skills/platform-policy-rule-generate/references/runtime-context.md +9 -0
- package/skills/platform-policy-rule-generate/references/templates-access.md +11 -9
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +5 -3
- package/skills/platform-policy-rule-generate/references/templates-record.md +37 -22
- package/skills/platform-policy-rule-generate/references/templates-transform.md +10 -8
- package/skills/platform-policy-rule-generate/references/templates.md +2 -2
- package/skills/platform-policy-rule-generate/references/ui-compatibility.md +36 -18
- package/skills/platform-report-generate/SKILL.md +29 -5
- package/skills/platform-report-generate/references/chart-types.md +26 -2
- package/skills/platform-report-generate/references/column-names.md +43 -0
- package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
- package/skills/platform-report-generate/references/summary-formulas-sorting-limits.md +118 -0
- package/skills/platform-report-generate/references/verification-checklist.md +22 -2
- package/skills/service-digital-engagement-channel-configure/SKILL.md +49 -110
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +35 -0
- package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +2 -2
- package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +58 -0
- package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +2 -2
- package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
- package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +128 -28
- package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +16 -20
- package/skills/service-digital-engagement-channel-configure/references/prechat_params.md +10 -0
- package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +38 -0
- package/skills/service-digital-engagement-channel-configure/references/user_verification.md +9 -0
- package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +4 -4
- package/skills/service-digital-engagement-channel-configure/scripts/normalize-channel-name.sh +12 -7
- package/skills/service-e911-configure/SKILL.md +242 -0
- package/skills/service-itsm-agentic-setup-agent-runtime-access-assign/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +47 -44
- package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +110 -83
- package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +7 -3
- package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +7 -5
- package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +2 -2
- package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +437 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +1 -1
- package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +0 -78
- package/skills/experience-content-media-image-generate/SKILL.md +0 -83
- package/skills/experience-content-media-image-generate/scripts/download-image.sh +0 -84
- package/skills/experience-content-media-stock-image-search/SKILL.md +0 -193
- package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +0 -102
|
@@ -1,273 +1,127 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-policy-rule-generate
|
|
3
|
-
description: "
|
|
3
|
+
description: "THE skill for creating a Data Cloud / Data Governance access policy — authors and deploys a PolicyRuleDefinitionSet + PolicyRuleDefinition pair (CRUD) covering OLS, FLS, RLS, masking/transform, and tag/classification-based access for the DATACLOUD or ALL consumer. TRIGGER when the user wants to create/write/author a Data Cloud or Data Governance policy, access policy, or policy rule, or to grant access to a Data Cloud object THROUGH A POLICY — a Data Cloud policy-create request routes here, not to the tag/classification surface. Resolves every reference via Data 360 MCP. SCOPE: Data Cloud policies only (not Security Center, DSAR, or User Access Policies). DO NOT TRIGGER to create tags/classifications, or to grant object/dataspace access via a PERMISSION SET / RBAC grant (use platform-dataspace-access-configure). For a vague object-access ask, surface both skills and ASK the permission-set way vs the policy way; if unsure the object is Data Cloud, ask which first."
|
|
4
4
|
metadata:
|
|
5
|
-
|
|
5
|
+
relatedSkills:
|
|
6
|
+
- "platform-dataspace-access-configure"
|
|
7
|
+
version: "2.0"
|
|
6
8
|
domains: ["Platform", "Data 360"]
|
|
7
|
-
minApiVersion: "
|
|
9
|
+
minApiVersion: "66.0"
|
|
8
10
|
cliTools:
|
|
9
11
|
- tool: ["jq"]
|
|
10
12
|
semver: ">=1.6.0"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
mcpTools:
|
|
14
|
+
data360:
|
|
15
|
+
tools: ["execute", "payload_examples", "search"]
|
|
16
|
+
semver: ">=1.0.0"
|
|
17
|
+
headless-360:
|
|
18
|
+
tools: ["discover", "describe", "dispatch", "dispatch_readonly"]
|
|
19
|
+
semver: ">=1.0.0"
|
|
13
20
|
---
|
|
14
21
|
|
|
15
|
-
#
|
|
22
|
+
# Generate Policy Rule Metadata
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
**Min API version:** 64.0 (66.0 for conditions using `PolicyJsonExpression`).
|
|
24
|
+
This skill generates H360 policy metadata for the explicit `DATACLOUD` or `ALL` consumer. OLS, FLS, RLS, and Transform are shared policy shapes; `DATACLOUD` additionally requires the Data Governance Policy Builder contract. `ALL` uses the general metadata/runtime contract and does not inherit DG UI restrictions.
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
## When to use this skill (routing)
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> **Eval coverage:** This skill is exercised by the team's ADK eval framework, not by `tests/evals/` under the skill directory. Five datasets covering the ACCESS / GOVERNANCE / RECORD / TRANSFORM variants live in `packages/adk-eval/eval/domains/platform-policy-rule-generate/datasets/`.
|
|
25
|
-
|
|
26
|
-
## 1. Package Layout
|
|
27
|
-
|
|
28
|
-
A deployable package always contains:
|
|
29
|
-
|
|
30
|
-
```text
|
|
31
|
-
<fixture>/
|
|
32
|
-
package.xml
|
|
33
|
-
policyRuleDefinitionSets/<setName>.policyRuleDefinitionSet
|
|
34
|
-
policyRuleDefinitions/<ruleName>.policyRuleDefinition
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
`package.xml` template (use `<version>[ftest]</version>` for ftests, `64.0` or higher for real orgs):
|
|
38
|
-
|
|
39
|
-
```xml
|
|
40
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
41
|
-
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
42
|
-
<types>
|
|
43
|
-
<members>Rule0</members>
|
|
44
|
-
<name>PolicyRuleDefinition</name>
|
|
45
|
-
</types>
|
|
46
|
-
<types>
|
|
47
|
-
<members>Set1</members>
|
|
48
|
-
<name>PolicyRuleDefinitionSet</name>
|
|
49
|
-
</types>
|
|
50
|
-
<version>64.0</version>
|
|
51
|
-
</Package>
|
|
52
|
-
```
|
|
28
|
+
This is the single entry point for **creating a Data Cloud / Data Governance access policy** (a `PolicyRuleDefinitionSet` + `PolicyRuleDefinition` pair). Any request to *create / write / author a policy, an access policy, a data governance policy, a Data Cloud policy, or a policy rule* (OLS / FLS / RLS / masking / tag- or classification-based object access) **whose target is Data Cloud** routes here — **do not** hand a Data Cloud policy-create request to the Data Governance tag/classification surface; that surface owns tags and classifications, not policy authoring.
|
|
53
29
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## 2. PolicyRuleDefinitionSet Schema
|
|
57
|
-
|
|
58
|
-
```xml
|
|
59
|
-
<PolicyRuleDefinitionSet xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
60
|
-
<label>Set1</label>
|
|
61
|
-
<description>Optional free text</description>
|
|
62
|
-
<replicated>false</replicated> <!-- MinAppVersion 260 -->
|
|
63
|
-
<builderCompatible>true</builderCompatible> <!-- MinAppVersion 262, author-settable -->
|
|
64
|
-
<!-- builderValidated: server-managed — do not set in authored XML -->
|
|
65
|
-
</PolicyRuleDefinitionSet>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
| Element | Req | Notes |
|
|
69
|
-
|---------|-----|-------|
|
|
70
|
-
| `<label>` | yes | Master label. File basename (devName) is the MDAPI identifier, not the label. |
|
|
71
|
-
| `<description>` | no | Free text. |
|
|
72
|
-
| `<replicated>` | no | `true` triggers placeholder transformation across companion orgs. Omit for null/false. |
|
|
73
|
-
| `<builderCompatible>` | no | `true` = rules audited per §7 checklist. `false` = API-only. Omit = unaudited. Informational only — no deploy/runtime effect. |
|
|
74
|
-
| `<builderValidated>` | no | **Server-managed. Never set in authored XML.** Server overwrites on validation. |
|
|
30
|
+
**Scope today: Data Cloud policies only.** This skill covers Data Cloud / Data Governance access policies. It does **not** yet cover core administrative policies, CMDB policies, or other non-Data-Cloud policy types (those are a planned future extension), and it is **not** the route for Security Center security policies, DSAR policies, or User Access Policies — leave those to their own core surfaces. If a policy-create request does not name Data Cloud and it is unclear whether the target object is a Data Cloud object, **ask which object first** (or whether it is Data Cloud) before routing here; core access-control surfaces (e.g. `scoped-access`) surfacing for a non-Data-Cloud request is legitimate.
|
|
75
31
|
|
|
76
|
-
|
|
32
|
+
Two adjacent skills, and how this one relates:
|
|
77
33
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
| Element | Req | Notes |
|
|
81
|
-
|---------|-----|-------|
|
|
82
|
-
| `<label>` | yes | MasterLabel. |
|
|
83
|
-
| `<category>` | yes | See §4. Drives `resourceScopeType` and whether `policyRuleResourceDomains`/`resourceTransform` are required. **Does NOT constrain `effect` outside of TRANSFORM.** |
|
|
84
|
-
| `<effect>` | yes | `Permit`, `Forbid`, or `Transform`. The only category-coupling enforced by core: `effect=Transform ↔ category=TRANSFORM_POLICY_RULE_DEFINITION` (bidirectional). All other categories accept Permit and Forbid freely. |
|
|
85
|
-
| `<action>` | yes (≥1) | `Read`, `TupleRead`, `Create`, etc. Multiple elements OR-combine. |
|
|
86
|
-
| `<policyRuleDefinitionSetName>` | yes | Developer name of parent set. |
|
|
87
|
-
| `<principalScopeType>` | yes | Always `ANY`. |
|
|
88
|
-
| `<resourceScopeType>` | yes | `ANY`, `FIELD`, `RECORD`, `DATASPACE`, or `SPAN`. Must match category (§4). |
|
|
89
|
-
| `<principalAuthenticationLevel>` | no | `INTERNAL`, `AUTHENTICATED`, `UNIDENTIFIED`, `IDENTIFIED`. |
|
|
90
|
-
| `<ruleConsumer>` | no | `ALL`, `DATACLOUD`, `MULESOFT`, `TABLEAU`, `CORE`. |
|
|
91
|
-
| `<policyRuleResourceDomains>` | no | Required for RECORD (RLS) and FIELD-scope TRANSFORM rules only. Forbidden on ACCESS/GOVERNANCE. |
|
|
92
|
-
| `<resourceTransform>` | no | Required (and only valid) when `category=TRANSFORM`. |
|
|
93
|
-
| `<whenPolicyRuleDefinitionClauseConjunction>` | no | WHEN conditions. |
|
|
94
|
-
| `<unlessPolicyRuleDefinitionClauseConjunction>` | no | UNLESS conditions. Not UI-editable — prefer WHEN + negated operator. |
|
|
34
|
+
- **Data Governance tags / classifications** (create a tag, create/assign a classification, list governance tags): that is a *different* surface (`data360` Data Governance). This skill only *consumes* already-existing tags/classifications as policy references — it does not create them.
|
|
35
|
+
- **`platform-dataspace-access-configure`** — the **permission-set / RBAC** way to grant object or dataspace access (PermissionSet `dataspaceScopes` + the Object Access Grants Connect API). Data-space access grants go there.
|
|
95
36
|
|
|
96
|
-
|
|
37
|
+
**Object access can be granted two ways — infer from context, ask only when vague.** For a Data Cloud / Data Governance object-access request, read the framing before acting:
|
|
97
38
|
|
|
98
|
-
|
|
39
|
+
- The user is **driving from a permission set** (mentions a permission set, RBAC, or an object grant on a permset) → this is an **object access grant** → route to `platform-dataspace-access-configure`, no need to ask.
|
|
40
|
+
- The user **frames it as a policy** (says policy, access policy, policy rule, OLS/FLS/RLS, tag/classification-based) → **create the policy here**, no need to ask.
|
|
41
|
+
- The request is **genuinely vague** — "grant object access to X" with no mechanism and no clue → **ASK** whether they want the **permission-set way** (`platform-dataspace-access-configure`) or the **access-policy way** (this skill). If it is also unclear whether the object is Data Cloud, ask which object first.
|
|
99
42
|
|
|
100
|
-
|
|
43
|
+
"Access to a **data space**" is the permission-set path — route it to `platform-dataspace-access-configure`.
|
|
101
44
|
|
|
102
|
-
|
|
45
|
+
H360 policy **create / read / update** run over the headless-360 MCP `/headless/metadata` MD-CRUD path via `dispatch`: `discover`/`describe` the operation, then `dispatch` a POST create / PUT update of the generated XML and `dispatch_readonly` GET it back to verify. See `references/headless-transport.md` for the exact request/response shapes. There is **no `sf`/MDAPI fallback** — if the headless-360 MCP session is unavailable, or the type/op is not yet on the MD-CRUD allowlist (`400 UNSUPPORTED_OPERATION`), or the org lacks feature provisioning (`400 FIELD_INTEGRITY_EXCEPTION`), surface that gap to the operator rather than routing around it. This skill covers **create, read, update, and delete (CRUD)**. **Delete does NOT run over `/headless/metadata`** — Core has no real metadata delete (a metadata DELETE 405s, and the interim delete is a no-op 200 that removes nothing), so a policy is deleted over the Data 360 MCP **Data Governance Access Policy** surface (`d360_data_governance_access_policy_delete`), which removes the Access Policy and every embedded rule by developer name. See the "Deleting a Policy" section below. Use the Data 360 MCP tools to resolve exact org references before writing XML — `search`/`payload_examples`/`execute` against read-only lookup operations (tag, classification, dataspace, and every resource object: custom/derived DMO via `d360_dmo_list`/`d360_dmo_get`, standard DMO via `d360_data_model_objects_list`/`d360_data_model_object_get`, DLO via `d360_dlo_list`/`d360_dlo_get`, calculated insight object via `d360_ci_list`/`d360_ci_get`). Only when no Data 360 MCP session is reachable, resolve a custom `__dlm` DMO's fields by a read-only headless-360 `dispatch_readonly` sObject describe as a last resort (it can miss `__dlm` objects — see `references/reference-resolution.md`). Author **creates and updates only** over `/headless/metadata` MD-CRUD — never via a Data 360 MCP `_create`/`_update` operation; the Data 360 MCP mutation surface is used only for **delete** (`access_policy_delete`, whole-policy) and, to remove a single rule while keeping the policy, `access_policy_rule_replace`. All tag/classification/dataspace/DMO/DLO/CIO lookups stay read-only. Never resolve a reference through an `sf` CLI command.
|
|
103
46
|
|
|
104
|
-
|
|
105
|
-
- All other categories (`ACCESS`, `GOVERNANCE`, `RECORD`, `IDENTIFIED_RECORD`) accept either `Permit` or `Forbid`.
|
|
47
|
+
## Deterministic Workflow
|
|
106
48
|
|
|
107
|
-
|
|
49
|
+
1. Require `consumer`: accept only `DATACLOUD` or `ALL`; do not infer or default it.
|
|
50
|
+
2. Select the operating mode. Use normal author mode unless the request explicitly says to recreate a named retrieved evidence package exactly. In explicit evidence-recreation mode, the named API 69.0 example is authoritative: preserve its condition order, exact conjunctions, persisted `SCALAR_ATTRIBUTE`/`SOQLTARGETLISTEXPR` operands, and evidence values, while omitting `builderValidated` and keeping the evidence set's `builderCompatible` as retrieved. Exact recreation takes precedence over normal authoring rewrites and target-org re-resolution. It proves only evidence fidelity, not current-org authorability, runtime enforcement, or Policy Builder validation.
|
|
51
|
+
3. Identify the policy set developer name and rule developer name.
|
|
52
|
+
4. Choose the shared policy shape, category, effect, action, and resource scope **deterministically from the request signal** — do not ask the user "is this OLS/RLS/FLS?" when the signal is clear (read of a specific named object → RLS; hide a field → FLS; mask a field value → Transform; tag/classification tenant-wide → OLS). See `references/policy-shapes.md#selecting-the-shape-deterministic--do-not-ask-the-user`. Every renderable rule MUST carry **at least one resource condition** (principal conditions are optional; a zero-conditions or principal-only rule is not deployable/renderable) — if the shape has no valid resource condition (e.g. object-wide read with no row filter), obtain a resource condition or route object-wide read to the permission-set path (`platform-dataspace-access-configure`) rather than authoring an unrenderable rule.
|
|
53
|
+
5. In normal author mode, resolve every tag, classification, custom permission, DMO/DLO, field, resource domain, join field, and principal field in the target org through MCP — never through an `sf` CLI command. Resolve tags, classifications, dataspaces, and every resource object's schema and fields through the Data 360 MCP read-only lookup operations from `references/reference-resolution.md#data-360-mcp-lookup-operations`. Resource objects are not only DMOs — resolve custom/derived DMOs (the `__dlm` suffix that most `resourceDomains` entries target) via `d360_dmo_list`/`d360_dmo_get` (family `DataModelObject`), standard/canonical DMOs via `d360_data_model_objects_list`/`d360_data_model_object_get` (family `DataModelObjectCatalog`), raw ingested DLOs via `d360_dlo_list`/`d360_dlo_get`, and calculated insight objects (CIOs) via `d360_ci_list`/`d360_ci_get`. `d360_dmo_get` returns the DMO with all field definitions; pass `includeFields:"true"` to `d360_dmo_list`. Only when no Data 360 MCP session is reachable, resolve a custom `__dlm` DMO's field API names with a read-only headless-360 `dispatch_readonly` sObject describe as a last resort — it can miss `__dlm` objects that are absent from the sObjects surface, so prefer `d360_dmo_get` whenever Data 360 MCP is available. For custom permissions and ID-valued principal comparisons (e.g. `ProfileId`), for which no Data 360 MCP lookup exists, resolve read-only through `dispatch_readonly` (a SOQL `/query` or metadata read). The MCP path addresses the org implicitly and `/headless/metadata` resolves the API version server-side, so no `ORG_ID`/`ORG_API_VERSION` resolution is needed; evidence-recreation fixtures retain the `{API_VERSION}` placeholder for the eval harness. User-provided values may be developer names, fully qualified names, labels, or partial descriptions: resolve each to the exact target-org developer/API name before generating XML. A Data 360 MCP lookup result's `id` is not the value to persist unless the field itself is ID-valued (e.g. `ProfileId`). For STANDARD_TAG/STANDARD_CLASSIFICATION `<valueReference>` values, construct the dotted path per `references/reference-resolution.md#constructing-valuereference-for-standard_tag--standard_classification` — it is not a single-field copy from the lookup record. For other `<valueDomain>`/`<select>` values, take the resolved developer/API name from the same record. When a label or description matches a reference, retain the resolved developer/API name in the metadata and do not emit the label unless the schema explicitly requires a label. Never invent reference names, infer a developer name from a label, or reuse evidence-package values.
|
|
54
|
+
6. Construct the shared policy model from `references/condition-model.md`; reject `PLACEHOLDER` because it is internal-only.
|
|
55
|
+
7. In normal author mode, if `consumer=DATACLOUD`, apply `references/consumer-datacloud-ui.md`: build a typed custom-conjunction plan for the API/UI projection, serialize it as nested MDAPI `conjunctionExpression` `AND`/`OR` groups, enforce one action and one resource domain, reject plural principal attributes, and validate directional scalar/RLS capabilities. If `consumer=ALL`, apply only `references/consumer-all.md` and base validation; make no UI-renderability claim. In evidence-recreation mode, preserve the named example's exact conjunction instead of recompiling it.
|
|
56
|
+
8. Number conditions only after grouping is complete, validate complete conjunction coverage (every top-level operand is a group, except a lone FLS/Transform `ENTITYTYPE IS FIELD` index — a lone permission or tag condition is still wrapped, e.g. FLS `(AND 1 (OR 2 3 4) (AND 5))`), then render XML. For evidence recreation, retain the evidence condition order and validate its existing numbering without rewriting it.
|
|
57
|
+
9. Author the set XML and the definition XML as two components. Author `<builderCompatible>true</builderCompatible>` on the set by default; omit it (or author `false`) only when the user explicitly asks for a non-builder-compatible policy. **ACCESS exception:** when the user explicitly requests the ACCESS category and the operator confirms API-only output (the `references/ui-compatibility.md` path), author `<builderCompatible>false</builderCompatible>` and keep the `# API-only:` marker in the description. Never author `builderValidated`. The MD-CRUD path takes each component's XML directly as `xmlRep` (see step 10) — no `package.xml`/manifest or `ORG_API_VERSION` interpolation is required. Eval fixtures retain the `{API_VERSION}` placeholder for the harness.
|
|
58
|
+
10. **Preview and confirm before writing.** The deterministic routing means no mid-flow clarifying questions; the single human checkpoint is here. Show the operator the resolved shape, target object/references, and the concrete rule (conditions + effect) and get an explicit go-ahead before the create/update dispatch. Then verify via the transport: flatten the generated `.policyRuleDefinitionSet`/`.policyRuleDefinition` XML to a single-line string (a defensive default — a properly-escaped multi-line `xmlRep` also persists, but single-line sidesteps any client that mangles newlines), `dispatch` a POST create (PUT for an update) to `/headless/metadata` for the set and then the rule, and `dispatch_readonly` GET each back to confirm a 2xx response. See `references/headless-transport.md` for the exact request/response shapes, the `xmlRep` newline guidance, and the transient-retry note. **UI-renderable-contract check:** the set read-back must carry the authored `<builderCompatible>true</builderCompatible>` (or `false` when the user opted out) and a server-set `<builderValidated>` — do not assert a specific `builderValidated` value (observed `true` alongside an authored `builderCompatible=true`; `false` when the flag was not authored). If `builderCompatible` reads back `false` although `true` was authored, the server normalized it: report that to the operator rather than retrying. `builderValidated` remains server-managed; never author it.
|
|
108
59
|
|
|
109
|
-
|
|
60
|
+
## Deleting a Policy
|
|
110
61
|
|
|
111
|
-
|
|
112
|
-
What kind of policy?
|
|
113
|
-
│
|
|
114
|
-
├── OLS/FLS allow/deny on tagged or classified resources
|
|
115
|
-
│ category = ACCESS_POLICY_RULE_DEFINITION (allow/deny attestation in the access plane)
|
|
116
|
-
│ | GOVERNANCE_POLICY_RULE_DEFINITION (governance-audited)
|
|
117
|
-
│ effect = Permit | Forbid (chosen independently from category)
|
|
118
|
-
│ resourceScopeType = ANY | FIELD | DATASPACE
|
|
119
|
-
│ NO <policyRuleResourceDomains>
|
|
120
|
-
│ condition: resourcePath=TAG|CLASSIFICATION CONTAINS_ANY <ref>
|
|
121
|
-
│ For "objects AND all their fields" → action=TupleRead + OR-of-ENTITYTYPE clause (§7)
|
|
122
|
-
│ Note: "Block access to Foo object" → tag Foo with <yourTag>, write rule on tag
|
|
123
|
-
│ Do NOT use <resourceDomain>Foo</resourceDomain> — forbidden for ACCESS/GOVERNANCE
|
|
124
|
-
│
|
|
125
|
-
├── Row-level filter on a DMO/DLO
|
|
126
|
-
│ category = RECORD_POLICY_RULE_DEFINITION
|
|
127
|
-
│ effect = Permit | Forbid
|
|
128
|
-
│ resourceScopeType = RECORD
|
|
129
|
-
│ <policyRuleResourceDomains> = the DMO/DLO API name ← entity targeting allowed here
|
|
130
|
-
│
|
|
131
|
-
├── Identified-Guest record access
|
|
132
|
-
│ NOT authorable via MDAPI — SESSION_CONSUMER_ID is not in RuleContextPathType
|
|
133
|
-
│ Must be implemented as a runtime RuleProvider.
|
|
134
|
-
│
|
|
135
|
-
└── Field masking
|
|
136
|
-
category = TRANSFORM_POLICY_RULE_DEFINITION ← required by RuleBuilder validator
|
|
137
|
-
effect = Transform ← required by RuleBuilder validator
|
|
138
|
-
resourceScopeType = FIELD (structured) or SPAN (unstructured)
|
|
139
|
-
<policyRuleResourceDomains> = the DMO whose field is masked
|
|
140
|
-
<resourceTransform> required (e.g. NULL_RESOURCE_TRANSFORM, LAST_N_CHARS_RESOURCE_TRANSFORM)
|
|
141
|
-
```
|
|
62
|
+
Delete a policy over the Data 360 MCP **Data Governance Access Policy** surface, **not** `/headless/metadata` — Core has no real metadata delete (a metadata DELETE 405s or no-ops), so it never belongs on that transport. A `PolicyRuleDefinitionSet` authored by this skill surfaces there as an **Access Policy** addressable by its developer name. Sets authored with the default `builderCompatible: true` appear in a plain `access_policy_list`; sets that were authored with the opt-out (or normalized to `false`) need `includeIncompatible: true` to show up. Either way, `access_policy_get` and `access_policy_delete` work by name regardless of builder-compatibility.
|
|
142
63
|
|
|
143
|
-
|
|
64
|
+
`d360_data_governance_access_policy_delete` takes a single `name` (the set's developer name) and is a **whole-policy delete**: one call removes the Access Policy **and every embedded rule** (its `PolicyRuleDefinition` members). There is therefore **no leaf-before-parent ordering** and **no discrete single-rule delete** — to drop one rule while keeping the policy, re-author the surviving rule set via `d360_data_governance_access_policy_rule_replace` instead. Confirm the delete by reading the policy back with `d360_data_governance_access_policy_get` by name: a not-found result (or the policy being absent from an `includeIncompatible` list) is the success signal. There is **no `sf` CLI fallback**.
|
|
144
65
|
|
|
145
|
-
|
|
66
|
+
## Validated Policy Shapes
|
|
146
67
|
|
|
147
|
-
|
|
148
|
-
|---|---|---|
|
|
149
|
-
| The prompt names "ACCESS policy rule" / "access rule" / "OLS/FLS" explicitly | `ACCESS_POLICY_RULE_DEFINITION` | Matches the prompt's vocabulary; sits in the data-access enforcement layer. |
|
|
150
|
-
| The prompt names "governance" / "audit" / "policy framework" / data-residency or compliance language | `GOVERNANCE_POLICY_RULE_DEFINITION` | Matches the prompt's vocabulary; rules surface in governance reporting. |
|
|
151
|
-
| Prompt is ambiguous and only describes allow/deny semantics | Default to `ACCESS` for Permit, `GOVERNANCE` for Forbid (mirrors the platform's auto-fill default; safe and deployable, but **not required**) |
|
|
68
|
+
For an object-level security policy with tags/classifications and principal conditions, begin with `references/examples/TaggedObjectAccess/`. Select the conjunction contract from the explicit consumer: `DATACLOUD` requires the UI custom-conjunction form; `ALL` uses the general form.
|
|
152
69
|
|
|
153
|
-
|
|
70
|
+
The real example has:
|
|
154
71
|
|
|
155
|
-
|
|
72
|
+
- One `PolicyRuleDefinitionSet`: `TaggedObjectAccess`.
|
|
73
|
+
- One `PolicyRuleDefinition`: `TaggedObjectAccess_Rule_1`.
|
|
74
|
+
- `GOVERNANCE_POLICY_RULE_DEFINITION`.
|
|
75
|
+
- `Permit` and `TupleRead`.
|
|
76
|
+
- `ANY` resource scope.
|
|
77
|
+
- Two entity-type conditions, one principal-permission condition, one principal-expression condition, and two tag conditions.
|
|
78
|
+
- A grouped conjunction expression: `(AND (OR 1 2) (AND 3 4) (AND 5 6))`.
|
|
156
79
|
|
|
157
|
-
|
|
158
|
-
|------------|:--------:|:------------:|:-----------:|:--------:|
|
|
159
|
-
| `ANY` | Yes | Yes | No | No |
|
|
160
|
-
| `DATASPACE`| Yes | Yes | No | No |
|
|
161
|
-
| `FIELD` | Yes | Yes | Yes | No |
|
|
162
|
-
| `RECORD` | No | No | No | Yes |
|
|
163
|
-
| `SPAN` | No | No | Yes | No |
|
|
80
|
+
For the validated field-level security deny shape, use `references/examples/FieldReadDeny/`: `GOVERNANCE_POLICY_RULE_DEFINITION`, `Forbid`, `Read`, and one entity-type discriminator whose right operand is `FIELD`. This example validates the deny shape; it does not establish that every other FLS shape is invalid.
|
|
164
81
|
|
|
165
|
-
|
|
82
|
+
**"Deny X unless the user has permission P" is authored as `!=`, never as `UNLESS`.** The Data Governance UI has no UNLESS section: it forces `unlessPolicyRuleDefinitionClauseConjunction` to null on save, so a policy that uses it deploys but will not open in Policy Builder. Cedar's `unless` is the natural reading of the request, so do not copy it. Keep the effect `Forbid` and express the exemption as a principal condition inside `whenPolicyRuleDefinitionClauseConjunction`: `principalPath=ASSIGNED_PERMISSIONS_PATH`, `operator=CONTAINS_NONE`, `valueReferenceType=CUSTOM_PERMISSION` (the UI's "user.permission != P"). Number it as its own `(AND n)` group. The same rewrite applies to `unless` on a tag (`TAG CONTAINS_NONE`) and on a record field (`RECORDFIELD NOT_EQUALS`). Worked shape: `references/policy-shapes.md`, section "Deny unless".
|
|
166
83
|
|
|
167
|
-
|
|
84
|
+
For the validated field-masking shape, use `references/examples/LastCharactersFieldMasking/`: `TRANSFORM_POLICY_RULE_DEFINITION`, `Transform`, `Read`, `FIELD` scope, an explicit `resourceTransform`, and one entity-type discriminator whose right operand is `FIELD`. The retrieved `LAST_N_CHARS_RESOURCE_TRANSFORM` uses a top-level `resourceExpression` of type `ARGLIST`; do not generalize its argument shape to other transforms.
|
|
168
85
|
|
|
169
|
-
|
|
86
|
+
For the validated row-level security shapes, use `references/examples/PrincipalFieldMatchRLS/` for direct record-field comparisons and `references/examples/ExistsJoinRLS/` for an `EXISTS` join block. Both use `RECORD_POLICY_RULE_DEFINITION`, `Permit`, `Read`, `RECORD` scope, and an exact target DMO in `policyRuleResourceDomains`. Resolve every DMO and field in the target org before authoring.
|
|
170
87
|
|
|
171
|
-
|
|
172
|
-
|------|-------------|----------|-------|
|
|
173
|
-
| Resource has tag | `<resourcePath>TAG</resourcePath>` | `CONTAINS_ANY` | `<valueReferenceType>CUSTOM_TAG` \| `STANDARD_TAG</valueReferenceType>` |
|
|
174
|
-
| Resource has classification | `<resourcePath>CLASSIFICATION</resourcePath>` | `CONTAINS_ANY` | `CUSTOM_CLASSIFICATION` \| `STANDARD_CLASSIFICATION` |
|
|
175
|
-
| Principal has permission | `<principalPath>ASSIGNED_PERMISSIONS_PATH</principalPath>` | `CONTAINS_ANY` \| `CONTAINS_NONE` | `<valueReferenceType>CUSTOM_PERMISSION</valueReferenceType>` |
|
|
176
|
-
| Session in dataspace | `<contextPath>SESSION_DATASPACE</contextPath>` | `CONTAINS_ANY` | `<valueReferenceType>DATASPACE</valueReferenceType>` |
|
|
177
|
-
| Record field = user attribute | `<resourcePath>RECORDFIELD</resourcePath>` + `<valueDomain>Schema:field</valueDomain>` | `EQUALS` | `<valuePrincipalPath>USER_ID` \| `ORGANIZATION_ID` \| `USER_ROLE_ID</valuePrincipalPath>` |
|
|
178
|
-
| Entity type check | `<resourcePath>ENTITYTYPE</resourcePath>` | `IS` | `<valueString>{"t":"Text","v":"FIELD"}</valueString>` |
|
|
88
|
+
Dataspace-scoped OLS is parked and unsupported because the UI-retrieved references did not pass MDAPI validation in the source org. Do not construct it until a separately validated real-org shape is available.
|
|
179
89
|
|
|
180
|
-
|
|
90
|
+
## Required References
|
|
181
91
|
|
|
182
|
-
|
|
183
|
-
|
|
92
|
+
- `references/condition-model.md`: how to construct a condition as left operand, operator, and right operand.
|
|
93
|
+
- `references/condition-templates.md`: copyable condition shapes.
|
|
94
|
+
- `references/resource-expression.md`: resource-side projections, joins, aliases, and predicates.
|
|
95
|
+
- `references/policy-shapes.md`: deterministic OLS, FLS, and masking top-level fields.
|
|
96
|
+
- `references/principal-expression.md`: principal-side `SOQLTARGETLISTEXPR` expressions.
|
|
97
|
+
- `references/conjunction-expression.md`: one-indexed boolean grouping.
|
|
98
|
+
- `references/reference-resolution.md`: exact target-org reference resolution.
|
|
99
|
+
- `references/headless-transport.md`: the `dispatch`/`dispatch_readonly` `/headless/metadata` request/response shapes (the sole transport; no CLI fallback).
|
|
100
|
+
- `references/consumer-datacloud-ui.md`: Data Governance UI grouping, cardinality, scalar attributes, and RLS field capabilities.
|
|
101
|
+
- `references/consumer-all.md`: general `ALL` consumer contract.
|
|
102
|
+
- `references/runtime-context.md`: `MIN_API_VERSION`, `ORG_API_VERSION`, and evidence-version handling.
|
|
103
|
+
- `references/conjunction-compiler.md`: deterministic bucket, index, and custom-conjunction construction.
|
|
104
|
+
- `references/examples/TaggedObjectAccess/`: semantic OLS evidence package.
|
|
105
|
+
- `references/examples/FieldReadDeny/`: semantic FLS deny evidence package.
|
|
106
|
+
- `references/examples/LastCharactersFieldMasking/`: semantic field-masking evidence package.
|
|
107
|
+
- `references/examples/PrincipalFieldMatchRLS/`: semantic direct-comparison RLS evidence package.
|
|
108
|
+
- `references/examples/ExistsJoinRLS/`: semantic projection-join RLS evidence package.
|
|
184
109
|
|
|
185
|
-
|
|
110
|
+
The semantic examples are derived from retrieved server output and retain source-org-specific values. All five examples carry `<builderCompatible>true</builderCompatible>` on the set; `builderCompatible` is authored (step 9) and `builderValidated` is never authored. They prove persisted metadata shapes, not Policy Builder open/save compatibility or a public MDAPI enum contract. Treat them as evidence, not directly deployable templates. Do not copy persisted `builderValidated` values, IDs, references, or undocumented enum values into authored packages; resolve every org-specific value again, change component identities and requested policy values, and validate the result in the target org.
|
|
186
111
|
|
|
187
|
-
##
|
|
188
|
-
|
|
189
|
-
1. Every `<conditions>` needs an `<operator>`. Missing operator → reject.
|
|
190
|
-
2. Every `<conditions>` needs at least one path element (`<resourcePath>`, `<principalPath>`, `<contextPath>`, or `<valueDomain>`).
|
|
191
|
-
3. `<contextPath>` is exclusively `SESSION_DATASPACE`. Never put a resource path value there.
|
|
192
|
-
4. Scope × category must be in the §4 matrix. Common offenders: ACCESS/GOVERNANCE + RECORD scope; RECORD + ANY/FIELD scope; TRANSFORM + ANY/RECORD scope. (Effect is independent of category except for TRANSFORM — see §4.)
|
|
193
|
-
5. `<resourceTransform>` and `effect=Transform` are coupled. Transform effect needs a resourceTransform. Permit/Forbid must not have one.
|
|
194
|
-
6. `<policyRuleResourceDomains>` is **required** for RECORD (RLS) and FIELD-scope TRANSFORM; **forbidden** on ACCESS/GOVERNANCE.
|
|
195
|
-
7. `<conjunctionExpression>` indices must match actual `<conditions>` count. Off-by-one → reject.
|
|
196
|
-
8. `<clause>` inside `<conditions>` must match the wrapper (`WHEN` inside `<when…>`, `UNLESS` inside `<unless…>`).
|
|
197
|
-
9. JSON literals in `<valueString>` must escape `"` to `"`. Wrong escaping silently corrupts the literal.
|
|
198
|
-
10. Reference targets (`<valueReference>`, `<resourceDomain>`) must exist in the target org at deploy time.
|
|
199
|
-
11. `SCALAR_ATTRIBUTE` / `PLURAL_ATTRIBUTE` are not in `RulePrincipalPathType` — not in MDAPI contract. Use a runtime RuleProvider for those shapes.
|
|
200
|
-
12. `IDENTIFIED_RECORD` is not authorable via MDAPI — `SESSION_CONSUMER_ID` not in `RuleContextPathType`.
|
|
201
|
-
13. Standard tag/classification dev names are fully-qualified dotted paths (e.g. `DataGovernanceTags.ExternalData.Visibility.Public`). Retrieve an existing rule to get the exact string before authoring.
|
|
202
|
-
14. Min API versions: `PolicyRuleDefinition` = 64.0; `PolicyJsonExpression` conditions = 66.0; `<replicated>` = 260+; `<builderCompatible>` / `<builderValidated>` = 262+.
|
|
203
|
-
|
|
204
|
-
> **Note on `<conjunctionExpression>` shape:** A bare top-level index (e.g. `<conjunctionExpression>1</conjunctionExpression>`) deploys cleanly — the server-side parser accepts bare tokens at the top level. It is **not** a deploy-time validation error. It does, however, crash the Data Governance Policy Builder UI on load — see §7.
|
|
112
|
+
## Package Contract
|
|
205
113
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
**Hard blockers** — any of these make the policy uneditable (and several crash the builder on load):
|
|
213
|
-
|
|
214
|
-
- **Missing OR-of-ENTITYTYPE clause on ACCESS/GOVERNANCE rules** → hard crash: `Cannot use 'in' operator to search for 'Permit' in undefined`. Required even when paired with `TupleRead` (where it's functionally redundant at runtime). Must include `IS` conditions for `{"t":"Text","v":"OBJECT"}` and `{"t":"Text","v":"FIELD"}`.
|
|
215
|
-
- **Bare top-level condition index** in `<conjunctionExpression>` (e.g. `1`, or `(AND (OR 1 2) 3)`) → crash on builder load in `buildCriteria`. Deploy is unaffected, but the policy is uneditable in the UI. Always wrap: `(AND 1)` for a single condition; `(AND (OR 1 2) (AND 3))` instead of `(AND (OR 1 2) 3)`.
|
|
216
|
-
- `category = ACCESS_POLICY_RULE_DEFINITION` + `effect = Forbid` → the **Data Governance Policy Builder UI** (not MDAPI) collapses it to GOVERNANCE on save; round-trip via the builder will rewrite the category. MDAPI deploy is unaffected — the original ACCESS+Forbid combination is valid and deploys without modification. If your goal is UI round-trippability, prefer GOVERNANCE for Forbid; if the source of truth is MDAPI, ACCESS+Forbid is fine.
|
|
217
|
-
- Any `<unlessPolicyRuleDefinitionClauseConjunction>` block → silently dropped on first UI save.
|
|
218
|
-
- More than one `<action>` → only the first is kept.
|
|
219
|
-
- `ruleConsumer` ≠ `DATACLOUD` → UI hardcodes DATACLOUD on save.
|
|
220
|
-
- Top-level `(OR 1 2)` conjunction → triggers `// ERROR: Unsupported rule!` path, rule silently dropped.
|
|
221
|
-
|
|
222
|
-
**UI-compatible "unless" rewrite:**
|
|
223
|
-
|
|
224
|
-
| Author intent | UI-compatible shape |
|
|
225
|
-
|---|---|
|
|
226
|
-
| `unless principal has permission X` | `WHEN ASSIGNED_PERMISSIONS_PATH CONTAINS_NONE X` |
|
|
227
|
-
| `unless resource has tag X` | `WHEN TAG CONTAINS_NONE X` |
|
|
228
|
-
| `unless record field = value` | `WHEN RECORDFIELD NOT_EQUALS value` |
|
|
229
|
-
|
|
230
|
-
For the full UI-compatibility checklist, round-trip rules, and operator support matrix, see [`references/ui-compatibility.md`](references/ui-compatibility.md).
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## 8. Authoring Workflow
|
|
235
|
-
|
|
236
|
-
1. **Start from the closest template** in [`references/templates.md`](references/templates.md) — modify from there, don't start blank.
|
|
237
|
-
2. **Pick category first** (§4). Category fixes effect, resourceScopeType, and whether policyRuleResourceDomains/resourceTransform are required.
|
|
238
|
-
3. **Lay out the bare rule**: top-level fields only, no conditions. Match the category template in [`references/templates.md`](references/templates.md).
|
|
239
|
-
4. **Add conditions one at a time**, each with all four anchors: `<clause>`, `<operator>`, one path element, and the value.
|
|
240
|
-
5. **Update `<conjunctionExpression>`** — 1-indexed prefix notation. Bare top-level index (e.g. `1`) deploys but breaks the UI; wrap as `(AND 1)` if UI editability matters (§7).
|
|
241
|
-
6. **Run the UI-compatibility check** (§7 / [`references/ui-compatibility.md`](references/ui-compatibility.md)). If any item trips, attempt the "unless" rewrite first; if not possible, get explicit operator confirmation before continuing.
|
|
242
|
-
7. **Update `package.xml`** — list each `<members>` for both types.
|
|
243
|
-
8. **Set `<builderCompatible>`** on the set to `true` if §7 checklist passes; `false` if intentionally API-only.
|
|
244
|
-
9. **Sanity-check against §6 (guardrails)** before considering done.
|
|
245
|
-
10. **Validate with dry-run** before any non-dry deploy to a persistent org. Surface errors using the error reference in [`references/deploy-errors.md`](references/deploy-errors.md).
|
|
246
|
-
|
|
247
|
-
**Three-layer correctness check** before done:
|
|
248
|
-
- **Runtime enforcement** — does the rule enforce what's intended? (action choice, condition shape)
|
|
249
|
-
- **MDAPI deploy validity** — does it deploy? (§6 guardrails, scope×category, tag dev names, org perms)
|
|
250
|
-
- **UI editability** — can the builder render and re-save it? (§7 checklist, OR-of-ENTITYTYPE requirement)
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## 9. Output Hygiene — What the Agent Must NOT Say to the User
|
|
255
|
-
|
|
256
|
-
The agent's user-facing chat response accompanies every generated file. Customers should never see internal engine or implementation details.
|
|
257
|
-
|
|
258
|
-
- **Do NOT name the internal evaluation engine** in user-facing text — including but not limited to `Cedar`, `policy engine`, `AuthZ engine`, `evaluation engine`, `Rego`, `OPA`, or similar. The customer-facing surface is *Data Governance*, *Policy Builder*, *Data Cloud Governance* — use those terms only.
|
|
259
|
-
- **Do NOT emit trailing "How it works at runtime" narratives** that describe evaluation flow, principal-resource matching semantics, or engine-internal condition ordering. The generated file is the artifact; a one-line summary of what deployed is enough. If the user explicitly asks how enforcement works, describe it in product terms (e.g. "Data Governance denies the read when …"), never in engine terms.
|
|
260
|
-
- **Do NOT name internal packages, source directories, Java class names, method names, or line-number references** in user-facing text. Internal implementation identifiers are not customer-facing; refer to platform behavior in product terms only ("the server validates …", "Data Governance rejects …").
|
|
261
|
-
- **Do NOT explain auto-fill / default-fill / fallback semantics** unless the user asks. Ship the rule; surface constraints only when they affect what the user has to do next (e.g. "the DMO tag must exist before deploy").
|
|
114
|
+
```text
|
|
115
|
+
<policy>/
|
|
116
|
+
package.xml
|
|
117
|
+
policyRuleDefinitionSets/<setName>.policyRuleDefinitionSet
|
|
118
|
+
policyRuleDefinitions/<ruleName>.policyRuleDefinition
|
|
119
|
+
```
|
|
262
120
|
|
|
263
|
-
|
|
121
|
+
The rule must contain `<policyRuleDefinitionSetName>` equal to the set filename without its extension. The package must list both metadata types.
|
|
264
122
|
|
|
265
|
-
|
|
123
|
+
Both the set and the rule take a human-readable `<label>`. The set's `<label>` conventionally matches its developer name (`TaggedObjectAccess`'s set uses `<label>TaggedObjectAccess</label>`); the rule's `<label>` conventionally identifies its position within the set (`TaggedObjectAccess_Rule_1` uses `<label>Rule 1</label>`). This is a plain descriptive label, distinct from the reference-resolution rule against emitting a *resolved-reference* label (see `references/reference-resolution.md`): never substitute a tag/classification/permission's display label for its resolved developer/API name, but the set's and rule's own `<label>` are always fine to author.
|
|
266
124
|
|
|
267
|
-
|
|
125
|
+
The MD-CRUD path sends each component's XML as `xmlRep` and resolves the API version server-side, so no `package.xml`/manifest `<version>` and no `ORG_API_VERSION` interpolation are required. The `package.xml` shown above and the `<version>{API_VERSION}</version>` placeholder are retained only for the eval fixtures and as the logical component set. Historical evidence versions are provenance only. Never modify the caller's `sfdx-project.json` to set an operation-specific version.
|
|
268
126
|
|
|
269
|
-
|
|
270
|
-
|--------|------|
|
|
271
|
-
| Full path enums, operators, value sets, JSON expressions (PROJECTION / ARGLIST / SOQLTARGETLISTEXPR) | [`references/policy-schema-full.md`](references/policy-schema-full.md) |
|
|
272
|
-
| Copy-paste templates — index at [`references/templates.md`](references/templates.md); per-variant: [`templates-access.md`](references/templates-access.md), [`templates-record.md`](references/templates-record.md), [`templates-transform.md`](references/templates-transform.md), [`templates-advanced.md`](references/templates-advanced.md) |
|
|
273
|
-
| Full UI-compatibility checklist, round-trip rules, operator/path support matrix | [`references/ui-compatibility.md`](references/ui-compatibility.md) |
|
|
127
|
+
Author `<builderCompatible>true</builderCompatible>` on every `PolicyRuleDefinitionSet` unless the user explicitly asks for a policy that is not builder-compatible (then omit it, or author `false`). For an explicitly requested ACCESS policy with operator-confirmed API-only output, author `false` and keep the `# API-only:` marker in the description. Never author `builderValidated`; it is server-managed and set by an actual Policy Builder validation.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Condition Model
|
|
2
|
+
|
|
3
|
+
Each `<conditions>` element is a comparison:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
condition = left operand + operator + right operand
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The XML does not contain literal `<left>` or `<right>` elements. The operand type determines which elements represent each side.
|
|
10
|
+
|
|
11
|
+
| Logical part | XML representation |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Resource left operand | `resourcePath`, optionally `resourceExpression` |
|
|
14
|
+
| Principal left operand | `principalPath`, optionally `principalExpression` |
|
|
15
|
+
| Context left operand | `contextPath` |
|
|
16
|
+
| Comparison | `operator` |
|
|
17
|
+
| Right reference or literal | `policyRuleValueSet` |
|
|
18
|
+
| Right record/domain value | `valueDomain` |
|
|
19
|
+
| Right principal-derived value | `valuePrincipalPath` |
|
|
20
|
+
| Clause polarity | `clause` is always `WHEN`, inside `whenPolicyRuleDefinitionClauseConjunction` |
|
|
21
|
+
|
|
22
|
+
Every condition must be constructed in this order:
|
|
23
|
+
|
|
24
|
+
1. Use the `whenPolicyRuleDefinitionClauseConjunction` wrapper. Never author `unlessPolicyRuleDefinitionClauseConjunction`: the Data Governance UI has no UNLESS section and drops it on save. Express "unless X" as a `WHEN` condition with the negated operator (`ASSIGNED_PERMISSIONS_PATH CONTAINS_NONE`, `TAG CONTAINS_NONE`, `RECORDFIELD NOT_EQUALS`); see `policy-shapes.md` "Deny unless".
|
|
25
|
+
2. Set `<clause>` to `WHEN`.
|
|
26
|
+
3. Select the left path. Most conditions use one of `resourcePath`, `principalPath`, or `contextPath`; a record-field-to-principal comparison uses both `resourcePath=RECORDFIELD` and a principal expression.
|
|
27
|
+
4. Add a `resourceExpression` or `principalExpression` if the selected left operand requires an expression.
|
|
28
|
+
5. Select the operator valid for that operand.
|
|
29
|
+
6. Add the right-side representation required by the shape. Most conditions use one of `policyRuleValueSet`, `valueDomain`, or `valuePrincipalPath`; a record-field-to-principal comparison uses `valueDomain` and `valuePrincipalPath` together.
|
|
30
|
+
|
|
31
|
+
Example: principal has a permission.
|
|
32
|
+
|
|
33
|
+
```xml
|
|
34
|
+
<conditions>
|
|
35
|
+
<clause>WHEN</clause>
|
|
36
|
+
<operator>CONTAINS_ANY</operator>
|
|
37
|
+
<policyRuleValueSet>
|
|
38
|
+
<valueReference>cust_perm1</valueReference>
|
|
39
|
+
<valueReferenceType>CUSTOM_PERMISSION</valueReferenceType>
|
|
40
|
+
</policyRuleValueSet>
|
|
41
|
+
<principalPath>ASSIGNED_PERMISSIONS_PATH</principalPath>
|
|
42
|
+
</conditions>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This means: left operand `principal.assignedPermissions`, operator `CONTAINS_ANY`, right operand custom permission `cust_perm1`.
|
|
46
|
+
|
|
47
|
+
For FLS and masking, condition 1 must be `resourcePath=ENTITYTYPE`, `operator=IS`, and `valueText=FIELD`. OLS instead begins with two entity-type conditions for `OBJECT` and `FIELD`, grouped with `OR`.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Condition Templates
|
|
2
|
+
|
|
3
|
+
Use these templates only after resolving the reference values in the target org.
|
|
4
|
+
|
|
5
|
+
## Entity Type
|
|
6
|
+
|
|
7
|
+
```xml
|
|
8
|
+
<conditions>
|
|
9
|
+
<clause>WHEN</clause>
|
|
10
|
+
<operator>IS</operator>
|
|
11
|
+
<policyRuleValueSet>
|
|
12
|
+
<valueText>OBJECT</valueText>
|
|
13
|
+
</policyRuleValueSet>
|
|
14
|
+
<resourcePath>ENTITYTYPE</resourcePath>
|
|
15
|
+
</conditions>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For a UI-renderable object-level (OLS/GOVERNANCE `TupleRead`) policy, both `OBJECT` and `FIELD` entity-type conditions are required and must be OR'd together — see the OLS section in `policy-shapes.md` and the entity-type discriminator rule in `ui-compatibility.md`. Omitting the pair still deploys and works at runtime, but crashes the Policy Builder on open (UI-only failure, not a persistence failure). FLS/masking policies use `FIELD` only — do not add an `OBJECT` condition for those.
|
|
19
|
+
|
|
20
|
+
## Standard Tag
|
|
21
|
+
|
|
22
|
+
```xml
|
|
23
|
+
<conditions>
|
|
24
|
+
<clause>WHEN</clause>
|
|
25
|
+
<operator>CONTAINS_ANY</operator>
|
|
26
|
+
<policyRuleValueSet>
|
|
27
|
+
<valueReference>EXACT.STANDARD.TAG.NAME</valueReference>
|
|
28
|
+
<valueReferenceType>STANDARD_TAG</valueReferenceType>
|
|
29
|
+
</policyRuleValueSet>
|
|
30
|
+
<resourcePath>TAG</resourcePath>
|
|
31
|
+
</conditions>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Standard Classification
|
|
35
|
+
|
|
36
|
+
```xml
|
|
37
|
+
<conditions>
|
|
38
|
+
<clause>WHEN</clause>
|
|
39
|
+
<operator>CONTAINS_ANY</operator>
|
|
40
|
+
<policyRuleValueSet>
|
|
41
|
+
<valueReference>EXACT.STANDARD.CLASSIFICATION.NAME</valueReference>
|
|
42
|
+
<valueReferenceType>STANDARD_CLASSIFICATION</valueReferenceType>
|
|
43
|
+
</policyRuleValueSet>
|
|
44
|
+
<resourcePath>CLASSIFICATION</resourcePath>
|
|
45
|
+
</conditions>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Custom Permission
|
|
49
|
+
|
|
50
|
+
```xml
|
|
51
|
+
<conditions>
|
|
52
|
+
<clause>WHEN</clause>
|
|
53
|
+
<operator>CONTAINS_ANY</operator>
|
|
54
|
+
<policyRuleValueSet>
|
|
55
|
+
<valueReference>EXACT_CUSTOM_PERMISSION_DEVELOPER_NAME</valueReference>
|
|
56
|
+
<valueReferenceType>CUSTOM_PERMISSION</valueReferenceType>
|
|
57
|
+
</policyRuleValueSet>
|
|
58
|
+
<principalPath>ASSIGNED_PERMISSIONS_PATH</principalPath>
|
|
59
|
+
</conditions>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Principal Scalar Attribute
|
|
63
|
+
|
|
64
|
+
Use the complete `principalExpression` template in `principal-expression.md`. Its right-side comparison is normally `<valueText>...</valueText>`.
|
|
65
|
+
|
|
66
|
+
For FLS or masking, instantiate the Entity Type template once with `FIELD`. For OLS, instantiate it twice, first with `OBJECT` and then with `FIELD`.
|
|
67
|
+
|
|
68
|
+
## RLS Record Field Equals Principal Attribute
|
|
69
|
+
|
|
70
|
+
Use this template in normal author mode whenever the request compares a resource field to the requesting principal's own attribute (for example, "records where `OwnerDepartment` matches the user's `Department`"). `SCALAR_ATTRIBUTE` is a confirmed, deployable, Policy Builder-compatible principal path for this comparison, per DG UI source (this is how the builder itself authors the condition, not established by a per-shape round-trip).
|
|
71
|
+
|
|
72
|
+
```xml
|
|
73
|
+
<conditions>
|
|
74
|
+
<clause>WHEN</clause>
|
|
75
|
+
<operator>EQUALS</operator>
|
|
76
|
+
<principalExpression>
|
|
77
|
+
<soqlTarget>
|
|
78
|
+
<select>EXACT_USER_FIELD</select>
|
|
79
|
+
</soqlTarget>
|
|
80
|
+
<type>SOQLTARGETLISTEXPR</type>
|
|
81
|
+
<version>1</version>
|
|
82
|
+
</principalExpression>
|
|
83
|
+
<resourcePath>RECORDFIELD</resourcePath>
|
|
84
|
+
<valueDomain>EXACT_DMO:EXACT_FIELD</valueDomain>
|
|
85
|
+
<valuePrincipalPath>SCALAR_ATTRIBUTE</valuePrincipalPath>
|
|
86
|
+
</conditions>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This shape has a resource path, a principal expression, a value domain, and a value principal path. Resolve all three API names in the target org before generating XML.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Conjunction Compiler
|
|
2
|
+
|
|
3
|
+
Construct conjunctions from a typed intermediate plan, not by hand-editing an expression string.
|
|
4
|
+
|
|
5
|
+
1. Build and validate all conditions.
|
|
6
|
+
2. Classify each condition into `DATA_SPACE`, `TAG_CLASSIFICATION`, `PERMISSION`, `ENTITY_TYPE`, or `RECORD_FIELD`; never mix classifications, permissions, entity types, and RLS criteria in one local group.
|
|
7
|
+
3. Reject conditions that cannot belong to a selected consumer/profile.
|
|
8
|
+
4. Assign stable condition IDs after final ordering.
|
|
9
|
+
5. Build each non-empty local group with its requested operator.
|
|
10
|
+
6. In normal author mode for `DATACLOUD`, build a typed custom-conjunction plan for UI validation, then serialize it to the ordinary MDAPI `conjunctionExpression`. There is no literal `CUSTOM` XML element. For example, two alternative classifications plus one required permission become `(AND (OR 1 2) (AND 3))`.
|
|
11
|
+
7. For `ALL`, use the general conjunction contract.
|
|
12
|
+
8. Validate that every condition is referenced exactly once, no unknown ID is referenced, no group is empty, and nested RLS join conditions use independent numbering.
|
|
13
|
+
|
|
14
|
+
In explicit evidence-recreation mode, do not compile or normalize the named API 69.0 example's conjunction. Its exact condition order and conjunction take precedence; validate their internal index consistency and reproduce them verbatim.
|
|
15
|
+
|
|
16
|
+
For `DATACLOUD`, a typical OLS tree is:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
CUSTOM(AND,
|
|
20
|
+
ENTITY_TYPE(OR, 1, 2),
|
|
21
|
+
TAG_CLASSIFICATION(OR, 3, 4),
|
|
22
|
+
PERMISSION(AND, 5))
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The XML has no literal section elements; section identity is represented by the custom-conjunction tree consumed by the UI.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Conjunction Expressions
|
|
2
|
+
|
|
3
|
+
Conditions are numbered in document order, starting at `1`. The `<conjunctionExpression>` uses those numbers in prefix notation.
|
|
4
|
+
|
|
5
|
+
For six conditions grouped as two entity-type checks, two principal checks, and two tag checks:
|
|
6
|
+
|
|
7
|
+
```xml
|
|
8
|
+
<conjunctionExpression>(AND (OR 1 2) (AND 3 4) (AND 5 6))</conjunctionExpression>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Top-level operator must always be `AND`.** Never emit a bare top-level `(OR 1 2)` — the UI treats it as `// ERROR: Unsupported rule!` and silently drops the rule — and never emit a bare top-level condition index for a tag/classification, permission, record-field or dataspace condition (e.g. `3` instead of `(AND 3)`), which crashes the builder — a lone permission or tag condition is still wrapped. **The one exception** is a solitary `ENTITYTYPE IS FIELD` condition in an FLS or Transform rule, which the builder itself persists bare (see `examples/FieldReadDeny` and `examples/LastCharactersFieldMasking`); the `OBJECT`/`FIELD` pair in OLS is still an `(OR 1 2)` group. `OR` is allowed only inside a single section's local group, never as (or at) the top level. Wrap every local group under a top-level `AND`: `(AND (OR 1 2))`, `(AND 3)`. See `ui-compatibility.md` for the full non-round-trip checklist.
|
|
12
|
+
|
|
13
|
+
FLS deny (field-only) with three alternative tags and a permission exemption — bare `ENTITYTYPE` (1), tag group (2-4), permission group (5):
|
|
14
|
+
|
|
15
|
+
```xml
|
|
16
|
+
<conjunctionExpression>(AND 1 (OR 2 3 4) (AND 5))</conjunctionExpression>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The permission exemption is a `CONTAINS_NONE` `ASSIGNED_PERMISSIONS_PATH` condition inside `when`, never an `UNLESS`. Leaving it as a bare `5` saves and deploys but the builder cannot open the policy.
|
|
20
|
+
|
|
21
|
+
Construction:
|
|
22
|
+
|
|
23
|
+
1. Number every `<conditions>` element from top to bottom.
|
|
24
|
+
2. Build each local group using those numbers.
|
|
25
|
+
3. Combine the groups with the top-level `AND` operator — never a bare top-level `OR` or a bare index.
|
|
26
|
+
4. Check that every referenced number exists exactly once in the intended expression.
|
|
27
|
+
|
|
28
|
+
Do not renumber conditions after changing their order without updating the expression.
|
|
29
|
+
|
|
30
|
+
An `EXISTS` resource expression can contain nested `policyRuleDefinitionCondition` elements. Its `whereClauseConjunction` has a separate one-indexed namespace. For one nested condition, use `<whereClauseConjunction>1</whereClauseConjunction>` exactly as preserved by the semantic `ExistsJoinRLS` example.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# ALL Consumer: General Policy
|
|
2
|
+
|
|
3
|
+
`consumer=ALL` selects the shared H360 policy contract. It does not apply Data Governance Policy Builder restrictions.
|
|
4
|
+
|
|
5
|
+
Keep the shared OLS, FLS, direct RLS, join RLS, Transform, condition, expression, and conjunction models reusable here. Apply base metadata, semantic, target-org reference, MDAPI, and runtime validation.
|
|
6
|
+
|
|
7
|
+
`ALL` does not mean unvalidated. Resolve resource domains, fields, joins, tags, classifications, permissions, and principal expressions before deployment. Reject `PLACEHOLDER` because it is internal-only. Do not reject `PLURAL_ATTRIBUTE` solely because the Data Governance UI cannot render it; require separate MDAPI/runtime evidence for any such policy.
|
|
8
|
+
|
|
9
|
+
RLS plus tag/classification conditions remain experimental until their combined metadata and runtime semantics are proven. Do not claim support from enum presence alone.
|