What the agent does
- Finds the failing service in the production environment.
- Reads its status, its recent deployments and the environment logs.
- Compares the failing deployment with the last healthy one.
- Writes a short report: what broke, when, the likely cause, and the fix it suggests to a human.
What the policy allows
The agent can
- Find the organization, project and environment by name, as the Qovery CLI does
- Read the production environment: services, status, deployment history and logs
The agent cannot
- Read environment variable values, even in production
- Deploy, redeploy, restart or stop anything
- Change any configuration, or delete anything
- Read any other environment
401 Unauthorized.
The policy
Copy it, then replace eachREPLACE_WITH_... value with a real ID from your organization.
investigate-production-incident.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
- This is the safest place to start: the token cannot change production, so you can give it to an agent on day one.
- If you also want the agent to read logs through the Qovery MCP Server, use an API token with a read-only role for the MCP Server. It does not accept API Policy Tokens.
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.