How Gateway works
Understand what Gateway checks, when it flags or blocks a request, and how to investigate agent activity.
Page text and source link for your AI assistant. Nothing is sent automatically.
Gateway checks supported MCP requests routed through it. Start with a connection, then review policy behavior and request history.
Choose a guide
- Connect a server to Gateway
- Understand Gateway policy decisions
- Require approval for risky tool calls
- Investigate requests and recover access
- Connect member accounts and MCP capabilities
Update keys from StackHangar
If you manage a server's key in StackHangar, you can let StackHangar replace the key stored in Gateway whenever you rotate it there. You don't copy the new key into Foo Guard by hand, and your agents keep working.
Who can set it up. A workspace owner or administrator, for a Team server (Team plan). On a Personal connection, the account owner (Pro plan). Members can't create tokens. Team workspaces that require company sign-in need you signed in that way too.
Create a token. Open the server in Gateway → Setup (Team) or the connection under Gateway (Personal), and open Let StackHangar update this key. Pick an expiry date (it starts at 90 days and can be at most one year away) and select Create token. Copy three things into StackHangar: the slot id, the kind, and the token. The token is shown once. If you lose it, revoke it and create another. A server or connection can have up to three live tokens at a time. A token can only replace the key for the one server or connection it was made for, and it can do nothing else. Treat it like a password.
What happens on a replace. Gateway tests the new key against your server before it changes anything. If the test passes, the new key takes over and the old one stops being used. The tools your agents can use, your policy, and the mode stay as they were. If the test fails, the old key stays in place and your agents are not affected. When a key is replaced, the server shows "Key replaced by StackHangar" for 30 days, the change is added to the audit log, and, if you turned it on under Gateway → Alerts, a webhook is sent.
What StackHangar may report.
- *The key was rejected* (a 400 or 422 status): your server refused the new key. The old key is still in use.
- *The token is no good* (401): it is wrong, expired or revoked. Create a new one.
- *Not allowed* (403): your plan has lapsed, or the request didn't come from StackHangar.
- *Not found* (404): the server or connection was disconnected, removed, or isn't the one the token was made for.
- *The tools look different* (409): with the new key, your server offers different tools than Gateway has on record. Nothing changed. Review the server in Gateway, then try again.
- *Too many tries* (429): wait a while and push again.
- *Couldn't test the key* (502): Gateway couldn't reach your server. Nothing changed.
Revoke a token. In the same panel, select Revoke next to the token and confirm. StackHangar can no longer update the key with it. Revoking works even if your plan has lapsed.
What ends a token. A token also ends by itself when you disconnect or remove the server or connection, turn it off, switch the server to member accounts, remove its key, or change its address. Create a new token if you set it up again.
Not supported. Servers set to member accounts (each member connects their own account) have no shared key, so they can't use this. Servers without a stored key can't either.