convez.ai
MCP ServerSegurançaIntermediário
cloakward

Cloak

cloakward/cloak

Cofre encriptado para chaves de API - agentes usam sem ver

Ver no GitHub
BomPluginScore · de 0 a 100

Cofre local encriptado para chaves de API em agentes de IA. Permite que seus agents usem credenciais sem nunca expor as chaves armazenadas ao modelo, mantendo tudo criptografado na sua máquina e controlado por políticas de acesso.

Instalação

$npx convez-ai cloakward/cloak

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
18
Forks
0
Acompanhando
0
Saúde
75%
Último commit
há 5 meses
Versão
v1.1.2
Issues abertas
3
Contribuidores
1

Casos de uso

  • Proteger chaves OpenAI, Stripe e outras APIs contra prompt injection
  • Gerenciar múltiplas credenciais com políticas de acesso controladas
  • Usar agentes IA com segurança em produção sem expor secrets

Veredito

Solução elegante e bem-assinada (SLSA L3) para o problema real de vazamento de credenciais em contextos de IA. A abordagem de "allowlist by default" e ausência de read_secret é acertada; recomendado para qualquer setup com agentes IA que precisem acessar APIs sensíveis.

README

A tradução para o português deste README ainda está na fila.

Hand an AI agent an API key and you've handed it to the model: its context, its provider's logs, and anyone who can read them. One prompt injection and the key walks out the door.

Cloak keeps your keys in an encrypted vault on your machine. The agent never receives the stored key. It asks Cloak to use the key, and gets back only the result.

  • No read_secret tool. The agent can list, sign, proxy, and mint. It cannot read a stored value.
  • Allowlisted by default. A key reaches a host only if you approved it.
  • Local only. No account, no cloud, no telemetry.
  • Signed releases. macOS-notarized, cosign-signed, SLSA L3-attested.

Quickstart

macOS (arm64/x64) and Linux (x64 glibc):

brew install cloakward/cloak/cloak
cloak setup                     # creates the vault, starts the daemon, connects your AI clients
cloak import .env               # pull every key you already have into the encrypted vault

That works for any secret: an LLM key, a payments key, a cloud credential, a git token. Add them one at a time instead with cloak add OPENAI_API_KEY.

Allowlist where each key is allowed to go in your policy.toml, one block per secret:

[[secrets]]
name = "OPENAI_API_KEY"
[secrets.tools.proxy_authenticated_http_request]
allowed_hosts = ["api.openai.com"]

[[secrets]]
name = "STRIPE_SECRET_KEY"
[secrets.tools.proxy_authenticated_http_request]
allowed_hosts = ["api.stripe.com"]

Pick up the policy and unlock the daemon so your agent can use the vault:

cloak daemon restart && cloak unlock

Your agent can now use any of them, in plain English. One worked example:

You: test my checkout: create a $50 Stripe PaymentIntent with pm_card_visa and confirm it succeeded.

The agent calls proxy_authenticated_http_request. Cloak attaches STRIPE_SECRET_KEY, sends the request to Stripe, and returns only the result. This is a real one, captured in test mode:

proxy_authenticated_http_request  →  POST https://api.stripe.com/v1/payment_intents

Status 200
{
  "id": "pi_3ThFkTKCZ65x2cgg0rzmsrj3",
  "amount": 5000,
  "amount_received": 5000,
  "currency": "usd",
  "livemode": false
}

A real $50 charge went through. The STRIPE_SECRET_KEY that authorized it, which can refund every charge and drain the account, appears nowhere in what the model received.

cloak setup connects Claude Desktop, Claude Code, Cursor, Windsurf, Zed, Continue.dev, and Codex that it finds installed. The quickstart covers Linux, Docker, and the Claude Desktop extension.

How it works

Three pieces:

  • cloak: the CLI you use to add and manage secrets.
  • cloakd: a local daemon that holds the keys and does the privileged work.
  • cloak-mcp: the MCP server your AI client connects to.

Your agent calls a tool on cloak-mcp. cloakd checks your policy, attaches the secret only for the allowed request, and returns the result. The stored key never reaches the agent or model.

What it protects (and what it doesn't)

Cloak stops your long-lived key from leaking. It does not make a hijacked agent harmless: a minted token or a proxied response still goes to the agent, and an agent can still misuse the access you allowlisted. It is built for a single-user machine; root and compromised hosts are out of scope. The threat model is honest about the rest.

Documentation

License

Apache-2.0. See LICENSE.

Ver o original no GitHub

Bom para

Relacionados