What the agent does
- Reads the current instances and the status of each listed application.
- Before the peak, raises the minimum and maximum number of instances.
- Redeploys the applications and checks they are healthy.
- After the peak, sets the instances back.
What the policy allows
The agent can
- Find the organization, project and environment by name
- Read the production environment, except environment variables
- Set the minimum and maximum instances of the listed applications, between the floor and the ceiling
- Redeploy the listed applications
The agent cannot
- Go above the ceiling, set an unlimited maximum, or go below the floor
- Change CPU, memory or the Git branch
- Deploy a new version
- Change environment variables, delete anything, or touch other applications
401 Unauthorized.
The policy
Copy it, then replace eachREPLACE_WITH_... value with a real ID from your organization.
scale-before-traffic-peak.rego
You can copy the IDs from the Console URL, or list them with
qovery project list, qovery environment list and qovery application list.
Create the token
- With the coding agent
- In the Console
In a session signed in as an organization Owner or Admin, ask:The
qovery-policy-token skill finds the IDs, writes a policy like the one above, tests it locally and against the API, then creates the token.Prompt for the agent
The agent runs with the Qovery Agent Skills and the Qovery CLI, in Claude Code, Codex, Cursor or any agent that supports skills. Give it the token through the environment, never in the prompt:policy:<token-id>:<token-name>.
Good to know
- Autoscaling already adds instances when CPU or memory goes up. This agent is for peaks you know in advance, so the instances are ready before the traffic arrives.
- The policy pins CPU, memory and branch to the values you write in it. If you change them later, create a new token with the new values.
Related
All agent policy examples
Every use case, from read only to production changes.
API Policy Token (Preview)
How policies are evaluated, the input they see, and the limits.