Developer agents
Repository reads, deployments and secrets access scoped by repository and environment.
A coding agent runs in CI. It may read repositories it is assigned, deploy to staging, deploy to production only with approval, and never read production secrets.
1. Register actions and resource types
In the dashboard, open Actions & resources. Register each resource type, then each action. To paste an attribute schema, switch the attribute editor to JSON.
Resource type repository: attributes
{
"team_id": { "type": "id", "required": true }
}Resource type environment: attributes
{
"environment_type": { "type": "enum", "values": ["staging", "production"], "required": true }
}Resource type secret: attributes
{
"environment_type": { "type": "enum", "values": ["staging", "production"], "required": true }
}Action repositories.read on repository, no context attributes
Action deployments.create on environment: context attributes
{
"repository_id": { "type": "id", "required": true },
"branch": { "type": "string", "required": true }
}Action secrets.read on secret, no context attributes
2. Policy
Replace <YOUR_POLICY_ID> with a new policy ID, then
validate, test and publish it with reqlo policies push --publish.
id: <YOUR_POLICY_ID>
name: Developer agents
rules:
- id: deploy-staging
effect: allow
actions: [deployments.create]
agents: { tags: [ci] }
condition: resource.attributes.environment_type == "staging"
- id: deploy-production-approval
effect: require_approval
actions: [deployments.create]
agents: { tags: [ci] }
condition: resource.attributes.environment_type == "production" && context.branch == "main"
approval: { expires_in_seconds: 3600 }
- id: deny-prod-secrets
effect: deny
actions: [secrets.read]
condition: resource.attributes.environment_type == "production"Owners and admins can approve requests from this policy in Approvals. To route them to specific people,
create an approval channel and add channel_id: APC_… to the rule's approval.
3. Authorize on the server
await reqlo.enforce({
agent: { id: "agt_ci_deployer" }, // the CI runner's registered agent
subject: { id: trigger.userId, kind: "user" }, // who triggered the pipeline (from your CI provider)
action: "deployments.create",
resource: { type: "environment", id: env.id, attributes: { environment_type: env.type } },
context: { repository_id: repo.id, branch: ref.branch },
});Notes
- Keep the project key in your deployment service, not in the CI job the agent runs in, so a compromised build can't call ReQlo as other agents.
- Branch and environment come from the CI system's trusted metadata, not from code the agent wrote.
Every example uses the same request model; only the customer-defined actions, resources and attributes differ. See Core concepts.
Something wrong or unclear? Report an issue with this page.