> For the complete documentation index, see [llms.txt](https://docs.stoik.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoik.io/email-security/google-workspace.md).

# Setup: Google Workspace

Connect your Google Workspace tenant so Email Security can analyze your mailboxes.

## Prerequisites

* A **Google Workspace Admin** account.
* Google Chrome. Safari cannot be used.
* Stoïk Protect and the Google Admin Console open in two tabs of the **same browser window**.

## Connect your tenant

{% stepper %}
{% step %}

### Sign in with your admin account

1. In Stoïk Protect, go to `Email Security`.
2. Select Google Workspace and click `Connect your mailbox`.
3. Sign in with your Google Workspace Admin account.

{% hint style="info" %}
If you get an `Access blocked` / `Error 400: access_not_configured` screen instead of the Google sign-in prompt, see [Error 400: access\_not\_configured](/human-security/phishing/setup-errors.md#error-400-access_not_configured) for the fix. The same restrictive app-authorization policy blocks both the Phishing module and Email Security.
{% endhint %}
{% endstep %}

{% step %}

### Authorize Stoïk in the Google Admin Console

1. Open [Domain-wide delegation](https://admin.google.com/ac/owl/domainwidedelegation) in the Google Admin Console.
2. Click `Add new`.
3. Enter the Client ID `108893255833546679906` and the OAuth scopes below. See [Required permissions](/email-security/google-workspace/permissions.md) for what each one is used for.

   ```
   https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/gmail.modify,https://www.googleapis.com/auth/gmail.insert,https://www.googleapis.com/auth/gmail.metadata,https://www.googleapis.com/auth/gmail.settings.basic,https://www.googleapis.com/auth/admin.directory.user.readonly,https://www.googleapis.com/auth/admin.reports.audit.readonly,https://www.googleapis.com/auth/apps.alerts,https://www.googleapis.com/auth/admin.directory.customer.readonly,https://www.googleapis.com/auth/gmail.settings.sharing,https://www.googleapis.com/auth/admin.directory.device.mobile.readonly
   ```
4. Click `Authorize`.
   {% endstep %}

{% step %}

### Confirm

In Stoïk Protect, click `Confirm` to verify the configuration. Your Google tenant is connected.
{% endstep %}
{% endstepper %}

## After the connection

* Monitored mailboxes appear in `Email Security` > `Mailboxes`. See [Mailbox statuses](/email-security/mailbox-statuses.md).
* Stoïk retrieves the emails of the past 90 days for all monitored mailboxes, starting with the oldest. This can take some time.

To connect another tenant (Microsoft 365 or Google Workspace), go to `Email Security` > `Settings`, click `Add a provider` and follow the same steps. You can connect as many tenants as you need.

{% hint style="info" %}
If the users list doesn't show up more than 10 minutes after synchronization, contact <protect@stoik.io>.
{% endhint %}


---

# 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.stoik.io/email-security/google-workspace.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.
