What the agent does
- Clones the production environment into the sandbox project, on the non-production cluster.
- Deploys the copy and runs the end-to-end tests against it.
- Reports the results.
- Deletes the copy.
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, as a non-production environment
- Deploy, change, test and delete anything inside the sandbox project
The agent cannot
- Deploy, change or delete anything in production
- Clone production into another project, onto another cluster, or as a production environment
- Clone or move anything from the sandbox into production
- Read or change production environment variables
- Delete the sandbox project itself
401 Unauthorized.
The policy
Copy it, then replace eachREPLACE_WITH_... value with a real ID from your organization.
test-on-production-clone.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
- A clone copies the configuration, not the data: Qovery-managed databases in the copy start empty. Seed them in the test if you need data.
- A clone copies environment variables. Before the first run, check that no variable of the copy points to a production database or a production external service.
- The same policy works for other jobs on a copy, for example testing a database version upgrade before a human runs it in production.
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.