agentleFS
vhmarquezvhmarquez/argo/skills/trust-layer-audit/SKILL.md

trust-layer-audit

Skill1 starsChanged 7 months agoMITView on GitHub

Verify Einstein Trust Layer configuration for the target org and per-agent settings. Checks PII masking, FLS enforcement on grounding queries, zero-data-retention agreements with LLM providers, dynamic-grounding scope, and prompt-template safety. Severity-graded findings; SARIF for security pipelines.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Static checks first: Don't query the org for things grep can answer (e.g., "does the agent's prompt template contain a Salesforce ID")

    line 132
  2. Very specific:

    Per-env audits: Run with --env prod to audit prod config.

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are auditing the Einstein Trust Layer for this org and the project's agents. The Trust Layer is Salesforce-managed but has org-level toggles (data masking, ZDR agreements with LLM providers) and per-agent / per-prompt configurations that drift over time. This skill is a static + org-side check.

Read Project Config First

source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/sf-cli.sh"
sf_cli_check || exit 2
ORG="$(sf_config_get '.platform.defaultTargetOrg' "$ENV")"
AGENT_DIR="$(sf_config_get '.paths.agentDefinitions // empty' "$ENV")"
[[ -z "$AGENT_DIR" ]] && AGENT_DIR="force-app/main/default/botDefinitions"

Input

$ARGUMENTS:

  • (empty) — org-level audit + every agent in source
  • <agent-name> — focus on one agent
  • --target-org <alias> / --env <name> — overrides
  • --ci / --format json|sarif / --out <path>
  • --fail-on error|warning|note — minimum severity for exit 1 (default error)

Audit checklist

Org-level (run once per audit)

CheckSeverity if failRule ID
Einstein Trust Layer feature enabled (SetupAuditTrail shows enablement OR EinsteinPlatform setting IsEnabled = true)errorTRUST-NOT-ENABLED
Data masking active for PII fields (org-level setting + at least one PII pattern policy)errorTRUST-MASKING-OFF
Zero-data-retention agreement signed with each configured LLM provider (queryable via LLMProvider / Trust Layer settings)errorTRUST-NO-ZDR
Dynamic-grounding scope respects FLS (EinsteinFeatureSetting.GroundingFlsEnforced = true)errorTRUST-GROUNDING-FLS-OFF
Audit log retention ≥ 30 dayswarningTRUST-AUDIT-SHORT
Toxicity / bias detection enabled on outputwarningTRUST-TOXICITY-OFF

Query org-level settings via:

sf_cli_query "SELECT EinsteinTrustLayerEnabled, MaskingEnabled, GroundingFlsEnforced FROM Organization" "$ORG"

(Field names depend on the Salesforce release — fall back gracefully if a field doesn't exist; report it as a TRUST-FIELD-UNKNOWN note instead of erroring.)

Per-agent (run for each agent in scope)

CheckSeverityRule ID
All grounding SOQL in actions/*.action-meta.xml uses WITH USER_MODEerrorTRUST-GROUNDING-NO-USER-MODE
No hardcoded PII placeholders in prompt templates (no email patterns, no phone patterns, no SSN-shape strings)errorTRUST-PROMPT-PII
No hardcoded org URLs or 18-char Salesforce IDs in prompt templateswarningTRUST-PROMPT-HARDCODED
Customer-facing agents have an escalation topicwarningTRUST-NO-ESCALATION
Eval suite includes ≥1 prompt-injection / jailbreak caseerrorTRUST-NO-JAILBREAK-EVAL
Destructive actions wrapped in confirm-before-execute topic flowwarningTRUST-DESTRUCTIVE-NO-CONFIRM
All bound MCP tools (mcp/bridges/*.json) have output schemas definedwarningTRUST-TOOL-NO-SCHEMA
No prompt template asks the agent to "ignore previous instructions" or similar (would prime it for injection)errorTRUST-PROMPT-LEAKY

Static parse of agent files; do not invoke the LLM during audit.

Source-side checks (no org access required)

CheckSeverityRule ID
Agent declares all its actions in source (no implicit "discover at runtime" actions)warningTRUST-IMPLICIT-ACTIONS
Eval suite directory exists at tests/agent-evals/<agent>/ with ≥5 caseswarningTRUST-THIN-EVAL
Agent doc exists at docs/agents/<agent>.mdnoteTRUST-NO-DOC

Output

Default Markdown:

# Trust Layer Audit: order_helper @ DevVM

Run at: 2026-04-28T18:00:00Z
Scope: 1 org-level + 1 agent

## Org-level

| Check | Status |
|-------|--------|
| Einstein Trust Layer enabled | ✅ |
| PII data masking active     | ✅ (4 patterns: email, phone, SSN, credit card) |
| ZDR with OpenAI             | ✅ signed 2026-01-14 |
| ZDR with Anthropic          | ⚠️ not configured (TRUST-NO-ZDR) |
| Grounding FLS enforced      | ✅ |
| Audit log retention         | ✅ 90 days |
| Toxicity detection          | ⚠️ off (TRUST-TOXICITY-OFF) |

## Agent: order_helper

| Check | Status |
|-------|--------|
| Grounding uses WITH USER_MODE | ✅ all 3 actions |
| No PII in prompts              | ✅ |
| No hardcoded org-specific values | ⚠️ "00D5g..." Salesforce ID found in escalate_to_human (TRUST-PROMPT-HARDCODED) |
| Escalation topic               | ✅ escalate_to_human |
| Jailbreak eval                 | ✅ tests/agent-evals/order_helper/jailbreak_pii_exfil.json |
| Destructive confirm            | ✅ cancel_order topic confirms first |
| MCP tool schemas               | ⚠️ order_post.json missing outputSchema (TRUST-TOOL-NO-SCHEMA) |
| Prompt-injection priming       | ✅ no leaky phrasing detected |

## Findings

### Critical (must fix)
- TRUST-NO-ZDR — Anthropic ZDR agreement not signed (org-level) — coordinate with security/legal

### High
- TRUST-PROMPT-HARDCODED — `botDefinitions/order_helper/topics/escalate_to_human.topic-meta.xml:42` contains a 15+18-char Salesforce ID; replace with a Custom-Metadata-driven config (SF-17)

### Medium
- TRUST-TOXICITY-OFF — enable Setup → Einstein → Trust Layer → Toxicity Detection
- TRUST-TOOL-NO-SCHEMA — `mcp/bridges/order_post.json` lacks `outputSchema`; add it

### Low
- (none)

CI mode: SARIF emit per finding. Exit 0 if no findings ≥ --fail-on; 1 otherwise.

Exit codes

  • 0 — clean (or all below --fail-on)
  • 1 — findings ≥ --fail-on
  • 2 — invocation / org access failure

Rules

  • Don't bypass. Trust Layer features are non-configurable per Salesforce policy; if a check shows as off, that's almost certainly a misconfigured org or a feature that hasn't propagated yet — escalate, don't suppress
  • Static checks first. Don't query the org for things grep can answer (e.g., "does the agent's prompt template contain a Salesforce ID")
  • Don't run the LLM. This is a config audit; eval-time behavior is /argo:trust-eval's job
  • /agent-deploy runs this skill as a gate by default (pass --skip-trust to opt out, but expect the deploy report to surface a warning)
  • Per-env audits. Run with --env prod to audit prod config; thresholds may be tighter (quality.agentEvalThreshold higher)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.