Permissions
Three things decide what you can do in Ployz: your role, the token you use, and whether the environment is Protected. You get the smallest of the three. A token never does more than your role, and a Protected environment holds some changes back even from a token that could deploy.
See what you can do
Section titled “See what you can do”ployz permissions asks Ployz Cloud what you may do, what asks someone first and what's refused,
and names the rule behind each answer. Cloud decides; the CLI only shows what it says.
ployz permissions --as agent --project shop --env production
An agent acting as you, as owner, in shop/production (Protected):
EFFECT ACTION PLACE SOURCE
✔ allow changes:deploy - built-in (role:changes:deploy)
✔ allow servers:remove - built-in (role:servers:remove)
...
allow; ask if it destroys save - built-in (change:default; agent:store if it destroys)
ask deploy - built-in (agent:deploy)
allow; ask if it destroys shut_down - built-in (change:default; agent:store if it destroys)
Without --env, it answers for the organization. Add --project when several projects have an
environment by that name. A change that gets a different answer when it destroys something, such
as a deploy that drops a service, shows both: allow; ask if it destroys.
Some actions aren't listed, because the answer depends on what they'd change, so Ployz answers
when you run them: server, volume and service operations such as a drain or a restart, removing
an environment or project, and cancelling a deploy. The permission each needs, such as
servers:operate or environment:delete, is listed.
Check one action before you run it, the way a script would:
ployz permissions check deploy --env production
It exits 0 when the action is allowed, 4 when it asks someone first, and 5 when it's refused, and
prints the rule either way. It answers for a change that destroys nothing and notes what a
destructive one gets. Add --destroys to answer for that instead. --json prints Cloud's answer
as it came.
See what someone else gets with --as:
--as agentshows an agent acting as you, such as one you connected withployz mcp login.--as <token ID>shows a token from Organization → Tokens. Owners and admins can check any token in the organization; anyone else can check their own.
Set your organization's own rules
Section titled “Set your organization's own rules”Owners and admins can add rules on top of Ployz's built-in ones. A rule refuses a change, asks a
person first, or allows it, for every environment or one, and for everyone or one kind of login:
full (you, signed in), agent, or ci (a token). The changes are deploy, retry, save,
sync, remove, cancel and shut_down. A token made for CI still counts as ci when an agent
uses it.
ployz permissions ask deploy --env production --for agent
ployz permissions deny remove --env production --for ci
ployz permissions allow deploy --env staging --for agent
ployz permissions rm <rule ID>
Or use Organization → Settings → Permissions in the dashboard. ployz permissions lists every
rule with who set it and when, and each answer names the rule behind it. Both also list every
Protected environment as a built-in Protected rule. You turn that one on and off in the
environment's settings or with ployz env protect, not here.
- deny refuses the change wherever it starts. A refusal beats asking first, and asking first beats allowing.
- ask makes the change wait for a person to approve it with a passkey. It works for
deploy. In the dashboard, your own click answers it. - allow lets an agent's change go ahead without asking you first. It never lifts what a Protected environment asks, a refusal, or what your role or a token's grant leaves out.
An agent or a token can't change these rules, and none of them can loosen what asks before keys, members or the rules themselves change.
Pick a role for each person
Section titled “Pick a role for each person”Everyone in an organization is an Owner, Admin or Member. Members deploy, stage changes and approve requests. Admins also invite people, manage servers and delete projects. Owners also manage billing. The full table is under Invite people.
When your role can't do something, Ployz says who can, such as "Only an owner or admin of this Organization can do this."
Give CI one job
Section titled “Give CI one job”A CI key's token acts as the person who made it, narrowed to one job: it reads what they can
read, and stages and deploys changes. When the key names one environment, it deploys only
there. It can't take anything off your servers: a deploy that removes a service, volume or
domain, or ployz env shutdown, needs a person. So does a deploy that
prunes a service running in the environment that the environment
doesn't hold. Use ployz deploy --no-prune to keep it. Tokens made before CI keys keep the
preset they were made with until they expire or you revoke them.
Give CI a key for the environment it ships to, with ployz key add --ci --env ENV. Only an owner or
admin can make one for a Protected environment. See
Deploy from CI. An agent you connect
with ployz login --agent gets its own token, and that token can't approve anything.
Protect production
Section titled “Protect production”A Protected environment keeps its riskiest changes for owners and admins. Only they can connect a repository, change the deploy branch, turn protection off, or make a CI key for it. A new project's default environment starts Protected. See Protect an environment.
A member can still deploy, stop and restart there. Each waits for an owner or admin who didn't ask. Anything else only an owner or admin can do is refused with An owner or admin does this.
A merge into a Protected environment's deploy branch still deploys. Use GitHub branch protection to decide who can merge. See Protected environments.
Say yes to what removes something
Section titled “Say yes to what removes something”A change that would delete a service, volume or domain, remove a server or the organization, take a project or environment off your servers, or turn protection off shows what it removes first.
- In a terminal,
ployzasks yes or no, even with--json. Pass--yesto answer ahead. With no terminal and no--yes, it changes nothing, exits 4 and names the command with--yes. - In the dashboard, confirming the dialog is your yes.
- An agent's deploy, stop or restart comes back as a link. Open it, read what it does, and approve or deny. Any other removal from an agent is refused with where a person does it.
- A CI token can't say yes. A change through one that destroys something is refused: run it from
your own
ployz login, or in Ployz Cloud.
Destructive actions ask first has the full list.
Good to know
Section titled “Good to know”- Nobody approves their own request, and an agent can't approve anything.
- Protected guards what runs through Ployz. An admin with a shell on a server can still reach any environment on it.
- Leaving an organization ends your access and your tokens at once.