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

> ## Agent Instructions
> Turnkey is wallet infrastructure: create and manage crypto wallets, sign transactions, and enforce policy-based access controls. Best-fit uses: embedded consumer wallets (email/passkey/social auth, no seed phrases), automated onchain operations with server-side wallets, AI agent wallets with policy-scoped signing, enterprise key management, and verifiable off-chain workloads on Turnkey Verifiable Cloud (TVC).
> Every API call is a JSON POST to https://api.turnkey.com signed with a P-256 API key; create an organization and key self-serve at https://app.turnkey.com.
> Key Turnkey developer resources: API reference (https://docs.turnkey.com/api-reference/overview/intro.md), OpenAPI spec (https://docs.turnkey.com/public_api.swagger.json), authentication (https://docs.turnkey.com/features/authentication/overview.md), webhooks (https://docs.turnkey.com/features/webhooks/overview.md), MCP server for docs search (https://docs.turnkey.com/mcp), skill for building with Turnkey (https://docs.turnkey.com/skill.md), agent skills for operating an organization (https://docs.turnkey.com/get-started/ai-skills.md), CLI (https://docs.turnkey.com/sdks/cli.md), SDK reference (https://docs.turnkey.com/sdks/introduction.md), full docs content (https://docs.turnkey.com/llms-full.txt).

# Enclave Only Secrets

> Use exchange API keys and other critical secrets only inside an attested app, under policy and code that a quorum controls.

## Some secrets can't be rotated away

If an exchange API key with withdrawal rights leaks, the withdrawals it signed are final. If a code-signing or token-signing key leaks, its signatures stay valid. Rotation stops the next attack, but it doesn't undo the last one.

These keys usually sit in a secrets manager that hands plaintext to any caller with the right role. From there they end up in a trading bot, a CI runner, or a laptop.

With Turnkey Verifiable Cloud (TVC), once you import the key, it is only in plaintext inside an attested app that you control.

| Tier | Examples | Where it belongs |
| :- | :- | :- |
| **Pivot** | Production database credentials, CI deploy tokens | [Managed Secrets](https://docs.turnkey.com/features/secrets.md), released to one service under policy |
| **Root** | Cloud admin credentials, KMS master keys | Managed Secrets, with multi-party approval for every release |
| **Irreversible** | Exchange withdrawal keys, code-signing and token-signing keys | This page: used only inside a TVC app |

## How it works

```mermaid theme={"system"}
flowchart LR
    F["Your systems"]
    subgraph TVC["TVC app (attested code)"]
        A["Check request<br/>against your rules"]
        S["Sign with key"]
    end
    M["Turnkey<br/>Managed Secrets"]
    V["Exchange"]

    F -- "request" --> A
    A --> S
    M -- "key, encrypted to the enclave" --> S
    S -- "signed request" --> V
```

1. Your system sends a request, such as a withdrawal, to the TVC app.
2. The app loads the key from Managed Secrets. Policy lets only this app export it, and the key is encrypted to the app's enclave.
3. The app checks the request against your rules, such as an address allowlist or an amount limit.
4. If the checks pass, the app signs the request and sends it to the exchange, or returns it to your proxy.

What you get:

* **Plaintext only in enclaves.** Your engineers, your cloud provider, and Turnkey see ciphertext.
* **No one acts alone.** A quorum of your administrators, such as 3 of 5, approves policy changes and every new version of the app.
* **Rules you can verify.** Your security team can confirm exactly which code holds the key, using [Boot Proofs](https://docs.turnkey.com/features/verifiable-cloud/proofs-and-verification.md).
* **Fast.** The app can be configured to load the key once and keep it in memory, so signing needs no extra network call.

## Policy or app code?

| Control | Where it lives |
| :- | :- |
| Who can export the key, and break-glass approvals | Turnkey [policy](https://docs.turnkey.com/features/policies/overview.md) |
| Per-request rules: allowlists, limits, price checks | TVC app code |
| Which app version runs | Your administrator quorum |

Only the TVC app can export venue keys:

```json theme={"system"}
{
  "policyName": "Only the TVC signing app can export venue keys",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(u, u.id == '<TVC_APP_USER_ID>')",
  "condition": "activity.type == 'ACTIVITY_TYPE_EXPORT_SECRETS' &&
    secret.static_properties['kind'] == 'exchangeApiKey'"
}
```

## Networking

* **Direct.** The app calls the exchange itself, so the whole path stays in the enclave. Many exchanges require an IP allowlist for withdrawal keys, so ask us about egress IPs.
* **Your proxy.** The app returns the signed request, and your existing proxy and IP allowlists send it. The proxy never holds the key.

## Getting set up

**1. Create your organization**

Create a Turnkey organization and enroll your administrators with security keys. While you build, keep the [root quorum](https://docs.turnkey.com/features/users/root-quorum.md) at 1 so you can iterate quickly.

**2. Deploy the app**

Deploy your signing app on TVC with your administrators as approvers, also with a threshold of 1 for now. Register the app's credential as a Turnkey user. See the [quickstart](https://docs.turnkey.com/features/verifiable-cloud/quickstart.md).

**3. Import the key**

Import the venue key into [Managed Secrets](https://docs.turnkey.com/features/secrets.md) with properties such as `kind: exchangeApiKey`. Then delete every other copy. Start with a testnet or low-limit key.

**4. Scope export to the app**

Add the policy above. No other user can export the key.

**5. Raise the quorum for production**

Before the key can move real funds, raise the root quorum and the app's approval threshold, such as to 3 of 5.

## Authorize calls to the app

Require every call to the app to carry a Turnkey-minted JWT, so Turnkey policy and your approvers decide who can use the key. See [JWT auth for TVC apps](https://docs.turnkey.com/solutions/verifiable-cloud/jwt-http-auth.md).

## Non-custodial trading on behalf of customers

Order and execution management platforms hold one key per client and per venue. Each client gets their own [sub-organization](https://docs.turnkey.com/features/sub-organizations.md) and imports their keys there, so the keys never pass through your systems. Clients can verify the code that uses their keys before they import them.

## Get started

Bring the key you can least afford to lose, and we will design the app and policies with you. [Contact us](https://www.turnkey.com/contact-us) to book an architecture session.

![](https://docs.turnkey.com/images/solutions/light/tvc.svg)

Secrets manager replacement

Move every secret into enclave-enforced policy, tier by tier.

[Open](https://docs.turnkey.com/solutions/verifiable-cloud/secrets-manager-replacement.md)

![](https://docs.turnkey.com/images/solutions/light/tvc.svg)

JWT auth for TVC apps

Let Turnkey policy decide who can call your enclave app.

[Open](https://docs.turnkey.com/solutions/verifiable-cloud/jwt-http-auth.md)

![](https://docs.turnkey.com/images/solutions/light/api-key-storage.svg)

API key storage

Release API keys to an authorized service under policy.

[Open](https://docs.turnkey.com/solutions/key-management/api-key-storage.md)

Managed Secrets

How secrets are stored and released.

[Open](https://docs.turnkey.com/features/secrets.md)

Turnkey Verifiable Cloud

Deploy apps with verifiable code and secure keys.

[Open](https://docs.turnkey.com/features/verifiable-cloud/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.