> ## Documentation Index
> Fetch the complete documentation index at: https://keyring.docs.composio.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How Keyring works with Composio

> Follow a tool call through Composio, your Keyring, your KMS, and the provider.

export const RequestTraceDiagram = () => <figure className="keyring-diagram simple-request-flow tool-call-flow">
    <div className="simple-request-flow__stage" role="img" aria-label="An agent makes a Gmail tool call to Composio. Composio resolves the provider endpoint and attaches the sealed credential envelope from its database. Inside Keyring, your KMS unseals the token, the authorized request reaches Gmail, and a credential-free response returns through Composio to the agent.">
      <div className="tool-call-flow__segment tool-call-flow__segment--one" aria-hidden="true" />
      <div className="tool-call-flow__segment tool-call-flow__segment--two" aria-hidden="true" />
      <div className="tool-call-flow__segment tool-call-flow__segment--three" aria-hidden="true" />

      <div className="simple-request-flow__nodes tool-call-flow__nodes">
        <div className="simple-request-flow__node tool-call-flow__node--agent">
          <span className="simple-request-flow__node-mark tool-call-flow__node-mark--agent">
            <svg viewBox="0 0 24 24" aria-hidden="true">
              <rect x="3" y="4.5" width="18" height="15" rx="2.4" />
              <path d="m7 10 2.8 2.4L7 14.8" />
              <path d="M12.6 15H17" />
            </svg>
          </span>
          <b>Agent</b>
          <span className="simple-request-flow__node-caption">Your app</span>
        </div>
        <div className="simple-request-flow__node tool-call-flow__node--composio">
          <span className="simple-request-flow__node-mark simple-request-flow__node-mark--composio" aria-hidden="true" />
          <b>Composio</b>
        </div>
        <div className="simple-request-flow__node tool-call-flow__node--keyring">
          <span className="simple-request-flow__node-mark simple-request-flow__node-mark--keyring">
            <svg viewBox="0 0 24 24" aria-hidden="true">
              <path d="M12 3 5 6v5c0 4.5 2.8 7.5 7 9.5 4.2-2 7-5 7-9.5V6L12 3Z" />
              <circle cx="12" cy="11" r="2" />
              <path d="M12 13v3" />
            </svg>
          </span>
          <b>Keyring</b>
          <span className="simple-request-flow__node-caption">Your Cloud</span>
        </div>
        <div className="simple-request-flow__node tool-call-flow__node--gmail">
          <span className="simple-request-flow__node-mark simple-request-flow__node-mark--gmail">
            <svg viewBox="0 0 32 24" aria-hidden="true">
              <path d="M3 21 V6" />
              <path d="M3 6 L16 15 L29 6" />
              <path d="M29 6 V21" />
              <path d="M3 6 L8 9.5" />
            </svg>
          </span>
          <b>Google</b>
        </div>
      </div>

      <div className="simple-request-flow__kms-link tool-call-flow__db-link" aria-hidden="true" />
      <span className="tool-call-flow__db-envelope" aria-hidden="true">
        <svg viewBox="0 0 24 24">
          <rect x="3" y="5.5" width="18" height="13" rx="2" />
          <path d="M4.5 7.5 12 13l7.5-5.5" />
          <circle cx="12" cy="15.4" r="1.4" />
        </svg>
      </span>
      <div className="simple-request-flow__kms tool-call-flow__db">
        <span className="simple-request-flow__node-mark tool-call-flow__node-mark--db">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <ellipse cx="12" cy="6" rx="7" ry="2.7" />
            <path d="M5 6v12c0 1.5 3.1 2.7 7 2.7s7-1.2 7-2.7V6" />
            <path d="M5 12c0 1.5 3.1 2.7 7 2.7s7-1.2 7-2.7" />
          </svg>
        </span>
        <b>Composio DB</b>
        <span className="simple-request-flow__node-caption">Sealed envelopes</span>
      </div>

      <div className="simple-request-flow__kms-link tool-call-flow__kms-link" aria-hidden="true" />
      <div className="simple-request-flow__kms-packet tool-call-flow__kms-packet" aria-hidden="true" />
      <div className="simple-request-flow__kms tool-call-flow__kms">
        <span className="simple-request-flow__node-mark simple-request-flow__node-mark--kms">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <circle cx="7.5" cy="12" r="3.5" />
            <path d="M11 12h10m-3 0v3m-3-3v2" />
          </svg>
        </span>
        <b>KMS</b>
      </div>

      <div className="tool-call-flow__packet" aria-hidden="true">
        <div className="tool-call-flow__payload tool-call-flow__payload--call">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <rect x="3" y="4.5" width="18" height="15" rx="2.4" />
            <path d="m7 10 2.8 2.4L7 14.8" />
            <path d="M12.6 15H17" />
          </svg>
          <span>GMAIL_LIST_EMAILS</span>
        </div>
        <div className="tool-call-flow__payload tool-call-flow__payload--request">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <circle cx="12" cy="12" r="8" />
            <ellipse cx="12" cy="12" rx="3.4" ry="8" />
            <path d="M4 12h16" />
          </svg>
          <span className="tool-call-flow__endpoint" />
          <b className="tool-call-flow__token">
            <span className="tool-call-flow__token-label">Token:</span>
            <span className="tool-call-flow__token-value" />
          </b>
        </div>
        <div className="tool-call-flow__payload tool-call-flow__payload--response">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <circle cx="12" cy="12" r="8" />
            <path d="m8.5 12.2 2.4 2.4 4.6-4.8" />
          </svg>
          <span>23 New Emails</span>
        </div>
      </div>
    </div>
  </figure>;

