> For the complete documentation index, see [llms.txt](https://docs.we360.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.we360.ai/reference/work-and-time-management/product/workforce-productivity/geofencing-and-controls.md).

# GeoFencing and Controls

We360.ai GeoFencing — locations defined by IP ranges, countries, and GPS geofences; allow and deny rules for portal access, punches, and tracking; how requests are matched, and what mobile and desktop

> Feature Path: Settings → Attendance → GeoFencing Locations · Settings → Compliance & Security → GeoFencing

**GeoFencing** lets you decide *where* We360.ai may be used. You define **Locations**, such as your head office, a branch, or a client site, and then write **rules** that allow or deny three actions from each location: signing in to the portal, punching in and out, and sending tracking data.

A Location can be described three ways, and you can combine them:

| Parameter       | Matches when                                                               | Typical use                                               |
| --------------- | -------------------------------------------------------------------------- | --------------------------------------------------------- |
| **CIDR ranges** | The request comes from a public IP address inside one of the ranges        | Office networks, VPN exit points                          |
| **Countries**   | The request's IP address resolves to one of the countries                  | Restricting work to a country                             |
| **Geofence**    | The employee's phone reports a GPS position inside a circle around a point | Site-based field staff punching in from a client location |

The first two work for every kind of client, including desktop agents, because they only need the network address. The geofence only works with the mobile app, because only a phone reports a trustworthy GPS position.

{% hint style="info" %}
CIDR ranges, countries, and the allow and deny rules are available on every plan. Adding a **geofence** (a map point and radius) to a Location, and **Field Assignments**, require the Field Management or Advanced Compliance feature. Contact your account manager to confirm access.
{% endhint %}

***

## Two screens named GeoFencing

| Screen                   | Path                                              | What you do there                                                                                      |
| ------------------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| **GeoFencing Locations** | **Settings → Attendance → GeoFencing Locations**  | Create and order Locations: name, address, countries, CIDR ranges, and optionally a geofence on a map  |
| **GeoFencing** (rules)   | **Settings → Compliance & Security → GeoFencing** | Write **Deny Rules** and **Allow Rules** that say which teams may do which actions from which Location |

Both screens need the Tenant Owner role. Locations are shared with Seat Management, where a Location is also a facility with floors and seats.

***

## Locations

### The Default location

Every organization has a built-in **Default** location whose only parameter is the catch-all range `0.0.0.0/0`, meaning *any IPv4 address*. It always sits last in the evaluation order and cannot be edited or deleted. A new organization starts with one Allow Rule on Default that permits every action for every team, so nobody is locked out until you decide otherwise.

### Adding a Location

Click **Add Location** on **GeoFencing Locations**. You can have up to **5 Locations**, including Default.

| Field                         | Required | Notes                                                                                                                                                                                 |
| ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Location Name**             | Yes      | Must be unique. Up to 128 characters.                                                                                                                                                 |
| **Address**                   | No       | Free text for your own reference.                                                                                                                                                     |
| **Country**                   | No       | One or more countries.                                                                                                                                                                |
| **CIDR Ranges**               | No       | One or more IPv4 ranges such as `203.0.113.0/24`. A **CIDR Calculator** link is provided. Each entry is validated on the spot: octets must be 0 to 255 and the prefix length 0 to 32. |
| **Geofence (mobile punches)** | No       | Shown only when your plan includes geofencing. Pick a centre and radius on the map.                                                                                                   |

At least one of CIDR ranges, countries, or a geofence must be set. **Every parameter you set must be satisfied** for a request to count as that Location; leave a parameter empty to not restrict on it. For example, a Location with a country *and* a CIDR range only matches requests that are both in that country and inside that range.

{% hint style="warning" %}
The IP address We360.ai sees is your network's **public** address, not the private address on an employee's computer. Enter the public range your office or VPN exits through. Private ranges such as `192.168.x.x` only work when they genuinely reach the service, for example over a site-to-site VPN. IPv6 addresses are not supported; if your network is IPv6-only, make sure it also has an IPv4 exit or no Location will match.
{% endhint %}

### Setting a geofence on the map

The **Geofence** picker shows a map. Place the centre by clicking the map, dragging the pin, searching an address, or clicking **Use my current location** (your browser will ask for permission). You can also type the latitude and longitude.

Set the **radius** with the slider or the number box. The slider runs from **25 m to 50 km** on a logarithmic scale so small office radii stay precise, with marks at 100 m, 1 km, 10 km, and 50 km. The default radius is **200 m**. A geofence needs a latitude, a longitude, and a radius above zero. **Remove geofence** clears it.

The caption under the picker states the scope: only the device's own GPS fix is checked against a geofence; desktop agents are matched by network and country.

### Order matters

Locations are checked **top to bottom** in the order shown, and the **first Location whose parameters all match** is used. Use **Move Up** and **Move Down** to arrange them, and put narrower Locations above broader ones. New Locations are placed at the top, above Default.

Because Default matches any IPv4 address, a request that fits no other Location always lands on Default, and the rules on Default decide what happens to it.

### Editing and deleting

Edit a Location any time; the rules that reference it are unaffected. A Location that is used by any Allow or Deny Rule cannot be deleted until you remove those rules. Default can never be deleted. Deactivating or deleting a Location removes it from evaluation immediately.

***

## Rules

Open **Settings → Compliance & Security → GeoFencing**. The page shows **Deny Rules** above **Allow Rules**, with an arrow between them showing that deny is checked first. Each table holds up to **5 rules**.

Each rule has:

| Column                 | Meaning                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| **Location Name**      | The Location the rule applies to                                                           |
| **Applied on Team(s)** | One or more teams, or **All Teams**. A team rule also covers all of that team's sub-teams. |
| **Punch In/Out**       | Applies to punching in and out (mobile app, desktop agent, manual punches)                 |
| **Portal Access**      | Applies to signing in to the web portal                                                    |
| **Device Tracking**    | Applies to the desktop agent sending activity data                                         |

Tick the actions the rule covers, then **Save Restrictions**. Duplicate rules (same Location, teams, and actions) are rejected. The rule on Default cannot be deleted.

### Policy-evaluation flow

This flow first applies the tracking exception for employees or teams marked *do not track*. It then selects the first matching Location, gives a matching Deny Rule priority over an Allow Rule, and evaluates Field Assignments only after the organization rules allow a mobile punch.

```mermaid
flowchart TD
    X{"Device Tracking for an employee or team marked do not track?"}
    A["Protected request"] --> B["Find the first Location whose parameters all match"]
    X -- Yes --> R
    X -- No --> A
    B --> C{"Location found?"}
    C -- No --> D{"Which action?"}
    C -- Yes --> E{"Deny Rule covers the Location, action, and team?"}
    E -- Yes --> D
    E -- No --> F{"Allow Rule covers the Location, action, and team?"}
    F -- No --> D
    F -- Yes --> G{"Mobile Punch In/Out?"}
    G -- Yes --> H{"Enforced Field Assignment for this action?"}
    H -- No --> I["Allow punch; record matched Location"]
    H -- Yes --> J{"GPS supplied and inside any enforced assigned site?"}
    J -- Yes --> I
    J -- No --> K["Refuse punch"]
    G -- No --> L{"Which allowed action?"}
    L -- Portal Access --> M["Allow portal access"]
    L -- Punch In/Out --> I
    L -- Device Tracking --> O["Accept tracking upload"]
    D -- Portal Access --> P["Refuse sign-in"]
    D -- Punch In/Out --> Q["Refuse punch; do not record it"]
    D -- Device Tracking --> R["Refuse upload; agent retries later"]
```

In summary, a tracking exception blocks Device Tracking before GeoFencing runs. Every other protected request is denied unless its first matching Location has an applicable Allow Rule and no applicable Deny Rule; an allowed mobile punch may then need to satisfy an enforced Field Assignment.

### How a request is decided

Every protected request goes through the same review:

1. **Find the Location.** Walk the Locations in order and take the first one whose parameters all match the request's IP address, country, and (for mobile punches) GPS position. If no Location matches, the request is **denied**.
2. **Check Deny Rules.** If any Deny Rule for that Location covers the action and applies to the employee's team, the request is **denied**. Deny always beats allow.
3. **Check Allow Rules.** If an Allow Rule for that Location covers the action and applies to the employee's team, the request is **allowed**. Otherwise it is **denied**.

So after a Location matches, the model is *deny unless allowed*. A Location with no Allow Rule for an action blocks that action for everyone arriving through it.

**Team scoping.** A rule with teams applies to employees whose team is one of those teams or sits underneath one of them. An employee belongs to exactly one team. A team move takes effect in the rules within about five minutes.

**Countries.** If the country of an IP address cannot be determined, the country check is skipped and the other parameters decide. Countries therefore restrict but never lock out on their own.

### Worked examples

**Office-only tracking, portal from anywhere.** Location *Head Office* with the office CIDR range. Allow Rule on *Head Office* for **Punch In/Out** and **Device Tracking**. Allow Rule on *Default* for **Portal Access** only. Employees at the office are tracked and can punch; from home they can open the portal but the agent's data is refused until they connect through the office VPN.

**Block one team from working abroad.** Location *Overseas* with every country except your own, placed above Default. Deny Rule on *Overseas* for **Punch In/Out** and **Device Tracking** applied to team *Finance*. Everyone else keeps the Allow Rule on Default; Finance cannot punch or be tracked from those countries.

**Client site for field staff.** Location *Client Site* with a geofence of 150 m around the site and no other parameters, placed above Default. Allow Rule on *Client Site* for **Punch In/Out**. A field employee standing at the site punches in through the mobile app and the punch is recorded against *Client Site*. Note that a phone outside the circle does not match *Client Site*; it falls through to Default, so the rules on Default decide whether that punch is allowed. To make the site mandatory for a particular person, use a Field Assignment (below).

***

## What the rules control

| Action              | What is checked                                                                   | What happens on deny                                                                                                                                                                                       |
| ------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Portal Access**   | Sign-in and API access to the web portal                                          | The sign-in is refused with a message that the portal cannot be accessed from the current location, showing the request IP.                                                                                |
| **Punch In/Out**    | Punch-in and punch-out from the mobile app, the desktop agent, and manual punches | The punch is refused and not recorded. The message asks the employee to connect from a company-approved network or VPN and shows the request IP.                                                           |
| **Device Tracking** | Each batch of activity data the desktop agent uploads                             | The upload is refused. The agent keeps the data locally and retries, so activity recorded on a blocked network **arrives later** once the computer is back on an allowed network. It is delayed, not lost. |

On every allowed request, the matched Location is recorded against the punch or presence record, so reports can show where each punch came from.

{% hint style="info" %}
GeoFencing validates actions that an employee or agent initiates. It does not punch employees in or out automatically when they enter or leave an area, and it does not send alerts when someone is outside a geofence. Server-initiated actions such as [Auto Punch-Out](https://docs.we360.ai/reference/work-and-time-management/user-interfaces/portal/settings-center/workplace.md) are not subject to the rules.
{% endhint %}

***

## Desktop agent behaviour

The desktop agent has no knowledge of your Locations or rules and shows no location-related messages. Everything is decided by the service when the agent connects:

* The service matches the **public IP address** the agent's traffic arrives from. Employees behind the same office router share one address, so a single CIDR range covers everyone there, and IP rules cannot tell two people in the same office apart. Use team-scoped rules for that.
* Desktop tracking is matched by **network and country only**. A Location whose only parameter is a geofence never matches desktop tracking.
* Blocked uploads are retried automatically. Working offline or on a blocked network delays the data until the next allowed connection.
* A corporate VPN that exits through an allowed range is the standard way to let remote employees be tracked.

***

## Mobile app behaviour

A mobile punch passes through two checks, in order:

1. **The organization's rules** described above, with the phone's GPS position included so a geofenced Location can match.
2. **Field Assignments**, if the employee has any with enforcement switched on.

### How a GPS position is checked

The phone's reported position is compared with the geofence centre using the real distance over the earth. The position's reported **accuracy** is subtracted first, so a fix reported as accurate to within 50 m may be up to 50 m outside the circle and still count. There is no upper limit on accuracy, so a very rough fix is treated generously. A position of exactly 0, 0 is treated as no fix.

Only the phone's own GPS fix counts. A position estimated from the IP address never satisfies a geofence.

### Field Assignments

A **Field Assignment** links a field employee to a Location that has a geofence, with two switches: **enforce punch-in** and **enforce punch-out**. When at least one of an employee's assignments enforces an action:

* The mobile app must supply a GPS position. Without one, the punch is refused: *Your device location is required to punch in from an assigned site. Please enable location services and try again.*
* The position must be inside **any one** of the employee's enforced sites. Otherwise the punch is refused: *You can only punch in from one of your assigned sites: Site A, Site B.*

Field Assignments narrow the organization's rules; they never override a deny. Desktop agents ignore them, because they are a mobile concept. Employees with no enforced assignment can punch from anywhere the rules allow. An assignment cannot enforce a site that has no geofence, and if the geofence is later removed from the site, enforcement for that site stops. Field Assignments are managed by your We360.ai account team until the portal screen for them is released.

### Employees without GPS

* Under the organization's rules, a phone that sends no position simply does not match any geofenced Location and falls through to the next Location, usually Default, whose rules then apply.
* Under an enforced Field Assignment, the punch is refused until location services are enabled.

***

## GeoFencing and Field Tracking

These are separate features that share the same map:

|             | GeoFencing                                              | [Field Tracking](https://docs.we360.ai/reference/work-and-time-management/product/workforce-productivity/field-tracking.md) |
| ----------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Purpose** | Decide whether an action is allowed                     | Show where field employees went                                                                                             |
| **Input**   | Locations and rules                                     | Location pings from the mobile app and desktop agent                                                                        |
| **Effect**  | Blocks or permits portal access, punches, tracking data | Nothing is blocked                                                                                                          |
| **Where**   | Settings                                                | The **Field** page: live view, routes, distance travelled                                                                   |

Distance travelled on the Field page is measured from location pings and is unrelated to any geofence.

***

## Interaction with other features

* **Tracking exceptions.** An employee or team marked *do not track* is refused before the location review runs. GeoFencing never re-enables tracking for them.
* **Auto Punch-Out.** Server-initiated punch-outs bypass the rules, so an employee who cannot punch out from a blocked location is still punched out by the timer.
* **Manual Time.** Manual time entries are not location-reviewed, and are recorded without a Location.
* **Cross-Day Working Time.** No interaction, except that a punch-out at the end of an overnight shift is still subject to the Punch In/Out rules.
* **Domain Blocking** sits in the same Compliance & Security section but is unrelated.

***

## Propagation and limits

| Item                              | Value                                                 |
| --------------------------------- | ----------------------------------------------------- |
| Maximum Locations                 | 5, including Default                                  |
| Maximum rules                     | 5 Deny Rules and 5 Allow Rules                        |
| Geofence radius                   | 25 m to 50 km, default 200 m                          |
| Team change reflected in rules    | Within about 5 minutes                                |
| Location or rule change reflected | Usually immediate; up to 20 minutes in the worst case |

***

## Troubleshooting

<details>

<summary>Everyone is locked out after saving rules</summary>

Check the Allow Rules on **Default**. Requests that match no other Location land on Default, and after a Location matches an action is denied unless an Allow Rule permits it. Restore an Allow Rule on Default for the actions you need, then narrow from there.

</details>

<details>

<summary>The agent stopped sending data from the office</summary>

The office's public IP address is probably not in the Location's CIDR range, or the Location sits below a broader one that matched first. Compare the request IP shown in the error with the ranges, and check the order on **GeoFencing Locations**. Data recorded meanwhile arrives once the network is allowed.

</details>

<details>

<summary>A geofenced Location never matches</summary>

Only mobile punches carry a GPS fix. Desktop agents and tracking data match by network and country only. Also confirm that geofencing is included in your plan; without it, geofence parameters are ignored and only CIDR ranges and countries are evaluated.

</details>

<details>

<summary>A remote employee needs to be tracked</summary>

Route them through a company VPN whose exit address is inside an allowed range, or add an Allow Rule for **Device Tracking** on Default for their team.

</details>

***

## Related

* [Field Tracking](https://docs.we360.ai/reference/work-and-time-management/product/workforce-productivity/field-tracking.md) — live location and routes for field employees.
* [Compliance & Security settings](https://docs.we360.ai/reference/work-and-time-management/user-interfaces/portal/settings-center/compliance-security.md) — the rest of the Compliance & Security section.
* [Attendance](https://docs.we360.ai/reference/work-and-time-management/product/work-and-time-management/attendance.md) — how punches feed attendance.
* [Workplace Settings](https://docs.we360.ai/reference/work-and-time-management/user-interfaces/portal/settings-center/workplace.md) — Auto Punch-Out and Cross-Day Working Time.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.we360.ai/reference/work-and-time-management/product/workforce-productivity/geofencing-and-controls.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
