secrets
하는 일
이 스킬은 앱이 API 키와 OAuth 연결 같은 자격 증명을 저장하고 사용하는 방법을 설명합니다. 사용자나 워크스페이스의 로그인 또는 키가 필요한 기능을 추가하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓기능에 API 키나 외부 서비스 로그인이 필요할 때.
- ✓사용자가 계정을 연결할 수 있도록 OAuth를 추가할 때.
- ✓키를 소스 코드나 일반 설정 값에 붙여 넣고 싶은 유혹이 들 때.
스킬 링크
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/secrets/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
- 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.
- For OAuth, use the shared authorization and token flow. Do not store access or refresh tokens as ordinary settings or API-key values.
- 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.
- 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.
댓글
- …
이 저장소의 다른 스킬
design-exploration
7.6k에이전트가 여러 UI 디자인 방향을 나란히 보여 주고, 사용자가 하나를 고르면 그 디자인을 다듬도록 돕습니다.
visual-edit
7.6k에이전트가 실행 중인 로컬 앱을 시각 편집기에 열어, 실제 화면을 함께 검토하고 편집하도록 돕습니다.
turn-into-app
7.6k워크플로, 스프레드시트 또는 프로젝트를 데이터가 채워진 세련된 시각 앱으로 바꾸고, 컨트롤 뒤에서 에이전트가 작업하도록 합니다.
visual-plan
7.6k일반 텍스트 계획을 다이어그램, 파일 맵, 코드 조각, 열린 질문이 담긴 대화형 시각 계획으로 바꿔 줍니다.