What the agent does
- Reads the usage of each listed application over the last 30 days.
- Proposes new CPU and memory values, with some headroom.
- Applies them, within the bounds of the policy.
- Redeploys the application and checks that it is healthy.
What the policy allows
The agent can
- Find the organization, project and environment by name
- Read the staging environment, except environment variables
- Change CPU and memory of the listed applications, within the bounds
- Redeploy the listed applications
The agent cannot
- Set CPU or memory outside the bounds
- Change the minimum or maximum number of instances
- Change the Git branch
- Change or redeploy any application that is not listed
- Read or change production, delete anything
401 Unauthorized.
The policy
Copy it, then replace eachREPLACE_WITH_... value with a real ID from your organization.
right-size-applications.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
- Editing an application sends its full configuration. The policy checks CPU, memory, the number of instances and the Git branch. Other fields in the same request are not checked: add a rule for any other field you want to freeze.
- Start on staging. Once you trust the results, copy the policy for production with tighter bounds.
- The
qovery-optimizeskill uses Qovery observability data when it is enabled on the cluster. See Agent Skills.
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.