secrets
Fungsinya
Skill ini menjelaskan cara aplikasi menyimpan dan memakai kredensial seperti kunci API dan koneksi OAuth. Skill ini untuk pengembang yang menambahkan fitur yang membutuhkan login atau kunci dari pengguna atau workspace.
Kapan dipakai
- ✓Saat fitur membutuhkan kunci API atau login layanan eksternal.
- ✓Ketika Anda menambahkan OAuth agar pengguna bisa menghubungkan akun.
- ✓Saat Anda tergoda menempelkan kunci ke kode sumber atau nilai pengaturan biasa.
Link skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/secrets/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Tambahkan fitur yang membutuhkan kunci API, dan pastikan kunci itu disimpan dengan aman dan tidak di dalam kode.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent pertama-tama memeriksa koneksi yang sudah ada, lalu memakai alur OAuth bersama atau sistem rahasia bersama. Kunci tidak pernah ditaruh di kode aplikasi atau status yang terlihat di sisi klien.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.
Pertanyaan umum
Bisakah kunci disimpan sebagai pengaturan biasa?
Tidak. Token akses dan token penyegar tidak boleh disimpan sebagai pengaturan biasa atau nilai kunci API.
Kapan variabel lingkungan diizinkan?
Hanya untuk nilai tingkat deployment, misalnya rahasia verifikasi webhook.
Bagaimana jika penyedia sudah terhubung?
Aplikasi memakai koneksi yang sudah ada alih-alih meminta pengguna memasukkan kunci lagi.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 7.6k
- Peringkat
- #13179
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
design-exploration
7.6kMembantu agent Anda mengeksplorasi beberapa arah desain UI secara berdampingan, membiarkan Anda memilih satu, lalu menyempurnakan desain yang dipilih.
visual-edit
7.6kMembantu agent Anda membuka aplikasi lokal yang sedang berjalan di editor visual agar Anda dapat meninjau dan mengedit layar aslinya bersama-sama.
turn-into-app
7.6kMengubah alur kerja, spreadsheet, atau proyek menjadi aplikasi visual yang rapi, dengan layar yang terisi dan agent yang bekerja di balik kontrol.
visual-plan
7.6kMengubah rencana teks biasa menjadi rencana visual interaktif dengan diagram, peta file, cuplikan kode, dan pertanyaan terbuka.
Skill serupa
reverse-engineer-anything
422kMembantu agent Anda memeriksa aplikasi dan paket yang sudah dirilis untuk menjelaskan fitur, membandingkan versi, atau memandu pembangunan ulang dengan alat REA.
1password
394kMembantu agent Anda mengatur CLI 1Password, masuk, serta membaca atau menyisipkan rahasia tanpa menampilkan nilainya di chat.
healthcheck
394kMembantu agent Anda mengaudit komputer atau server OpenClaw dari risiko keamanan seperti SSH, firewall, pembaruan, dan cadangan, lalu menyarankan perbaikan aman.