s-gw

io.github.sgateway由 GitHub 帳號 sgateway 發布v0.1.22更新於 Oct 24, 2026

Keep credentials out of AI coding agents with local approvals, scoped injection, and audit trails.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機憑證閘道,讓編碼代理以代號引用密鑰,經本機核准後僅向子程序注入憑證,並回傳去識別化輸出。

可以做什麼
探索憑證代號並為代理建立有範圍的動作請求,例如在某個環境變數中注入密鑰後執行命令,而不把原始值暴露給模型上下文或工具輸出。請求進入本機核准佇列,授權範圍綁定代理、代號、命令、環境變數、工作目錄、目標及選用時間窗。獲准命令在本機執行,憑證只注入該子程序,輸出在回傳前被掃描,偵測到的密鑰值替換為代號。核准、執行、原則與目標證據會被記錄,但不儲存回傳的原始密鑰。CLI、原生桌面應用程式、選單列小工具和本機網頁主控台可檢視核准佇列、憑證清單、原則、使用
適用情境
當編碼代理需要執行依賴 API 密鑰、權杖、密碼或 SSH 材料的命令,而你希望這些值不進入模型上下文、改為在本機逐項核准有範圍的動作,而不是把密鑰貼到聊天或代理設定中時使用。
執行需求
從 npm 套件 @s-gw/s-gw 安裝的本機程序,可用 npx 執行或全域安裝;需要 Node.js 20 或更新版本。Apple Silicon 上的 macOS 14+ 是主要平台,Windows 和 Linux 桌面支援為預覽。Linux 需要 secret-tool 和已解鎖的 Secret Service 鑰匙圈;無頭主機可明確提供 SGW_MASTER_PASSPHRASE。安裝程式會初始化加密本機帳本,並可註冊支援的代理。
安裝前請注意
這是早期預覽,未經獨立安全稽核,儲存格式和介面可能變動。它無法防禦遭入侵的作業系統帳戶、惡意的已核准執行檔、螢幕錄製或核心層級存取,也不能取代端點安全或強化的企業密鑰平台。MCP 註冊不會攔截所有提示、檔案讀取、shell 或環境變數。獲准命令在本機執行,可能修改資料。散布套件還包含專有的編譯 Rust 執行核心,其原始碼另行維護。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 s-gw,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[s-gw]

s-gw

Local credential control for coding agents.
Approve bounded actions locally. Keep raw credentials out of model context and tool output.

[CI] [npm] [License: Apache-2.0] [Node.js 20+] [Website: s-gw.com] [GitHub stars] [Project status: preview]

Demo · Downloads · Quick start · Documentation · Security · Contributing

[s-gw demo]

Stop handing raw credentials to coding agents. s-gw gives agents typed handles, asks you to approve bounded local actions, resolves the credential inside a constrained process on your machine, and returns sanitized output instead of secret values.

[!IMPORTANT] s-gw is an early preview. Storage formats and interfaces may change, Windows and Linux desktop support is still experimental, and the project has not completed an independent security audit. Do not treat it as a replacement for endpoint security or a hardened enterprise secrets platform yet.

The TypeScript broker, clients, and documentation in this repository are Apache-2.0 licensed. Distributed packages also contain a proprietary compiled Rust execution core whose source is maintained separately.

The Short Version

  • Agent sees: s-gw:credential:prod-readonly
  • You approve: agent, command, handle, environment binding, working directory, and target
  • s-gw runs: the command locally with the credential injected only into that child process
  • Agent receives: sanitized output, audit evidence, and no raw secret

If s-gw helps your agent workflow, star the project. It makes the preview easier for other developers to find.

See It In Action

The local console shows the approval queue, credential inventory, policy state, usage flow, and activity history without exposing secret values.

[s-gw local console overview]

Public demo: s-gw.com.

What It Does

GovernApproveExecuteAudit
Turn secrets into typed local handles that agents can reference safely.Review the requesting agent, handle, command, environment binding, working directory, and target before access is granted.Inject the credential only into the approved child process on the same machine.Record request, approval, execution, policy, and destination evidence without storing returned raw secrets.

Why Teams Use It

  • Local custody: raw values stay in macOS Keychain, Linux Secret Service, Windows Credential Manager, 1Password, or the encrypted local ledger.
  • Action-scoped access: grants bind to the agent, handle, command, environment variable, working directory, target, approval mode, and optional time window.
  • Useful handles: agents can request real work with stable handle names instead of seeing keys, passwords, tokens, or SSH material.
  • Output sanitization: command output is scanned before it returns to the agent, replacing detected credential values with handles.
  • Agent-aware setup: Codex, Claude Code, Cursor, OpenCode, Gemini CLI, GitHub Copilot, VS Code, and other MCP clients get profile-specific configuration.
  • Local operator UI: native desktop apps, tray or menu helpers, the CLI, and the web console show approvals, credential inventory, policies, usage flow, activity, and audit history.

How It Works

