- 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 your organization settings, then Token API, then Add new in Policy API 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.
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.
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.