---
title: Request-level conditions
description: Detailed information on request-level policy conditions within Scaleway IAM.
tags: iam request policy conditions
dates:
  posted: 2026-07-13
  validation: 2026-07-13
---

Request-level conditions let you restrict a rule based on attributes of the request itself: the IP address it comes from, its user agent, or the time it is made.

Request-level conditions are built using [CEL](/iam/reference-content/understanding-policy-conditions/#common-expression-language) expressions. See [Understanding policy conditions](/iam/reference-content/understanding-policy-conditions) for the general concepts, operators, and logical operators shared by all condition types.

## Variables

| Name | Type         | Description |
| ------------ | ------------------- | ------ |
| `request.ip` | String | The IP address of the request. Only public IP addresses are currently supported for `request.ip` conditions; private IP addresses are not supported.   |
| `request.time` | `google.protobuf.Timestamp` | The time of the request. Represented as a Protobuf object, allowing usage with [associated functions](https://github.com/google/cel-spec/blob/master/doc/langdef.md#datetime-functions).|
| `request.user_agent`    | String        | The user-agent of the request. Truncated at 255 characters max.|

## Expression examples

### User-agent conditions

In the example below we check if the user-agent contains the term "Terraform":
```
request.user_agent.contains("terraform/")
```

### Time conditions

To only allow actions within a specific time slot, you can use the following expression:
```
request.time.getDayOfWeek() != 0 && request.time.getDayOfWeek() != 6
&& request.time.getHours("Europe/Paris") < 17
&& request.time.getHours("Europe/Paris") > 8
```
In this example, we use weekdays from 8 AM to 5 PM as a timestamp.

To only allow requests that were performed over the weekend, you can use the following expression:
```
request.time.getDayOfWeek() != 0 && request.time.getDayOfWeek() != 6
```

<Message type="tip">
  We recommend specifying timezones when creating time-based conditions. See [Timezones](/iam/reference-content/understanding-policy-conditions/#timezones) for details.
</Message>