export const CredentialSetupDiagram = () => <figure className="keyring-diagram simple-request-flow credential-setup-flow">
    <div className="credential-setup-flow__stage simple-request-flow__stage" role="img" aria-label="Your KMS provides a public transfer key that Keyring relays through Composio to the Dashboard. The Dashboard seals the entered credential with it, the sealed credential travels back through Composio to Keyring, your KMS private key opens it inside Keyring, and an encrypted credential envelope returns to Composio, which stores it encrypted in the Composio database.">
      <div className="simple-request-flow__track" aria-hidden="true" />

      <div className="simple-request-flow__nodes">
        <div className="simple-request-flow__node credential-setup-flow__node--dashboard">
          <span className="simple-request-flow__node-mark credential-setup-flow__node-mark--dashboard">
            <svg viewBox="0 0 24 24" aria-hidden="true">
              <rect x="3" y="4.5" width="18" height="15" rx="2.4" />
              <path d="M3 8.6h18" />
              <path d="M6 6.6h.01M8.4 6.6h.01" />
            </svg>
          </span>
          <b>Composio Dashboard</b>
          <span className="simple-request-flow__node-caption">Your browser</span>
        </div>
        <div className="simple-request-flow__node credential-setup-flow__node--composio">
          <span className="simple-request-flow__node-mark simple-request-flow__node-mark--composio" aria-hidden="true" />
          <b>Composio</b>
          <span className="simple-request-flow__node-caption">Ciphertext only</span>
        </div>
        <div className="simple-request-flow__node credential-setup-flow__node--keyring">
          <span className="simple-request-flow__node-mark simple-request-flow__node-mark--keyring">
            <svg viewBox="0 0 24 24" aria-hidden="true">
              <path d="M12 3 5 6v5c0 4.5 2.8 7.5 7 9.5 4.2-2 7-5 7-9.5V6L12 3Z" />
              <circle cx="12" cy="11" r="2" />
              <path d="M12 13v3" />
            </svg>
          </span>
          <b>Keyring</b>
          <span className="simple-request-flow__node-caption">Your Cloud</span>
        </div>
      </div>

      <div className="simple-request-flow__kms-link" aria-hidden="true" />
      <div className="simple-request-flow__kms-packet" aria-hidden="true" />
      <div className="simple-request-flow__kms">
        <span className="simple-request-flow__node-mark simple-request-flow__node-mark--kms">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <circle cx="7.5" cy="12" r="3.5" />
            <path d="M11 12h10m-3 0v3m-3-3v2" />
          </svg>
        </span>
        <b>KMS</b>
      </div>

      <div className="simple-request-flow__kms-link credential-setup-flow__db-link" aria-hidden="true" />
      <div className="simple-request-flow__kms-packet credential-setup-flow__db-packet" aria-hidden="true" />
      <div className="simple-request-flow__kms credential-setup-flow__db">
        <span className="simple-request-flow__node-mark credential-setup-flow__node-mark--db">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <ellipse cx="12" cy="6" rx="7" ry="2.7" />
            <path d="M5 6v12c0 1.5 3.1 2.7 7 2.7s7-1.2 7-2.7V6" />
            <path d="M5 12c0 1.5 3.1 2.7 7 2.7s7-1.2 7-2.7" />
          </svg>
        </span>
        <b>Composio DB</b>
        <span className="simple-request-flow__node-caption">Encrypted at rest</span>
        <span className="credential-setup-flow__stored" aria-hidden="true">
          <svg viewBox="0 0 24 24">
            <rect x="3" y="5.5" width="18" height="13" rx="2" />
            <path d="M4.5 7.5 12 13l7.5-5.5" />
            <circle cx="12" cy="15.4" r="1.4" />
          </svg>
        </span>
      </div>

      <div className="credential-setup-flow__packet" aria-hidden="true">
        <div className="credential-setup-flow__payload credential-setup-flow__payload--key">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <circle cx="8" cy="12" r="3.2" />
            <path d="M11.2 12h9.3m-3 0v2.8m-3-2.8v2" />
          </svg>
          <span>Public key</span>
          <small>from your KMS · safe to share</small>
        </div>
        <div className="credential-setup-flow__payload credential-setup-flow__payload--entered">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <path d="M12 4.5 13.2 8l3.5 1.2-3.5 1.2L12 13.9l-1.2-3.5L7.3 9.2l3.5-1.2Z" />
            <path d="M18.5 14.2l.7 1.9 1.9.7-1.9.7-.7 1.9-.7-1.9-1.9-.7 1.9-.7Z" />
            <path d="M6.2 15.7l.6 1.5 1.5.6-1.5.6-.6 1.5-.6-1.5-1.5-.6 1.5-.6Z" />
          </svg>
          <span>Client secret</span>
          <small className="credential-setup-flow__secret-value" />
        </div>
        <div className="credential-setup-flow__payload credential-setup-flow__payload--sealed">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <rect x="5.5" y="10.5" width="13" height="8.5" rx="2" />
            <path d="M8.5 10.5V8.2a3.5 3.5 0 0 1 7 0v2.3" pathLength="1" />
            <path d="M12 13.6v2" />
          </svg>
          <span>Sealed client secret</span>
          <small>only your KMS opens it</small>
        </div>
        <div className="credential-setup-flow__payload credential-setup-flow__payload--unsealed">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <path d="M12 4.5 13.2 8l3.5 1.2-3.5 1.2L12 13.9l-1.2-3.5L7.3 9.2l3.5-1.2Z" />
            <path d="M18.5 14.2l.7 1.9 1.9.7-1.9.7-.7 1.9-.7-1.9-1.9-.7 1.9-.7Z" />
            <path d="M6.2 15.7l.6 1.5 1.5.6-1.5.6-.6 1.5-.6-1.5-1.5-.6 1.5-.6Z" />
          </svg>
          <span>Unsealed</span>
          <small className="credential-setup-flow__secret-reveal" />
        </div>
        <div className="credential-setup-flow__payload credential-setup-flow__payload--envelope">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <rect x="3" y="5.5" width="18" height="13" rx="2" />
            <path d="M4.5 7.5 12 13l7.5-5.5" pathLength="1" />
            <circle cx="12" cy="15.4" r="1.4" />
          </svg>
          <span>Credential envelope</span>
          <small>Composio can't open it</small>
        </div>
      </div>
    </div>
  </figure>;

