Skip to main content
A triage agent that reads production to find a bug, pushes a fix on a branch, and checks it in the preview environment Qovery creates for the pull request. It can deploy, redeploy and stop previews. Production and staging are read only. Level: Previews. See all the agent policy examples.

What the agent does

  1. Reads production status, deployment history and logs to find the bug.
  2. Pushes a fix on a branch and opens a pull request (in your Git provider, outside Qovery).
  3. Deploys or redeploys the preview environment of that pull request and checks that it works.
  4. Stops the preview when the check is done.

What the policy allows

The agent can

  • Find the organization, project and environment by name
  • Read every environment of the project, production included, except environment variables
  • Deploy, redeploy, restart or stop a preview environment, or one of its services

The agent cannot

  • Deploy, restart or stop production or staging
  • Change configuration or environment variables, even in a preview
  • Delete anything, or clone an environment
  • Act on another project
Anything the policy does not allow is refused with 401 Unauthorized.

The policy

Copy it, then replace each REPLACE_WITH_... value with a real ID from your organization.
fix-in-preview-environment.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

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:
Then give the agent its task:
Every call the agent makes appears in the audit logs as policy:<token-id>:<token-name>.

Good to know

  • The policy cannot see whether an environment is a preview. It allows every environment of the project except the ones you list in protected_environment_ids. Add any new long-lived environment to that list.
  • To also let the agent delete previews, use the preview cleanup policy, or add its delete rule to this one.

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.