What the agent does
- Fixes the vulnerability in the code or the Dockerfile, on a branch (in your Git provider).
- Clones production into the sandbox project and deploys the patched branch on the copy.
- Runs the tests on the copy, then deletes it.
- Deploys the patched commit to production and checks the service is healthy.
What the policy allows
The agent can
- Find the organization, projects, environments and clusters by name
- Read the production environment, except environment variables
- Clone production into the sandbox project, on the non-production cluster
- Deploy, change, test and delete anything inside the sandbox project
- Deploy a named commit of the listed production applications
The agent cannot
- Change production configuration or environment variables
- Redeploy, stop or delete anything in production
- Deploy an application that is not listed
- Clone or move anything from the sandbox into production
401 Unauthorized.
The policy
Copy it, then replace eachREPLACE_WITH_... value with a real ID from your organization.
patch-security-issue.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
- The policy allows deploying any named commit of the listed applications. Protect your main branch with code review if a human must approve the code itself.
- A clone copies environment variables. Check that the copy does not point to a production database before the first run.
- To release to a small part of production first, you need a canary setup in your application or your ingress. The policy does not change how a deploy is rolled out.
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.