๐ Key Points
- AI agents and prompts in Salesforce execute strictly within the invoking user's permission boundaries.
- Missing FLS read access creates a silent failure—the system does not generate an exception or error log.
- Large Language Models (LLMs) are designed to be fluent, meaning they will seamlessly adapt to the missing context, making their output look perfectly normal.
- Testing your templates exclusively while logged in as a System Administrator creates a massive false sense of security.
Tariff_Type__c field to brief your sales team on pricing. If a junior sales rep generates this summary but their profile lacks read access to the tariff field, that data simply vanishes. The AI will still deliver a highly readable, professional summary—it will just completely omit the critical pricing detail the rep actually needed to see.
๐ต️♂️ Understanding the "Silent Blank"
The fundamental rule of Salesforce Prompt Builder is that it honors the platform's standard security model. When an AI agent generates a response, it runs in the exact context of the user who triggered it. While this is excellent for maintaining data security and preventing data leaks, it introduces a major hurdle for prompt engineering.
- Invisible Failures: The real danger is that this failure is invisible on both the backend and the frontend user interface.
- Clean Debug Logs: Because Salesforce considers hiding an inaccessible field to be "working as intended," no exception is thrown. Your debug logs will look completely clean.
- LLM Adaptation: The AI model has no idea a field was supposed to be injected there. It only receives the final, compiled text string and generates a coherent response based entirely on what it sees.
- The Admin Blindspot: Testing your prompts as a System Administrator is useless for catching this. Admins have "View All Data" and full FLS visibility, meaning the prompt will always render perfectly during your build phase.
Here is how the platform resolves the template during execution under the hood:
Prompt Template resolves a merge field:
├─ User CAN see field → Value successfully appears in the prompt
└─ User CANNOT see it → Resolves to BLANK string ("")
├─ No error thrown
├─ No exception logged
└─ Model writes fluently around the missing data
- Rule: You must create a restricted test user during the build phase and validate every prompt template as that user before deploying to production.
- Gain: You identify critical context gaps and missing FLS permissions early, preventing end-users from complaining about inaccurate or generic AI outputs later.
- Price: Creating and meticulously maintaining realistic test users requires extra time and intentional setup effort during the development lifecycle.
- Limits: Since there is no automated error to catch, your only detection method is manually reviewing and comparing the AI outputs.
- Mirror (Testing as Admin): Everything appears to work perfectly, which proves absolutely nothing about your standard end-users' actual experience.
๐ก Core Q&A & Self-Check
This is arguably the quietest failure in the entire Salesforce platform. Because the AI agent runs within a specific user's permissions, FLS applies to grounded fields just as it does to standard page layouts. The merge field simply resolves to nothing. The generated prompt becomes shorter, and the output sounds complete but lacks essential facts.
To give your LLM context, you can currently ground templates using:
- Merge Fields: Standard and custom object fields.
- Related Lists: Pulling in child records (e.g., all open cases for an account).
- Flows: Template-triggered Prompt Flows to gather complex logic.
- Apex: For highly customized SOQL queries or external callouts.
- Data Cloud: Using Data 360 retrievers to pull unified customer profiles.
Best practice: Type a placeholder in all capital letters (e.g., INSERT_ACCOUNT_NAME) so you know exactly where it goes. Place your cursor directly in front of it, click the Insert Resource button to visually map your actual Salesforce data, and then delete your temporary placeholder text.
Because the platform is behaving exactly as designed. Enforcing Field-Level Security by hiding data a user shouldn't see is considered a successful security operation by Salesforce, not a system failure. Therefore, no exception is logged.
The most reliable method is utilizing the "Run As" feature inside the Prompt Builder playground. Always select a user profile that represents your target audience (like a standard Sales Rep or Support Agent) to preview the resolution. If the grounded data is missing in the playground preview, you know you have an FLS issue to fix before activating the template.