
Argent with Google Gemini
Put Argent in front of the Gemini Developer API. Argent holds the Gemini key, reads the model from the URL, applies your model rules, redacts sensitive data, enforces budgets and signs a record of every call.
What Argent does with Google Gemini
Argent governs every call your agents make to the Gemini Developer API, `generativelanguage.googleapis.com`.
- Model read from the URL: Gemini names the model in the path, not the body, so Argent reads it there. Without that, a model rule could be skipped.
- Generate and embed: content generation, streaming generation and embeddings.
- Approved models, swap and classes: the same approved list, Model Swap and model classes as every other provider.
- Sensitive data and budgets: redaction on the Gemini request format, and every call priced and held against a budget.
- Gemini CLI: tested end to end through Argent's TLS-inspecting proxy.
How it connects
One endpoint, one key in your vault, and every agent points at Argent instead of Gemini.
- Add the endpoint once. On the AI Providers page, one action creates the Gemini endpoint with its credential. The Gemini API key is written to your vault and Argent keeps only the vault reference.
- Register each agent with an owner. Every agent or app gets its own Argent key and a named human owner. Its Connect tab shows copy-paste setup and a VERIFY CONNECTION check.
- Point it at Argent. The agent's base URL becomes its route on the Argent gateway,
/<tenant>/<endpoint>/, and the Argent key takes the place of the Gemini API key. - The gateway swaps keys on the way out. It removes the agent's Argent key, fetches the Gemini API key from your vault and attaches it at egress, after checking Gemini's certificate.
- Rotate in your vault. Every gateway replica drops the cached key, and no agent changes.
Your vault can be HashiCorp Vault or OpenBao, AWS Secrets Manager, CyberArk Conjur or Infisical. The agent never holds the Gemini API key, so a leaked agent key is useless anywhere but Argent, and you can switch it off in one place. See Keyless Agents.
Lock the key to Argent
The Gemini key now lives in one place, so you can restrict it tightly on the Google side.
Argent's Google setup guide walks your Google admin through restricting the key Argent holds, so it can do as little as Google allows. Argent decides, swaps, redacts and records; your Google organization policies are the force behind it. See the Google Cloud coverage page.
What you configure
Everything below is set once in the Argent console and applies to every agent that calls Gemini through the gateway.
| Setting | Where | What it does |
|---|---|---|
| Approved models | Policy > Model and endpoint access | Default deny: a call is allowed only when the model is on the approved list. The list is platform AND tenant AND agent, and each layer can only narrow the one above. |
| Access rules | Same page | Allow or deny by provider, route type, model, hosted tools, function tools and output type, for the tenant, a department, a person or one agent. The narrowest rule wins, and a 7-day impact preview shows what a draft would change. |
| Model Swap | Model Swap picker | Runs an approved model in place of the one the agent asked for, including when a budget runs low, with no change to agent code. |
| Model classes | Policy > Model classes | A name such as fast stands for an ordered list of approved models, with failover on connection errors, 5xx, 429, timeouts and retired models. |
| Sensitive data | DLP | Per entity type: redact and record, record only, or block the request. |
| Budgets and caps | Budgets | Budgets for the company, org, department, person and agent. Each request is priced and held against the budget before it leaves, and an emergency cap stops a runaway agent now. |
| Mode | Per control | Off, watch or enforce. Watch records what would have been refused and changes nothing on the wire. |
Start in watch, read what would have been refused, then switch on enforce. See Watch Before You Enforce.
One request, step by step
What happens between your agent and Gemini, in order.
- The agent sends its request to its Argent route, carrying its own Argent key and nothing from Gemini.
- Who is calling. Argent identifies the agent from its key and checks it may use this endpoint. The endpoint comes from the route the gateway matched, never from a header the caller sets.
- Which model. Argent reads the model from the URL path and checks it against the approved list and access rules before anything leaves.
- Swap or class. If a Model Swap rule or a model class applies, an approved model runs instead, and Argent translates the request and reply between provider formats where needed.
- Sensitive data. The request is scanned by a reader that knows the Gemini format, and secrets and personal data are redacted, recorded or blocked under your policy. If the scan cannot run, the request is refused, never passed as clean.
- Budget. The request is priced and the amount is held against the agent's budget, so parallel calls cannot overshoot it.
- Key. The gateway attaches the provider key from your vault at egress.
- Reply and record. Token usage is read from the reply, the cost is settled, and the signed record is written.
What the record shows
Every Gemini call leaves one signed record, allowed or refused.
- One row per call: the agent and the person who owns it, the tenant, the model, the decision and the policy that made it, latency, and the cost, token and cache figures.
- Tamper-evident: each row is hash-chained to the one before and signed with an ed25519 key held in Vault Transit, so an edited or missing row shows.
- Real cost: cost comes from the usage block in Gemini's own reply, priced from your price book in USD per million tokens.
- No unpriced spend: an agent under a budget that calls a model with no price is refused, so a new model cannot slip past a cap.
Conversations can be opened and replayed from the record. See Session Replay and One-Click Audit Evidence.
Related capabilities and goals
Where to go next.
- Capabilities: Model Control, Sensitive Data Redaction, AI Spend Caps, Keyless Agents.
- Goals: Model control and routing, Budget and token spend, Data loss prevention.
- Works with: Gemini CLI, Google GenAI SDK, Google Cloud coverage, OpenAI.
- Everything else Argent connects to: All integrations.
Download files
- PDFArgent Model Control data sheetApproved models, Model Swap, model classes and failover. One page.
- PDFArgent Keyless Agents data sheetProvider keys stay in your vault; agents carry only their own Argent key. One page.
- PDFArgent Sensitive Data Redaction data sheetPersonal data and secrets found and redacted before a prompt leaves. One page.
Want this running on your own use cases?
All downloads