Keyring changes how credentials are protected and used, not how your application calls Composio. Your
application continues to execute tools through Composio, while credential use is routed through the
Keyring running in your environment.

## When you add a credential

<CredentialSetupDiagram />

The Dashboard handles this flow automatically for credentials added through Composio Connect URLs and
the Composio web flow.

1. Composio requests the active public transfer key from your Keyring. The matching private key never
   leaves your KMS.
2. The Dashboard seals the credential in the browser and binds it to its toolkit before sending it to
   Composio.
3. Composio sends the sealed credential to Keyring. Keyring opens it through your KMS and immediately
   encrypts it under your customer-controlled credential key hierarchy.
4. Composio stores only the encrypted credential and its wrapped data-encryption key. Using it later
   still requires your running Keyring and its KMS authorization.

<Accordion title="Encryption detail">
  The Dashboard uses compact JWE with `RSA-OAEP-256` and `A256GCM`. Keyring validates the algorithm,
  encryption mode, transfer-key ID, and toolkit binding before opening the payload.
</Accordion>

## One tool call, end to end

<RequestTraceDiagram />

### 1. Your application requests a Composio tool

Your application uses Composio exactly as it does without Keyring. It does not call Keyring directly
and does not need to understand the credential envelope.

### 2. Composio sends an authenticated request

