Skip to main content
A cost agent that stops development and QA environments when nobody uses them, for example at night and on weekends, and starts them again when the team needs them. It can only stop and start the environments you list. Level: Hygiene. See all the agent policy examples.

What the agent does

  1. Reads the status and the deployment history of each listed environment.
  2. Decides which ones are idle, for example no deployment for 24 hours or outside working hours.
  3. Stops the idle environments.
  4. Starts them again at the time you choose, with a deploy.

What the policy allows

The agent can

  • Find the organization, project and environment by name
  • Read the status and deployment history of the listed environments
  • Stop a listed environment, or start it again with a deploy

The agent cannot

  • Stop or deploy production, staging or any environment that is not listed
  • Delete an environment or a service
  • Change any configuration
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.
stop-idle-environments.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

  • If a fixed schedule is enough, use deployment rules instead: they start and stop environments on a schedule with no agent at all. Use an agent when the decision depends on activity.
  • Starting an environment is a deploy. The policy allows a deploy of the listed environments only.

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.