Source: /

Actions: /index.md?actions

# Users bring keys.You never hold them.

With Fiducy, your app uses your users' AI keys without ever storing or seeing them. Their keys, none of the risk.

Read the docs
$ bun add @fiducy/sdk @fiducy/farm Copy

Copy setup prompt for your agent Your coding agent sets it up. Secrets stay with you.

src/lib/fiducy.ts One instance, server side

```

```

Works with

- OpenAIAnthropicGeminiOpenRouter

Runs on

AWS Nitro

Works with

OpenAI

Anthropic

Gemini

OpenRouter

Runs on

AWS Nitro

## A breach can't leak what you never stored

Your app keeps a handle, not a key. The real key exists for one request inside a sealed enclave, then it is gone.

Your app sends a handle to the Fiducy enclave, which opens the key and calls the providerhandlekey opened for one requestYour appstores kh_9f2c…Fiducy enclaveattested by AWSkeeps nothing afterthe call endsOpenAIAnthropicGeminiOpenRouter

Your app sends a handle to the Fiducy enclave, which opens the key and calls the providerhandlekey, opened for one requestYour appstores kh_9f2c…Fiducy enclaveattested by AWSkeeps nothing afterthe call endsYour user's providerOpenAI, Anthropic,Gemini, OpenRouter

## Ship bring-your-own-key this week

No crypto to write and no key vault to run. Four small pieces drop into the app you already have, and your model calls look the same as before.

Copy setup prompt for your agent

Server Integration Widget Model call

src/lib/fiducy.ts

```
import { getStorage } from '@farm.js/core/storage';
import { createFiducy, keyValueStorage } from '@fiducy/sdk/server';

import { auth } from '@/lib/auth';

const { FIDUCY_GATEWAY_URL, FIDUCY_APP_SECRET } = process.env;
if (!FIDUCY_GATEWAY_URL || !FIDUCY_APP_SECRET) throw new Error('Set the Fiducy env vars');

export async function getUserID(request: Request) {
  const session = await auth.api.getSession({ headers: request.headers });
  return session?.user.id ?? null;
}

export const fiducyServer = createFiducy({
  gatewayURL: FIDUCY_GATEWAY_URL,
  appSecret: FIDUCY_APP_SECRET,
  storage: keyValueStorage(getStorage('fiducy')),
  getUserID
});
```

## When something leaks, your users' keys don't

Users don't have to take your word for it. `GET /attestation` proves which code holds their key, signed by AWS. [How to check it](/docs/security)

Your database

A handle is stolen opens nothing

### If your database leaks, attackers get handles that open nothing.

Each handle needs the enclave and your app secret before it opens anything.

Your server logs

The logs are searched 0 keys found

### If your logs leak, there is no key in them to find.

Keys go from the widget straight to the enclave and never pass your server.

Fiducy's storage

Half a key is stolen useless alone

### If Fiducy is breached, attackers get half a key. Useless alone.

The other half lives only in your handle. Neither half opens anything alone.

An AWS admin

An admin tries to decrypt unwrap denied

### Even an AWS admin cannot decrypt your users' keys.

KMS unwraps only for the attested enclave image, and nothing is stored open.

Questions

## Before you hand over your users' keys.

Something else on your mind? The [docs](/docs) are searchable, and so is [llms.txt](/llms.txt).

### What is bring-your-own-key, and why does custody matter?

### Does Fiducy ever see the plaintext key?

### How do I add it to an existing app?

### How can my users verify the enclave?

### What does it cost?

## Self-host

Free and open source

Keep every key in your own AWS account. One CloudFormation stack, and nothing leaves your infrastructure.

Self-hosting guide

## Managed

Coming soon

Skip the infrastructure. We run the enclave and the dashboard, you add the SDK. Leave your email and you hear first.

Join the waitlist

No spam. One email when the managed service opens.
