Originally published on the RelayShield blog.
Your Gemini CLI agent can now sit behind the RelayShield Firewall
Agent payments stopped being a demo last week. On November 17, Google made Gemini Tasks free for hundreds of millions of people, and Gemini now pays through AP2 on Visa and Mastercard network tokens. The same week, ChatGPT Wallet launched with Proof x401. Agents are now spending real money at real checkouts, and the question is no longer whether an agent can pay. It is whether anything checks the payment before it goes through.
Why MCP servers need a firewall
MCP gives an agent a way to call tools on a server: read a file, check a link, send a payment. The agent trusts the server. It takes the tool list the server advertises, and it acts on the results the server returns. That trust is the vulnerability.
A server can advertise a tool that does something different from what its description says. A tool result can carry instructions that were not in the user's request, and the agent follows them because it treats tool output as data to act on. This is prompt injection through the tool channel, and it is how a compromised or malicious server gets an agent to exfiltrate data, approve a payment, or call another tool the user never asked for. A server can also change after the agent connects: a benign server can be updated to a malicious one, and the agent has no way to tell, because MCP has no built-in verification of the server or its tools.
The agent cannot fix this on its own. It has no independent way to check whether a tool description is honest, whether a result is clean, or whether the server it connected to yesterday is the same one today. The check has to sit between the agent and the server, on every call and every result. That is what a firewall does: it screens the tool list, the call, and the result at the gate, blocks or flags what fails, and records what happened so the attempt is visible. The protocol does not provide that enforcement. The firewall is the enforcement.
That check has two halves. AP2 proves the agent is authorized to spend. RelayShield proves the counterparty is legitimate. A signed AP2 mandate for a spoofed storefront is still a signed mandate, so the mandate alone does not make the payee safe. The Firewall is the enforcement for the second half: it screens every tool call at the gate, and the agent cannot skip it.
This post is a guide for connecting Gemini CLI to the RelayShield MCP Proxy Firewall, and it is honest about what was proved and what was not. The connection config is verified against the official Gemini CLI MCP docs. The Firewall path was proved live on November 22 against a real tenant: a direct check_link call through the tenant URL returned the verdict, and the Audit Trail shows the entry. The steps below are the ones to run, and the live test is the one already done.
One scope note first. Gemini Tasks users in the Gemini app cannot add an MCP server, so this guide is not for them. The audience is developers using Gemini CLI, and by the same config, ADK and Gemini Enterprise agents that accept a remote MCP server. That is a smaller audience than the hundreds of millions of Tasks consumers, and it is the audience that can actually connect today.
The idea
Your Gemini CLI agent talks to MCP servers. The Firewall sits in front of them and screens every tool call. Connect Gemini CLI to the Firewall URL as its MCP server, and you get both at once: the free scam checks, because the Firewall fronts the free RelayShield scam-checks server, and the enforcement, because the Firewall screens every tool call before it reaches the server. One URL, the checks plus the enforcement. It is the same pattern as the Lindy guide, which is verified live.
If you do not have a Firewall tenant yet, start with the free route. The free scam-checks server is available as a Gemini CLI extension with no signup and no token. Start here when you want enforcement on top of the checks.
Connect it
You need a provisioned RelayShield Firewall tenant. Your Firewall MCP URL is https://.proxy.relayshield.net/mcp, and your proxy token is in Secrets Manager at relayshield/hosted/ (JSON, proxy_token key) and in the welcome email. The console does not show the token.
Gemini CLI connects to a remote MCP server over Streamable HTTP with the httpUrl key, and it accepts custom headers. Put the token in a .env file, not in settings.json, so it never lands in a shared config or a screenshot.
Step 1, save the token where Gemini CLI reads it:
# ~/.gemini/.env
RS_PROXY_TOKEN=<your proxy token from Secrets Manager>
Step 2, add the Firewall as an MCP server:
// ~/.gemini/settings.json
{
"mcpServers": {
"relayshield-firewall": {
"httpUrl": "https://<tenant-id>.proxy.relayshield.net/mcp",
"headers": {
"Authorization": "Bearer ${RS_PROXY_TOKEN}"
},
"timeout": 30000
}
}
}
Replace with your tenant id, and keep the /mcp path: it is the MCP endpoint. Restart Gemini CLI after changing settings.
There is a command-line alternative with the same result, gemini mcp add --transport http, but it puts the token in shell history, so the settings.json plus .env form is the better one.
Why settings.json and not a gallery extension: a Gemini CLI extension manifest is a static public file, and the Firewall URL and token are per tenant. There is no single public extension that can carry every tenant's token. The free scam-checks server, which needs no token, is the one that fits the extension route.
Test it
Start Gemini CLI and list MCP servers with /mcp list. You should see relayshield-firewall as Ready, with the upstream tools listed (check_link, check_wallet, check_email, and any other tools your Firewall fronts).
Ask Gemini CLI to check a link, for example: "Check https://google.com with RelayShield." It should call check_link through the Firewall and return the verdict (unknown for google.com: not in the threat-intelligence corpus, no threat feeds flagged it).
Verify the screened call in the Audit Trail, which now pulls live proxy entries. Look for your check_link entry with the verdict attached. Then ask the agent to check a known-bad link. The Firewall should flag or block it according to your Policy 1 mode.
If the tools do not arrive, check the proxy token first: a wrong or expired token is the most likely cause. If a call is blocked and you did not expect it, check Policy 1 mode in the console. If Gemini CLI reports the server as not ready, confirm the URL ends in /mcp and the token expanded from the .env file.
What it costs
The signature solution is the MCP Proxy Firewall plus Agent Verifiers license at $109 a month. It is the surface the AP2 verifier was developed for: the Firewall screens every tool call at the gate, and the verifiers prove the spend is authorized and the counterparty is legitimate. The extra $60 a month over the Firewall alone buys the TAP Verifier, PAP, Passport identity, intent binding, the settle check, and 100 free verifications a month, plus Threat corpus screening, on top of the Firewall's 20,000 screened calls included, $0.002 per call over that. Bought separately the Firewall is $49 a month and the Agent Verifiers Bundle is $79 a month, $128 together, so the $109 bundle saves $19. The $49 Firewall alone is the entry point: self-serve through Stripe, provisioning creates your tenant URL and token, and the free scam checks come along as the upstream, so you are not paying extra for them.
The spend-authorization half
Screening the payee is one half. Proving the agent is authorized to spend is the other, and that half is now verified too. The RelayShield AP2 mandate verifier was verified live on November 23 against a real, independently minted v0.2 mandate from the official AP2 SDK: signature, checkout hash binding, scope, validity window, receipt matching, and replay protection all passed. The verifier is bundled into the Agent Verifiers bundle, so the Firewall screen and the mandate check are available together for a seller agent that buys supplies: the mandate proves the spend is authorized, the counterparty screen proves the payee is legitimate, and intent binding proves the call matches what the owner approved.
What this does not do
It does not patch vulnerable MCP servers. The Firewall catches the attempt at the gate; upgrading the server is still the fix. It does not reach Gemini Tasks consumers in the Gemini app, who cannot add an MCP server. And it does not claim a Gemini CLI session has already run this end to end in front of a user: the path is proved through the live tenant test, and the in-session run is the next proof to add.
Where to start
If you run a Gemini CLI agent that touches money, links, or wallets, put it behind the Firewall and see what it flags. The free extension gives you the checks with no signup. The Firewall adds the enforcement, the audit trail, and the policies that decide what gets through.
Top comments (0)