security-patterns

Enforce Salesforce security patterns in Apex and SOQL code.

2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill security-patterns-bhanu91221
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-patterns
Source: https://github.com/bhanu91221/claude-sfdx-iq/tree/main/skills/security-patterns
Command: npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill security-patterns-bhanu91221

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Salesforce security often lacks explicit, enforced checks in Apex and SOQL, leading to potential data exposure and non-compliant code patterns. This Skill provides structured patterns to consistently enforce CRUD, FLS, sharing rules, and credential checks across Salesforce codebases.

Core Features & Use Cases

  • Enforces CRUD and FLS on objects and fields
  • Applies correct sharing semantics (with sharing, without sharing, inherited sharing)
  • Demonstrates secure patterns for credentials, custom permissions, and named credentials in real projects

Quick Start

Apply the security patterns to your Apex classes and SOQL queries to ensure enforced access control and safe data handling.

Frequently Asked Questions about security-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce CRUD and FLS checks in Salesforce Apex and SOQL?

To enforce CRUD and FLS in Apex, apply structured security patterns using WITH SECURITY_ENFORCED clauses in SOQL queries to validate explicit object and field-level access before returning data.

What is the difference between WITH SECURITY_ENFORCED and WITH USER_MODE in SOQL?

WITH SECURITY_ENFORCED checks field and object level security in SOQL queries, while WITH USER_MODE enforces the running user's permissions and sharing rules, ensuring robust runtime data access validation across orgs.

When should I use without sharing vs inherited sharing in Apex classes?

Use without sharing explicitly when bypassing sharing rules for system-level operations, and inherited sharing to allow classes to inherit sharing behavior from the calling context, ensuring correct access control semantics.

How do I check custom permissions and named credentials in Apex code reviews?

Validate custom permissions and named credentials during Apex code reviews by applying structured security patterns that verify access to external endpoints and specific feature toggles before execution.

Does this Skill support runtime data access validations across multiple Salesforce packages?

Yes, the security patterns apply to code reviews, deployment checks, and runtime data access validations across Salesforce orgs and packages to maintain compliant CRUD and FLS enforcement.