본문으로 건너뛰기
Skillpedia
보안7.6k · #13179

secrets

하는 일

이 스킬은 앱이 API 키와 OAuth 연결 같은 자격 증명을 저장하고 사용하는 방법을 설명합니다. 사용자나 워크스페이스의 로그인 또는 키가 필요한 기능을 추가하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓기능에 API 키나 외부 서비스 로그인이 필요할 때.
  • ✓사용자가 계정을 연결할 수 있도록 OAuth를 추가할 때.
  • ✓키를 소스 코드나 일반 설정 값에 붙여 넣고 싶은 유혹이 들 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/secrets/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“API 키가 필요한 기능을 추가해 주세요. 키는 코드가 아니라 안전하게 저장되어야 합니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 기존 연결이 있는지 확인한 뒤, 공유 OAuth 흐름이나 공유 비밀 시스템을 사용합니다. 키는 앱 코드나 클라이언트에 보이는 상태에 절대 두지 않습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.
자주 묻는 질문

키를 일반 설정으로 저장할 수 있나요?

아니요. 액세스 토큰과 리프레시 토큰은 일반 설정이나 API 키 값으로 저장하면 안 됩니다.

환경 변수는 언제 허용되나요?

웹훅 검증 비밀처럼 배포 수준의 값에만 허용됩니다.

제공자가 이미 연결되어 있으면 어떻게 하나요?

사용자에게 키를 다시 묻지 않고, 기존 연결을 사용합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
7.6k
순위
#13179
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