The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Must-read

Threat actors are using the ARTEX framework against Salesforce orgs; here is how to defend (opens in a new tab)

You will learn how an AI-driven attack against Salesforce environments behaves, what Salesforce Threat Intelligence has observed, and which controls to put in place now.

  1. Use stolen application credentials
  2. Relay traffic through Apex and Named Credentials
  3. Inspect existing Apex and integration settings
  4. Deploy custom Apex and REST endpoints
  5. Enumerate users, profiles and Permission Sets
  6. Retry code-execution and integration paths
How the ARTEX-assisted campaign moved through a Salesforce org, from access to persistence

Salesforce Threat Intelligence reports that several threat actors are using ARTEX, an open-source, multi-agent offensive framework originally built for autonomous penetration testing. A malicious operator supplies a target and an objective, and AI agents coordinate the intrusion, combining known attack techniques with continuous planning, parallel execution and on-the-fly code generation. The framework’s GitHub repository was taken down, but community forks still circulate, and the authors treat ARTEX as an accessible capability rather than a tool tied to one actor. Other vendors report its use by a state-aligned actor against Microsoft 365 tenants and by financially motivated groups against financial organizations.

Salesforce observed a campaign that used stolen application credentials and trusted integration sessions against customer environments. The company states that the activity did not stem from a flaw in the Salesforce platform and that affected customers were notified directly. The observed behavior included using Salesforce as a relay through Apex and abused Named Credentials, inspecting existing Apex and integration settings before deploying custom Apex, REST endpoints and Visualforce components, and testing the compromised account’s effective permissions by enumerating users, profiles and Permission Sets. The attackers kept retrying code-execution and integration paths, including anonymous Apex, and audit logs showed rapid, dynamic automation that Salesforce reads as an agentic-like operator.

The recommended defenses are phishing-resistant MFA for all users, with Salesforce already enforcing it for admins and MFA for all users, User Email Domain Restrictions, short-lived context-bound OAuth tokens, and step-up authentication for sensitive actions such as bulk export and permission changes. Also recommended are IP allowlisting for users and Connected Apps, behavioral detection of full attack sequences, Event Monitoring streamed to a SIEM, regular scanning of repositories for exposed secrets, and a response plan able to disable an integration, revoke tokens and reset credentials within hours.

Read the original at Salesforce Blog (opens in a new tab)

Worth reading?

Recommended

Lessons from building a Flow Version Cleaner on the Tooling API (opens in a new tab)

You will learn how to choose between the Tooling API, Metadata API and Apex Metadata for deleting flow versions, and how to handle authentication, object dependencies and state across asynchronous jobs.

Why read this

The piece also sets out safeguards for destructive metadata automation.

  1. Keep the active flow version
  2. Keep newer versions under review
  3. Keep recent inactive versions as fallback
  4. Delete flow interviews via callouts
  5. Delete remaining obsolete flow versions
The cleaner's flow version decision sequence, from protected versions to safe deletion

The author built an open-source Flow Version Cleaner to prune obsolete flow versions in orgs with hundreds of flows. The tool keeps the active version, keeps newer versions that may be under review, and retains a configurable number of recent inactive versions as a fallback. Requirements were refined during the build, once it became clear that version numbers alone do not show which versions are safe to remove.

The article compares the Apex Metadata namespace, the Metadata API with destructive changes, and the Tooling API. The Tooling API was chosen because it lets each flow version be queried and deleted individually at run time, so one failure does not roll back the whole run. Authentication uses Named Credentials rather than the running user’s session, since session IDs can be null in asynchronous work and should not carry the permissions of whoever started the job. Flow interviews must be deleted before flow versions, and because Apex does not allow a callout after DML in the same transaction, both steps use callouts. Versions owned by managed packages cannot be deleted by subscribers.

For asynchronous work, the author recommends building an explicit payload between jobs, since inner-class fields can arrive null without any error, and using one snapshot of org state for both the decision and the action. Destructive metadata work should run in dry-run mode first, record every candidate, and isolate failures, because deleted metadata cannot be restored from the Recycle Bin.

Read the original at Salesforce Architects (opens in a new tab)

Worth reading?

Recommended

Securing Salesforce to LLM integrations with Apex and scoped permissions (opens in a new tab)

Readers will learn how to enforce least-privilege access when calling external language models from Apex, including proper use of WITH USER_MODE, Named Credentials, and response validation.

The article argues that connecting Salesforce to a large language model takes more than an API key. The integration should control which records and fields the model can reach, protect credentials, minimize the data sent, and stop AI output from triggering unauthorized actions. It proposes an architecture with five parts: Salesforce enforcing permissions, Apex or middleware handling authorization and request building, Named Credentials managing the endpoint and authentication, the LLM API generating output, and a validation layer checking results before they are shown or used. A support assistant summarizing Cases, for example, needs only subject, description and status, not full contact or financial history. Authorization should happen before data is sent to the model and again before any business action follows its response.

The piece distinguishes several permission mechanisms that must be combined rather than relying on OAuth scopes alone: integration identity, object permissions, field-level security, record sharing and application-level restrictions. In Apex, declaring a class with sharing does not enforce object and field permissions, so the article recommends WITH USER_MODE on supported SOQL queries, with Security.stripInaccessible() as an alternative for removing inaccessible fields. For credentials, it recommends never hardcoding API keys and instead using External and Named Credentials, granting access through Permission Sets, and keeping separate configurations for each environment. A sample Apex class summarizes a Case through the OpenAI Responses API, querying only needed fields, sending a minimal payload, and checking the HTTP status and response structure before returning text.

The article also covers defending against prompt injection, since record text from emails or tickets may contain malicious instructions. Its safeguards include treating retrieved text as untrusted, limiting fields and records, avoiding unrestricted query or tool access for the model, checking proposed operations against a server-side allowlist, requiring human approval for consequential changes, and filtering documents by user access before they reach the model in retrieval-based designs. For scale, it suggests asynchronous processing with Queueable Apex or middleware for longer tasks, bounded retries with backoff only for suitable errors, request identifiers to prevent duplicate actions, token and latency monitoring, and cache designs that respect permission changes. The conclusion urges starting with a read-only use case and adding write capabilities only after authorization and failure handling are tested.

Read the original at dev.to (opens in a new tab)

Worth reading?