Pular para o conteúdo
Skillpedia
Segurança7,6 mil · #13179

secrets

O que ela faz

Esta skill explica como um aplicativo deve armazenar e usar credenciais, como chaves de API e conexões OAuth. É para desenvolvedores que acrescentam uma funcionalidade que precisa do login ou da chave de um usuário ou do espaço de trabalho.

Quando usar

  • ✓Quando uma funcionalidade precisa de uma chave de API ou de um login de serviço externo.
  • ✓Quando você acrescenta OAuth para que um usuário possa conectar uma conta.
  • ✓Quando você sente vontade de colar uma chave no código-fonte ou em um valor comum de configuração.

Link da skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/secrets/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/secrets/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Acrescente uma funcionalidade que precise de uma chave de API, e garanta que a chave seja armazenada com segurança e não no código.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente verifica primeiro se já existe uma conexão, depois usa o fluxo OAuth compartilhado ou o sistema de segredos compartilhado. As chaves nunca são colocadas no código do aplicativo nem em estados visíveis ao cliente.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Secrets

Rule

Credentials belong to the user, organization, workspace, or deployment that owns them. Reuse the strongest shared connection or credential flow available; never copy a value into app code or client-visible state.

Choose the credential source

  1. Check the workspace connection catalog first. If the provider is already connected, request the app grant and resolve its vault-backed credential reference through the workspace-connection API.
  2. For OAuth, use the shared authorization and token flow. Do not store access or refresh tokens as ordinary settings or API-key values.
  3. If the app truly needs its own API key, register it with the shared secrets surface. Do not build a parallel key form or storage table.
  4. Use deployment configuration only for a secret owned by the deployed app, such as a webhook verification secret. LLM inference keys are an app-owned exception: self-hosted apps may use provider keys from deployment env as a shared fallback, while scoped user or organization keys take precedence. Hosted-workspace deployments backed by a shared database must not share those env keys across apps or tenants. This exception does not authorize using env credentials to access user-owned provider data.

Register an app-local API key

Register the key once so Settings can manage it and the app can describe why it is needed. Supported scopes are user, org, and workspace; choose the narrowest scope that matches who owns the credential and how the app resolves it. Put the registration in a server module imported by a loaded server plugin.

import { registerRequiredSecret } from "@agent-native/core/secrets";

registerRequiredSecret({
  key: "EXAMPLE_SERVICE_API_KEY",
  label: "Example service API key",
  description: "Connects this app to the example service.",
  docsUrl: "https://example.com/api-keys",
  scope: "user",
  kind: "api-key",
  required: true,
});

Use kind: "oauth" for an OAuth-backed connection and set oauthProvider and oauthConnectUrl for the shared Connect flow. Set required only when the app cannot perform its primary workflow without that connection. A validator may check a key before save; never log or include the value in a validation error.

Resolve credentials on the server

Resolve credentials only inside server-side actions or server helpers, using the request's user and organization context. Keep a missing key separate from a failed credential-store lookup: ask the user to connect the provider only when the credential is absent; make a store failure retryable.

For an app-local key, use resolveSecretDetailed() from @agent-native/core/server in the request context. Check lookupFailed before checking value; do not turn a failed lookup into a setup prompt.

Never read a user's or workspace's API key from process.env, or add a raw environment fallback to a scoped lookup. Do not put credentials in action arguments or results, agent messages or hidden context, application state, browser storage, client bundles, logs, or error text. Send them only in the provider request that needs them, and redact provider responses before returning an error.

Related skills

  • security — protect access to app data and external requests.
  • actions — expose server-side operations to both the agent and UI.
Perguntas frequentes

Chaves podem ser salvas como configurações normais?

Não. Tokens de acesso e de atualização não devem ser salvos como configurações comuns nem como valores de chave de API.

Quando uma variável de ambiente é permitida?

Somente para valores no nível de implantação, como um segredo de verificação de webhook.

E se o provedor já estiver conectado?

O aplicativo usa a conexão existente, em vez de pedir ao usuário a chave novamente.

Detalhes

Descrição original do autor

Connect external services and keep app credentials scoped. Use before adding an API key, OAuth connection, provider setup, or server-side request that needs a user's or workspace's credential.

repo: BuilderIO/agent-native

Popularidade

Estrelas no GitHub
7,6 mil
Posição no ranking
#13179
Licença
MIT
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas