s-gw is a local credential control tool for AI coding agents, designed to reduce the risk of agents accidentally exposing credentials. Its core idea is: agents no longer directly touch raw keys, passwords, tokens, or SSH material, but instead use stable typed handles (for example, s-gw:credential:prod-readonly) to request actual work. When an agent requests an operation, s-gw creates a pending approval request containing the agent name, command, handle, environment variable bindings, working directory, target, and policy result. The user can approve once locally, approve for a time window, approve for the entire login session, or deny the request. After approval, s-gw starts a restricted process on the local machine, injects credentials only into the requested environment variables, and scans the output before it is returned to the agent, replacing detected credential values with handles, thereby returning redacted output and audit evidence.
Main capabilities include: local custody, with raw values kept in macOS Keychain, Linux Secret Service, Windows Credential Manager, 1Password, or an encrypted local ledger; operation-scoped access, with authorization bound to the agent, handle, command, environment variables, working directory, target, approval mode, and optional time window; useful handles, allowing agents to request real work using stable handle names without seeing keys, passwords, tokens, or SSH material; output redaction, where command output is scanned before being returned to the agent and detected credential values are replaced with handles; agent-aware setup, providing profile-specific configuration for Codex, Claude Code, Cursor, OpenCode, Gemini CLI, GitHub Copilot, VS Code, and other MCP clients; a local operator interface, where a native desktop app, tray or menu helper, CLI, and web console can display approvals, credential inventory, policies, usage flows, activity, and audit history. Agents never need to unlock passwords or raw credentials, and approval scope is limited to the requested operation rather than granting general access to storage.
Usage: on macOS, Windows 10/11, and Linux, installation via the public npm package is recommended. Node.js 20 or higher is required, then run the installation command. On Windows, run the same command in PowerShell. Windows support is in previewSoftware: The npm package uses a TypeScript execution path and includes a PowerShell client, tray helper, and local web console. On Linux, secret-tool must be installed first (run 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 graphical sessions. Headless hosts without Secret Service can use an explicitly provided SGW_MASTER_PASSPHRASE with s-gw setup --no-service --no-open-app, but s-gw will never copy that value into unit files or background service environments. Windows x64 and Linux x64 also have installable desktop app builds. The Rust app draws its management interface directly in a native window and does not embed a browser, WebView, or localhost page. It bundles 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 explicitly launch and open a separate loopback browser backup. 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. For the 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 helper, and menu bar helper; it does not require the host's Node.js or npm. Setup is intentionally blocked until the app is located in /Applications or ~/Applications. An unsigned DMG requires a Gatekeeper override. If you do not want to use that override, use the npm installation above instead.
s-gw setup generates local unlock material, stores it in the operating system credential store, initializes the encrypted ledger, starts the local UI interface available on the current platform, and securely connects detected supported agents. The self-contained macOS app and Windows/Linux desktop preview run their bundled runtime in place; the npm installation copies the lightweight macOS app to /Applications, falling back to ~/Applications when necessary. Setup backs up existing agent configurations, preserves unrelated settings, installs the packaged s-gw skill where supported, and reports conflicts for each agent. Use --no-agents to skip agent registration.
Credentials can be added from the terminal without putting values into chat or process arguments, and then non-secret handle metadata can be inspected. The end-to-end trust loop demonstrates a one-time request, local approval, execution, and output redaction without touching real credentials. The full flow can be viewed using a one-time local token, and the execution output should show the handle token instead of demo-secret-value.
Agent integration: list known agent configuration files and render configuration for a client, and review or manage detected connections. Manual configuration files and configuration formats that do not have a safe merge path continue to use generated snippets. The npm installation itself never edits agent configuration. s-gw setup can securely 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 the npm .cmd shim. For CLI agents, protection mode can replace startup environment values that look like credentials with s-gw handles before the agent starts. MCP registration does not intercept every prompt, file read, shell, or environment variable.
Example request flow: the agent sees s-gw:credential:prod-readonly and requests to run aws sts get-caller-identity. s-gw creates a pending request containing the agent name, command, handle, environment binding, working directory, target, and policy result. The user approves once, approves for a time window, approves the entire login session, or denies. s-gw launches the approved local process and injects credentials into the requested environment variables. s-gw scans the process output before the output is returned to the agent. The model can complete the task without receiving the raw access key.
Platform status: The released Apple Silicon macOS DMG is self-contained. When credentials are available, the release is Developer ID signed and notarized; otherwise the release notes and DMG README state that a Gatekeeper override is required. The Windows NSIS and Linux Debian desktop packages are currently unsigned CI artifacts and are not uploaded as supported release downloads. Either can be built on the target operating system using npm run build:desktop-app; use npm run build:installers to build the existing release artifacts.
Limitations: s-gw is designed to reduce the cases where a programming agent accidentally exposes credentials. It cannot protect against a compromised OS account, a malicious approved executable, screen capture, kernel-level access, or every transformation 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 public issues. The public agent and client source distributions are preview quality; the compiled Rust execution core is proprietary. macOS is the primary development and testing platform. Windows Credential Manager support and the Windows x64 desktop app exist but still need broader local QA and code signing. Linux uses Secret Service as persistent unlock material and a hardened systemd user service. The Linux x64 desktop app is an unsigned preview; environment unlock is only a non-persistent headless fallback. The Windows and Linux desktop installers are CI previews until they are signed and verified on supported target systems. macOS releases without a Developer ID signature are marked as unsigned in their release notes, and require a Gatekeeper override. The repository is ready for open source collaboration, but security-sensitive changes should come with focused tests and threat model updates (when behavior changes).
The documentation index includes: Quick Start and Trust Loop Demo, Anthropic Sandbox and Bring Your Own Connection, Agent Integration, Credential Storage and 1Password, Deployment and Packaging, Third-Party Assets and Licenses. Questions and focused pull requests are welcome. Start with CONTRIBUTING.md, browse good first issue, and use SECURITY.md for anything that could expose credentials or bypass approval. Planning a release, writing an article, or a community post? The maintainer notes in docs/community-launch.md keep public wording consistent and honest. The source code 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 third-party notices.