Skip to main content

Agent Key Binding

Keys can be scoped to specific agents so that each agent only has access to the keys it needs. Bindings are created automatically during interception or manually through the dashboard.

Key Concepts

What is agent key binding?

Agent key binding means that a specific API key is assigned to a specific agent. When that agent makes an AI call, Clevername uses the bound key — not your default key, and not any other agent's key. This is scope isolation: Agent B cannot use Agent A's keys, even if both agents belong to the same user.

Why it matters

  • Least privilege — each agent only accesses the keys it needs
  • Cost isolation — track spend per agent by using separate provider keys
  • Blast radius — if a key is compromised, only the bound agent is affected
  • Compliance — auditors can verify exactly which key was used by which agent

How binding resolution works

When an agent needs a provider key, Clevername checks in this order:

  1. Is there a key explicitly bound to this agent for this provider? Use it.
  2. Is there a default key for this provider on the user's account? Use it.
  3. No key found — the request fails with a clear error.

Explicit bindings always take priority over default keys. This means you can set a default OpenAI key for general use, but bind a specific OpenAI key to a high-traffic agent for separate billing.

How Bindings Are Created
1

Automatic binding during interception

When a key is intercepted in an agent's session, the key is automatically bound to that agent. For example, if Agent A's session contains a pasted OpenAI key and you choose to store it, the key is saved and bound to Agent A in a single step.

Tip
Automatic binding only happens when the key is intercepted in the context of a specific agent session. Keys intercepted in general chat (not tied to an agent) are stored as default keys with no agent binding.
2

Manual binding from the dashboard

Go to Dashboard → AI Company → [Agent] → Settings → Key Bindings. Select a provider and choose which stored key to assign. You can also create a new binding from the API Keys settings page by selecting an agent from the binding dropdown.

3

Binding via MCP tools or API

For automation, use the MCP gateway tools or the REST API to manage bindings programmatically. This is useful for provisioning agents at scale — for example, binding a dedicated key to each agent in a department.

Managing Bindings

You can view, modify, and revoke bindings from the dashboard or the API.

ActionDashboardAPI / MCP
List bindingsAgent Settings > Key Bindings tabGET /hub/agent-bindings/{agent_id}
Create bindingAgent Settings > Key Bindings > AddPOST /hub/agent-bindings
Revoke bindingClick the revoke icon next to the bindingDELETE /hub/agent-bindings/{binding_id}
Reassign keyRevoke the old binding and create a new onePUT /hub/agent-bindings/{binding_id}

Bindings and the Agent Review

When an agent goes through review approval, its key bindings are captured as part of the integration bindings fingerprint. This means:

  • Changing an agent's key bindings after approval triggers drift detection. The agent must be re-reviewed before redeployment.
  • Reviewers can see which keys are bound during the review process, giving them visibility into what resources the agent will access.
  • Revoking a binding on an active, review-approved agent puts it into a resubmit_required state.
Important
If you need to rotate a key for a review-approved agent, rotate the key itself (same Secret Manager slot) rather than creating a new binding. Key rotation within the same slot does not change the bindings fingerprint and does not trigger drift detection.