Prepare the sandbox
- Use an online Resource Gateway that can reach
www.googleapis.com:443. - Use an approved test app and a dedicated test Drive account. Request a
short-lived Google OAuth access token with the
https://www.googleapis.com/auth/drive.filescope. Drive API scopes - Create two synthetic files through that app and copy their file IDs. Use the same app and account for the rest of the test.
Configure the Resource and credential
- Open Policies → Resources and choose New resource.
- Name the Resource
Google Drive API sandbox. Choose HTTP, set the host towww.googleapis.comand the port to443, then turn on Use HTTPS. - Assign the Resource Gateway and save. Leave Automatic routing off for the first run.
- Open Credentials and add a Bearer token with the Google access token. Expand Credential assignment, select the test user, and leave Use for everyone else off.
- Run Test connection. Verify access to the Drive files with the requests below.
Block one file read
Run both requests in Verify direct access before you create the policy. Both requests should return200 with the corresponding
file IDs.
- Choose New policy → Resource policy and name it
Block sandbox Drive file. - Scope the policy to
Google Drive API sandbox. - Set Condition type to Match all and add both conditions.
- HTTP method equals
GET. - HTTP path equals
/drive/v3/files/BLOCKED_FILE_ID. ReplaceBLOCKED_FILE_IDwith the second file’s ID.
- HTTP method equals
- Set the action to Block and the user message to
This sandbox Drive file is blocked. - Set enforcement to Enforce, enable the policy, and save.
Verify direct access
Open Connect directly on the Resource page. Download the trust certificate and select Generate access. Substitute your gateway hostname and file IDs in the commands. Enter the short-lived Forge token when prompted.200 with the synthetic file’s ID and name. The
second returns 403 with the Forge policy ID and the message you set. In
Live → Resources, filter to Google Drive API sandbox and check the
caller, path, and Allow and Block outcomes. Drive files.get · Resource Activity
Verify automatic routing and MCP
For a test device that already has active automatic routing and trusts the organization inspection CA, turn on Automatic routing for the Resource. Repeat the same two GET requests in fresh connections tohttps://www.googleapis.com using the device’s managed identity. Omit the
Proxy-Authorization header. Check the same outcomes and the device in
Live → Resources.
The device route matches the hostname. www.googleapis.com also hosts other
Google APIs, so use a dedicated test device for this check.
To test both interfaces, use an approved Drive MCP tool that reads file metadata.
Route the MCP server’s outbound Drive calls through this Resource Gateway under
an assigned identity. Then check both synthetic file IDs through the tool and
through direct HTTPS from the test device. Verify that both interfaces can read
the allowed file and that Forge blocks both reads of the restricted file.
In Live → Resources, check all four operations. Confirm the caller identity
on each path and the policy name on both blocked reads. Send a request from the
same device to an unrelated approved destination. Confirm that it still succeeds.