//_cli //_warden-base //_vs-code //_docs

warden

Salesforce CLI plugin open source · MIT

User lifecycle commands, from the cli or VS Code, recorded in your org.

Start with defined personas and provision users from those personas. Audit exactly why someone can see a field. Snapshot before you change anything, preview every change with --dry-run, and run all of it from your terminal or even your pipeline.

$ sf plugins install @syntax-syllogism/warden
View on GitHub
terminal — warden
# who can see this field, and through which profile or permission set?
$ sf warden access --target-org myOrg --type field \
    --target Account.CustomField__c

# does this user still match their persona? fail the build if not
$ sf warden diff --target-org myOrg --user 'Username:alice@example.com' \
    --personas-def ./personas.json --fail-on-drift

# provision a batch of users from persona definitions
$ sf warden provision --target-org myOrg \
    --users-def ./users.json --personas-def ./personas.json --dry-run

// what the CLI does

Access audits with receipts

Fields, objects, Apex classes, VF pages, tabs, record types, custom permissions. Warden lists every active user with access and the profile, permission set or group that grants it. Or flip it: everything one user can reach.

Personas, not click-paths

Describe a role once (profile, permission sets, groups, queues) and provision any number of users from it. Users with several personas get the merged result. Onboarding stops being tribal knowledge.

Drift you can fail a build on

diff compares what a user has with what their persona says they should have. Add --fail-on-drift and your pipeline catches the stray permission set before an auditor does.

Undo button included

Snapshot a user's access to a file before you touch it, and restore it later. Useful for role changes, testing, and the occasional "who removed that?"

Offboarding in one command

Freeze, unfreeze, or strip a user completely. Or strip just one persona and leave the rest of their access alone. Every command that writes takes --dry-run.

Made for pipelines

Human, CSV or JSON output, predictable exit codes, and definition files that live in git next to your metadata. Review access changes in a pull request like everything else.

// warden-base: keep the record in the org

Your access history shouldn't live in someone's terminal scrollback.

The CLI works on its own. Add warden-base, a free unlocked package, and every provisioning run, every grant and every revocation is written back to the org as Salesforce records. When security, an auditor or the next admin asks "who gave her that, and when?", the answer is a record, not a guess.

The logs stay where the data is

Each run is saved with its counts, the CLI version, who ran it, the CI job, and the git SHA of the definitions it used. Under your org's backups, sharing and retention, not in a laptop's log folder.

A grant ledger that can't be quietly edited

One row per permission set, group or queue Warden grants, linked to the persona and run behind it. A record guard blocks edits and deletes, field history is on, and only a temporary Ledger Maintenance permission can correct it.

One source of truth for personas

Import your personas into the org, export them back to JSON, and diff the two. Everyone on the team, and every pipeline, works from the same definitions.

Revoke a role without collateral damage

Because the ledger knows which persona granted what, stripping a persona removes only its access. Grants another persona still needs stay put, and the assignment is marked revoked with who and when.

Visible to the people who aren't in the terminal

The Warden Base Lightning app has tabs for personas, assignments, grants and runs. Hand a compliance reviewer the Viewer permission set and let them browse.

Easy to say yes to

No namespace, wdn_ API names, admin-only install, and permission sets scoped by job. None of them grants Modify All Data or View All Data. Open source, so your security team can read every line.

Install as an administrator in each org, then assign the permission sets by job. Copy the current 04t ID from the installation guide.

sf package install --package "$WARDEN_BASE_04T" --target-org "$ORG_ALIAS" \
  --security-type AdminsOnly --wait 30

// bonus: the VS Code extension

Rather click than type? The Warden extension puts every command in a sidebar and the Command Palette. Pick the org from a list, pick definition files from your workspace, and follow the prompts. No flags to remember. Strip always previews first and waits for you to hit Apply.

It drives the CLI plugin under the hood and offers to install it if it's missing.

Get it on the VS Code Marketplace