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.
概览
本地凭据网关,让编码代理以句柄引用密钥,经本地审批后仅向子进程注入凭据,并返回脱敏输出。
- 可以做什么
- 发现凭据句柄并为代理创建有边界的操作请求,例如在某个环境变量中注入密钥后运行命令,而不把原始值暴露给模型上下文或工具输出。请求进入本地审批队列,授权范围绑定代理、句柄、命令、环境变量、工作目录、目标及可选时间窗口。获批命令在本机运行,凭据只注入该子进程,输出在返回前被扫描,检测到的密钥值替换为句柄。审批、执行、策略与目标证据会被记录,但不保存返回的原始密钥。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。安装程序会初始化加密本地账本,并可注册受支持的代理。
安装
在 SourceWeft 中
- 打开 控制台中的 s-gw,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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
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.
Public demo: s-gw.com.
What It Does
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
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
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:
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.
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:
Then inspect the non-secret handle metadata:
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:
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:
Review or manage detected connections:
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:
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
- An agent sees
s-gw:credential:prod-readonlyand asks to runaws sts get-caller-identity. - s-gw creates a pending request with the agent name, command, handle, environment binding, working directory, target, and policy result.
- You approve once, for a time window, for the login session, or deny it.
- s-gw starts the approved local process with the credential injected into the requested environment variable.
- 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
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
- Documentation index
- Quick start and trust-loop demo
- Anthropic sandbox and owned connections
- Architecture
- Threat model
- Agent integrations
- Credential stores and 1Password
- Deployment and packaging
- Third-party assets and licenses
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版本历史
2- v0.1.22最新Oct 6, 2026
- v0.1.21Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分