Skip to main content
A reliability agent that watches production after a release. If error rates go up, it finds the last healthy version of the service and deploys it again. It can deploy a given version of the listed services, and nothing else. Level: Reliability. See all the agent policy examples.

What the agent does

  1. Reads the deployment history and the logs after a release.
  2. Decides whether the new version is the cause of the errors.
  3. Finds the last healthy commit or image tag in the deployment history.
  4. Deploys that version, checks the service is healthy, and reports.

What the policy allows

The agent can

  • Find the organization, project and environment by name
  • Read the production environment, except environment variables
  • Deploy a given commit of the listed applications
  • Deploy a given image tag of the listed containers

The agent cannot

  • Deploy without naming the version
  • Deploy, stop or restart anything else
  • Change configuration or environment variables
  • Delete anything
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.
roll-back-bad-release.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 know whether a commit is older than the current one. It allows deploying any named commit or tag of the listed services, so the agent could also deploy a newer version. Keep tests and code review on your main branch.
  • Qovery already rolls back automatically when new pods fail to start, with the RollingUpdate strategy. This agent handles the other case: the new version starts, but behaves badly.

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.