Give each AI agent its own API key (and keep your real one)
Give each agent a separate key with only the calls it needs. Keep your real upstream key on the server, so you can revoke one agent without changing every other app.
The problem
You paste one database admin key into Cursor, Claude Code, an MCP server or a Lovable app. Every agent holding it can use all its permissions. If that key leaks into a prompt, a browser bundle or a log, removing it from one app does not remove the other copies. These are places people paste keys, not named Gate integrations.
The fix without Gate
Create a separate credential for each app at your API or database provider. Grant the fewest permissions each one needs, keep privileged credentials in a backend secret store, and check authorization on the server. Never ship an admin key in browser code. Rotate a leaked key at its source and replace it wherever it was used. Separate keys let you stop one app while the others keep working.
The fix with Gate
Run this setup from your trusted backend or terminal. In the project JSON below, replace the example upstream URL and REPLACE_WITH_UPSTREAM_KEY privately before use; this example assumes your API expects a Bearer authorization header. Gate encrypts that upstream secret with AES-GCM and adds it when forwarding allowed calls. Do not give it to the agent.
curl -X POST https://gate.odilelabs.com/api/projects \
-H 'content-type: application/json' \
-d '{"name":"My API","upstream":"https://api.example.com","header_name":"Authorization","header_value":"Bearer REPLACE_WITH_UPSTREAM_KEY"}'
Keep the returned admin_key with your backend, available here as $ADMIN, and set $PROJECT to project_id. The admin key is shown once. It can create and revoke apps, so it must stay outside the agent's context.
curl -X POST "https://gate.odilelabs.com/api/projects/$PROJECT/apps" \
-H "Authorization: Bearer $ADMIN" -H 'content-type: application/json' \
-d '{"name":"reporting-agent","routes":["GET /orders/:id"],"per_minute":60}'
Save app.id as $APP_ID on your backend and the returned key as $APP_KEY. Repeat registration for each agent with its own name and allowed calls. Give each agent only its app key and gateway URL. This reporting agent may read orders; its key does not allow deleting or creating them.
curl "https://gate.odilelabs.com/g/$PROJECT/orders/42" \ -H "Authorization: Bearer $APP_KEY"
Gate checks the app key and route, then replaces the agent's authorization with your configured upstream secret. To stop this agent, revoke its app using the admin key. Other app keys stay active:
curl -X POST "https://gate.odilelabs.com/api/projects/$PROJECT/apps/$APP_ID/revoke" \ -H "Authorization: Bearer $ADMIN"
Gate protects only calls routed through it. Remove any direct upstream credentials the agent already holds, rotate them if exposed, and keep your API's ownership checks. A rule such as GET /orders/:id allows any order id; use per-user rules when a person must see only their own data.
Free for 3 apps and 10,000 calls a month.
Other guides
Read only the signed-in user's data · See every agent call · Stop wrong-customer changes · Approve one exact action · Avoid duplicate writes.