# How WP-CLI Aliases Supercharge Your Agents
> [!question] Lingering Questions
> - What command actually proves a target site's identity (URL, environment, database) before a write runs? The article names this as necessary but doesn't supply the command.
> - Can a production SSH account be scoped to only the WP-CLI subcommands an agent needs, rather than a general shell?
> - How should multisite aliases encode site scope so an agent can't silently act on the wrong subsite?
> [!tip] Article Ideas
> - "An alias names a target, not a permission" — worth a short piece contrasting convenience features with authority controls, using this and the accessibility-agent bounded-action-space material already in the vault.
> [!link] Cross Reference
> - [[3. Resources/Permanent Notes/Environment Aliases Identify Targets, Not Authority]] — the Permanent note already extracted from this exact source
> - [[3. Resources/Permanent Notes/Bounded Action Spaces Not Better Models Make Agents Safe to Run]] — same "constrain the blast radius" logic applied to a different agent architecture
> - [[3. Resources/MOCs/AI Agent Safety MOC]]
> [!quote] Vocabulary
> - *WP-CLI alias* — a named shortcut (e.g. `@prod`) in `~/.wp-cli/config.yml` mapping to an SSH nickname + remote WordPress path
> - *AGENTS.md* — a project file stating what commands an agent may run and which require human approval
## Bib
- **Source**: [How WP-CLI Aliases Supercharge Your Agents](https://www.briancoords.com/how-wp-cli-aliases-supercharge-your-agents/) — briancoords.com, 2026-07-22
- **Reader doc**: [[3. Resources/Readwise/Articles/How WP-CLI Aliases Supercharge Your Agents - Brian Coords]]
## Author's thesis
WP-CLI aliases give a coding agent a stable, named way to inspect local/staging/production WordPress without fragile browser automation or hard-coded SSH details — but the alias only identifies a target, it grants no authority; safety has to come from a separate policy layer (AGENTS.md) that keeps production read-only by default.
## Key arguments (≤3)
1. **Three-layer separation** — SSH config (how to connect), WP-CLI config (what the environment is called), AGENTS.md (what the agent may do) — keeps connection details, naming, and permission from collapsing into one file.
2. **Convenience and risk scale together** — the same alias that turns a mouthful of SSH flags into `wp @prod` also turns a destructive verb into a one-line production mistake.
3. **Structured output makes agent self-checking possible** — JSON responses let an agent verify what it just did rather than parse prose.
## Claim atoms
### An environment alias is an identifier, not a permission grant
Paraphrased from the source's Atomic Split Pad — already promoted to a Permanent note (see below).
### Connection details, environment names, and behavioral authority belong in separate layers
Paraphrased. The article's architecture: `~/.ssh/config` (connection) → `~/.wp-cli/config.yml` (naming) → `AGENTS.md` (authority). Collapsing any two layers into one file is where secrets or blanket permissions leak in.
### Production should remain read-only without explicit approval
Paraphrased. The recommended default policy: local runs freely, staging is more permissive, production requires a shown-and-approved exact command plus a dry run first.
### Every write needs target identity and recovery evidence
Paraphrased. The article doesn't supply the identity-check command itself — flagged as an open gap (see Lingering Questions) — but argues no production write should proceed without confirming target and having a backup/restore path in hand.
## Permanent candidates
- **Already captured**: [[3. Resources/Permanent Notes/Environment Aliases Identify Targets, Not Authority]] (created 2026-07-22 from this exact source — do not duplicate).
- **New candidate not yet captured**: "A write command needs a pre-flight identity check, not just an alias" — distinct emphasis (verification step, not the identifier/authority distinction already captured). Held for a future pass; the article doesn't supply the actual check command, so it's not yet strong enough to stand alone.
## Processing checklist
- [x] Connect into the relevant MOC — [[3. Resources/MOCs/AI Agent Safety MOC]]
- [x] Cross-reference existing Permanent note instead of duplicating
- [ ] Watch for a follow-up source that supplies the actual pre-write identity-check command
## Links
- [[3. Resources/MOCs/AI Agent Safety MOC]] — the three-layer alias/config/authority split is a concrete instance of bounding what a coding agent can do to a live system
- [[3. Resources/Permanent Notes/Environment Aliases Identify Targets, Not Authority]] — the claim this source already generated, linked here rather than re-derived