Composio sends the tool instructions and encrypted credential to your Keyring. The request carries a
signed token that Keyring verifies against Composio's published keys and your configured organization
ID. Tokens are time-limited to no more than one hour.

The token proves who sent the request; it does not grant unrestricted credential access.

### 3. Keyring checks policy before decryption

Keyring checks the toolkit, provider destination, operation type, redirect behavior, and allowed secret
placement before asking your KMS to open the credential. A failed authentication or policy check stops
the call without touching plaintext.

This per-call verification is the core of Keyring's zero-trust request model: network location alone is
never enough to use a credential.

### 4. Plaintext exists only for the provider call

After the checks pass, your KMS authorizes Keyring to decrypt the credential. Keyring places the
credential only in the approved provider request and does not persist it.

Provider responses return through Keyring. New access tokens, refresh tokens, and other credential
fields are encrypted before they leave your environment. If Keyring cannot safely protect a successful
response, it fails closed instead of returning plaintext.

See [Credential refresh and exchange](/concepts/credential_refresh) for a field-by-field walkthrough of
how Keyring obtains a new provider token without returning its plaintext value to Composio.

### 5. Every credential use is auditable

Tool calls, token issuance, OAuth refresh, and revocation all pass through Keyring. Each operation
produces a customer-owned audit event describing what used the credential, the destination, the policy
result, and how the response was handled—without recording the credential itself.

With required audit durability, Keyring does not return a successful sensitive operation until your
collector acknowledges the audit event.

## Who holds what

| Composio holds                                      | You hold                                              |
| --------------------------------------------------- | ----------------------------------------------------- |
| Encrypted credentials that are unusable without you | Root and transfer private keys in your KMS            |
| Signed instructions for each credential use         | The Keyring service in your infrastructure            |
| Tool requests and results while processing the call | Audit records for every tool call and token operation |

Composio does not hold your KMS keys or reusable plaintext credentials. Stopping Keyring or revoking
its KMS permission makes the encrypted credentials held by Composio unusable.

## Customer-controlled kill switches

You can stop all credential use by stopping Keyring or revoking its KMS access. With a reviewed custom
policy, you can also disable selected toolkits or classes of provider operations while keeping others
available. See [Network and request policy](/security/network_and_policy#customer-controls).
