- the use case, and what the agent does step by step,
- what the policy allows and what it blocks,
- the full policy, ready to copy,
- a prompt to create the token with the
qovery-policy-tokenskill, - a prompt to give the agent its task.
Examples
Start at the top. The first jobs only read or touch non-production environments. The last ones change production, in a narrow way.How to use an example
1
Copy the policy and replace the IDs
Every value that starts with
REPLACE_WITH_ is an ID from your organization: organization, project, environment, application or cluster. Copy them from the Console URL or list them with the Qovery CLI.2
Create the token
In the Console, open Agents → Settings → Policy tokens, click Create policy token, and paste the policy. Or ask a coding agent with the
qovery-policy-token skill, using the prompt on the page. Only an organization Owner or Admin can create a policy token.3
Give the token to the agent
Set it in the agent’s environment, never in the prompt:The agent uses the Qovery Agent Skills and the Qovery CLI.
4
Give the agent its task
Use the prompt on the page, adapted to your project and environment names.
Run it on its own
Once the token exists, give the agent a trigger: a schedule, or an event such as a webhook.1
Create its policy token
Create the token as above. Its value is shown once: keep it.
2
Schedule the agent
Pick one:
- From your coding agent. Run the job from the coding agent you already use: Claude Code, Codex, Cursor, OpenCode, Gemini CLI, VS Code Copilot, or any agent with the Qovery Agent Skills. It works through the Qovery skills or the Qovery MCP server, signed in with the policy token, which you give outside the prompt:
QOVERY_CLI_ACCESS_TOKEN=<policy token>for the skills and the CLI, or the MCP headerAuthorization: Token <policy token>. To make it recurring, use the coding agent’s own scheduling if it has one, or start it from a CI cron job with the prompt. For a webhook trigger, start it when the event happens. - As an Agent Task on Qovery (recommended). It runs next to your services on its own schedule or webhook, with no laptop or CI to keep running. From the environment’s Automations tab, or with Create agent task in Agents → Automations (early access), create an agent task with the prompt and the trigger. Agent Tasks support two triggers natively: a schedule (a cron expression and a timezone) and a webhook. Give it the Qovery MCP server,
https://mcp.qovery.com/mcp, with the headerAuthorization: Token <policy token>, added under Agents → Settings → MCPs. See Add MCP Servers.
Automate a job that has no example
Describe the recurring job in plain English to a coding agent that has the Qovery Agent Skills, with/qovery-policy-token <what the agent should do>. The skill confirms the resources with you, writes a deny-by-default policy, tests it locally, creates the token once you approve, and checks it live: calls outside the job are refused, safe reads work, and no destructive action is allowed unless you asked for it. Then schedule it: as an Agent Task on Qovery (recommended), or from your coding agent, with that token.
What every policy has in common
- Deny by default. Each policy starts with
default allow := false. A request is allowed only if one rule says so. - A rule for CLI lookups. The Qovery CLI turns names into IDs by listing the organization, its projects and the project’s environments (and its clusters, for the examples that clone). The
cli_lookuprule allows those reads and nothing more. - No environment variable values. The read rules leave out
environmentVariableendpoints, because values can be sensitive. Remove that line if your agent needs them. - One scope per job. Each rule is tied to an environment, a project, or a list of services, so the agent cannot reach anything else.
- A role as a ceiling. The examples work with the default role, organization admin. A narrower role, chosen when you create the token, caps what it can do even if the policy has a mistake, as long as the role still allows the job: a call the role refuses answers
403.
Test a policy before you create the token
A denied request returns401 with no detail, and a policy cannot be edited after creation. Test it first with OPA. Add a temporary package line, then evaluate it against a request:
false for every action the agent must not do. Do not submit the package line: Qovery adds its own. The Rego Playground works too. The qovery-policy-token skill runs these tests for you, then checks the token against the real API.
Related
API Policy Token (Preview)
How policies are evaluated, the input document, recipes and limits.
Let a coding agent deploy
Set up a coding agent with a scoped Qovery token.
Securing AI agent access
Read-only MCP, CLI allowlists and policy tokens compared.
Agent Skills
The skills the agent uses, including qovery-policy-token.