mermaid
flowchart LR    A["Coding agent"] -->|"Handle + action request"| G["s-gw local gateway"]    G --> U["Local approval"]    U --> R["Constrained runner"]    K[("Keychain / Credential Manager / encrypted store")] --> R    R -->|"Sanitized output"| G    G --> A

The agent never needs the unlock passphrase or raw credential. Approval is scoped to the requested operation rather than granting general access to the store.

Core Surfaces

SurfacePurpose
s-gw CLISetup, credential enrollment, approvals, policies, agent snippets, guard mode, and diagnostics.
s-gw-mcp / s-gw mcpStdio MCP server for agent-facing handle discovery and request creation.
Native macOS appApproval queue, credential inventory, policy rules, usage flow, activity, and audit review.
Windows and Linux desktop appsInstalled preview apps with a native window, tray controls, and a bundled local runtime.
Menu-bar helperFast visibility into pending approvals and local daemon status.
Local web consoleBrowser backup bound to 127.0.0.1; it remains available when a desktop app cannot run.
Guard modeLaunch agents with credential-looking environment values replaced by s-gw handles.

Quick Start

The public npm package is the recommended installation path on macOS, Windows 10/11, and Linux. Install Node.js 20 or newer, then run:

bash
npm install -g @s-gw/s-gws-gw setups-gw status

On Windows, run the same commands in PowerShell. Windows support is preview software: the npm package uses the TypeScript execution path and includes the PowerShell client, tray helper, and local web console.

On Linux, install secret-tool first (sudo apt install libsecret-tools on Ubuntu/Debian). An unlocked desktop Secret Service is the normal persistent unlock provider; s-gw setup also installs and starts an owner-level systemd --user console service for the graphical session. A headless host without Secret Service can use an explicitly supplied SGW_MASTER_PASSPHRASE with s-gw setup --no-service --no-open-app, but s-gw never copies that value into a unit file or background-service environment.

Windows x64 and Linux x64 also have installable desktop-app builds. The Rust app draws its management interface directly in a native window; it does not embed a browser, WebView, or localhost page. It packages its own pinned Node runtime and s-gw CLI, so the installed app does not require host Node.js or npm. When the native executable is installed, s-gw app open uses it. Use s-gw app open --browser to start and open the separate loopback browser backup explicitly.

These Windows NSIS and Linux Debian packages are currently unsigned CI previews, not supported public release downloads. Windows does not require WebView2. Linux requires a graphical session and an unlocked Secret Service keyring; the Debian package declares its GTK 3, AppIndicator, libxdo, and libsecret-tools runtime dependencies. See deployment and packaging for build and install details.

For an Apple Silicon Mac desktop bundle, GitHub Releases also provides a self-contained s-gw.dmg. Drag s-gw.app to Applications, then open it and complete setup. The app includes its own Node runtime, CLI, MCP server, native helpers, and menu-bar helper; it does not require Node.js or npm on the host. Setup is intentionally blocked until the app is in /Applications or ~/Applications.

An unsigned DMG requires a Gatekeeper override. Use the npm installation above instead if you do not want to use that override.

The public source builds the TypeScript compatibility path and the native-rendered Windows/Linux Rust desktop app. Building the native macOS surfaces also requires a Swift toolchain. Windows and Linux desktop builds require Rust and their ordinary native graphics and tray development libraries. Maintainer release builds additionally require access to the private Rust core checkout.

The Apple Silicon Mac DMG is a self-contained desktop alternative. Published macOS DMGs are either Developer ID signed and notarized or explicitly documented as unsigned; unsigned builds require a Gatekeeper override but retain the standard release tag and update path. Local npm run build:installers output is ad-hoc signed for local verification. The npm package is the primary install and includes the native app, menu helper, Keychain helper, metadata-only Keychain inspector, and Rust core for Apple Silicon Macs. Linux and Windows use the TypeScript execution path when a matching native core is not packaged. Intel Macs must build the native Keychain and desktop surfaces from source for now; packaged arm64-only helpers are rejected before launch.

bash
git clone https://github.com/sgateway/s-gw.gitcd s-gwnpm cinpm run buildnpm links-gw setups-gw status

s-gw setup generates local unlock material, stores it in the operating system credential store, initializes the encrypted ledger, starts the local UI surfaces available on the current platform, and safely connects detected supported agents. The self-contained macOS app and the Windows/Linux desktop previews run their bundled runtimes in place; npm installs copy the thin macOS app into /Applications, falling back to ~/Applications when needed. Setup backs up existing agent config, preserves unrelated settings, installs the packaged s-gw skill where supported, and reports per-agent conflicts. Use --no-agents to skip agent registration.

Add a credential from your terminal without placing the value in chat or a process argument:

bash
printf '%s' "$MY_API_TOKEN" | s-gw secret add-keychain \  --name demo-token \  --type api-token \  --value-stdin \  --inject-env API_TOKEN \  --allow-command "$(command -v printenv)"

Then inspect the non-secret handle metadata:

bash
s-gw secret list

The end-to-end trust loop walks through a disposable request, local approval, execution, and output sanitization without touching a real credential.

Try The Trust Loop

Use a disposable local token to see the full flow:

bash
printf '%s' 'demo-secret-value' | s-gw secret add-keychain \  --name demo-printenv-token \  --type api-token \  --value-stdin \  --inject-env DEMO_TOKEN \  --allow-command "$(command -v printenv)"
s-gw request env-command <returned-handle> \  --command "$(command -v printenv)" \  --inject-env DEMO_TOKEN
s-gw approve <request-id>s-gw execute <request-id>

The execution output should show a handle token instead of demo-secret-value.

Agent Integration

List the known agent profiles and render the configuration for one client:

bash
s-gw agent lists-gw agent mcp-snippet codexs-gw agent mcp-snippet claude-codes-gw agent mcp-snippet opencode

Review or manage detected connections:

bash
s-gw agent statuss-gw agent install codex --dry-runs-gw agent install codexs-gw agent uninstall codex

Manual profiles and config formats without a safe merge path continue to use the generated snippet. npm installation itself never edits agent configuration.

s-gw setup can safely manage detected Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, and default-profile VS Code installations on macOS, Windows, and Linux. On Windows, it launches the packaged MCP server through node.exe, not an npm .cmd shim.

For CLI agents, guard mode can replace credential-looking launch environment values with s-gw handles before the agent starts:

bash
s-gw run codex --dry-run -- -vs-gw run codex -- --ask-for-approval never

MCP registration does not intercept every prompt, file read, shell, or environment variable. See agent integration and the agent profile matrix for the supported paths and current limitations.

Example Request Flow

  1. An agent sees s-gw:credential:prod-readonly and asks to run aws sts get-caller-identity.
  2. s-gw creates a pending request with the agent name, command, handle, environment binding, working directory, target, and policy result.
  3. You approve once, for a time window, for the login session, or deny it.
  4. s-gw starts the approved local process with the credential injected into the requested environment variable.
  5. s-gw scans the process output before it returns to the agent.

The model can complete the task without receiving the raw access key.

Platform Status

PlatformStatusCredential storeUser interface
macOS 14+ on Apple SiliconPrimary development platformKeychainNative app, menu helper, local web console
macOS 14+ on IntelBuild-from-source candidate; not QA-testedSource-built Keychain helperSource-built native surfaces or local web console
Windows 10/11 x64Unsigned desktop previewCredential ManagerNative desktop app and tray; PowerShell client and browser backup
Linux x64 desktopUnsigned desktop previewSecret Service; explicit environment fallbackNative desktop app and tray; systemd user service and browser backup
Linux arm64npm previewSecret Service; explicit environment fallbacksystemd user service and browser backup

Published Apple Silicon macOS DMGs are self-contained. Releases are Developer ID signed and notarized when credentials are available; otherwise the release notes and DMG README state that a Gatekeeper override is required. Windows NSIS and Linux Debian desktop packages are currently unsigned CI artifacts and are not uploaded as supported release downloads. Build either one on its target operating system with npm run build:desktop-app; build the existing release artifacts with npm run build:installers.

Security Model

s-gw is designed to reduce accidental credential exposure to coding agents. It does not protect against a compromised operating system account, a malicious approved executable, screen capture, kernel-level access, or every transformed derivative of a secret.

Read the threat model before relying on s-gw for sensitive workflows. Report suspected vulnerabilities through GitHub private vulnerability reporting, not a public issue.

Project Status

  • The public broker and client source distribution is preview quality; the compiled Rust execution core is proprietary.
  • macOS is the primary development and test platform.
  • Windows Credential Manager support and the Windows x64 desktop app are present but still need broader native QA and code signing.
  • Linux uses Secret Service for persistent unlock material and a hardened systemd user service. The Linux x64 desktop app is an unsigned preview; environment unlock is a non-persistent headless fallback only.
  • Windows and Linux desktop installers are CI previews until they are signed and validated on supported target systems. macOS releases without Developer ID signing are marked unsigned in their release notes and require a Gatekeeper override.
  • The repository is prepared for open-source collaboration, but security-sensitive changes should come with focused tests and threat-model updates when behavior changes.

Documentation

Contributing

Issues and focused pull requests are welcome. Start with CONTRIBUTING.md, browse good first issue, and use SECURITY.md for anything that may expose credentials or bypass approval.

Planning a launch, write-up, or community post? The maintainer notes in docs/community-launch.md keep the public wording consistent and honest.

License

Source in this repository is Apache-2.0. See LICENSE and NOTICE. The separately maintained Rust core and its compiled binaries are proprietary and are not licensed under Apache-2.0. Third-party names and artwork remain the property of their respective owners and are documented in TRADEMARKS.md and the third-party notices.

來源:README.md,提交 fc04b3e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.1.22最新Oct 6, 2026
  2. v0.1.21Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分