keysmith MCP server
2026년 11월 15일 커밋age 암호화, 마스킹 뷰, 로컬 토큰 치환 기능을 통해 자격 증명 유출을 방지하고 AI agent에게 안전한 비밀 관리 시스템을 제공합니다.
다른 이름 sscodeai/keysmith
- 스타
- 0
- Tools
- 5
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 15일
- 라이선스
- Apache-2.0
keysmith MCP란?
age 암호화, 마스킹 뷰, 로컬 토큰 치환 기능을 통해 자격 증명 유출을 방지하고 AI agent에게 안전한 비밀 관리 시스템을 제공합니다. 5개 도구를 제공합니다. 예: list, get, put.
프로젝트 README에서 생성된 요약
keysmith MCP server 정보
keysmith는 평문 비밀 정보가 agent의 컨텍스트나 세션 기록에 포함되지 않도록 차단하여 AI agent를 위한 민감한 자격 증명을 보호합니다. age 암호화를 사용하여 저장된 데이터를 보호하고, 도구와 리소스가 sk******ij와 같이 민감하지 않은 부분적인 문자열만 반환하도록 마스킹 뷰를 제공하는 계층적 보안 모델을 지원합니다. 이러한 방식을 통해 개발자는 모델 요청이나 로그에 비밀 정보가 영구적으로 유출될 위험 없이 API key, 데이터베이스 URL, 토큰 등을 관리할 수 있습니다.
사용자는 Claude Code 또는 Cursor와 같은 로컬 클라이언트를 위해 stdio 방식으로 서버를 배포하거나, 원격 agent를 위해 HTTP/SSE를 사용할 수 있습니다. 또한 HashiCorp Vault를 백엔드로 지원하여 유효 기간이 짧은 동적 자격 증명을 관리할 수 있습니다. 고유한 치환 레이어를 통해 agent는 비밀 정보가 아닌 토큰을 사용하며, keysmith는 이를 명령의 환경 변수에 로컬로 치환하여 실제 값이 인자 목록이나 트랜스크립트에 나타나지 않도록 보장합니다. 시스템에는 유출된 비밀 정보를 자동으로 감지하고 교체하는 scan 명령도 포함되어 있습니다.
활용 사례
- 1트랜스크립트 내 자격 증명 유출 방지agent가 도구 호출을 통해 평문을 직접 받는 대신, 특정 인박스 파일을 읽어 새로운 비밀 정보를 저장할 수 있습니다.
- 2안전한 환경 변수를 사용한 명령 실행개발자가 AI에게 플레이스홀더 토큰을 사용하는 curl 명령을 실행하도록 지시하면, 해당 토큰은 자식 프로세스 내에서만 실제 비밀 정보로 변환됩니다.
- 3유출 후 비밀 정보 교체 자동화저장소를 스캔하여 노출된 자격 증명을 찾아내고 자동으로 교체하는 예약 작업을 설정할 수 있습니다.
- 4토큰 사용처를 특정 대상으로 제한토큰이 승인되지 않은 엔드포인트에서 사용되는 것을 방지하기 위해 특정 호스트나 경로에 엄격하게 결합된 토큰을 발급할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
keysmith MCP 도구 5
README에서 감지됨listgetputrotatedelete
| list | — | |
| get | — | |
| put | — | |
| rotate | — | |
| delete | — |
구성
KEYSMITH_STOREVAULT_TOKEN
| 이름 | 설명 | 유형 |
|---|---|---|
| KEYSMITH_STORE | — | |
| VAULT_TOKEN | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능sscodeai/keysmith is public and reachablegithub.com/sscodeai/keysmith ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-14github.com/sscodeai/keysmith ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음5 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기keysmith 🔑
日本語 ·
The key-smith for AI agents — forge, guard, and rotate secrets so plaintext never enters the agent's context.
Keysmith is an MCP server + CLI for AI-agent-safe secret management. It treats masking as the last line of defense and works structurally to keep secrets from leaking: encrypted residency, masked views, handle-passing, self-healing rotation, and short-TTL dynamic credentials.
Masking alone leaves a gap: a masked value cannot be used. The redemption layer closes it — the agent handles a non-secret token, and keysmith substitutes the real value on this machine, into the environment of a command it starts. The value is never in a model request, a tool result, a transcript, or an argument list. See docs/REDEEM.md and docs/THREAT-MODEL.md.
Built with Go. Single static binary, zero runtime dependencies.
Why
AI agents increasingly need credentials (API keys, tokens, DB URLs) to do
their work. But every time an agent reads a .env file, the plaintext leaks
into its context, logs, and session history — permanently.
Keysmith fixes this with a layered security model:
| Layer | Mechanism | What it prevents |
|---|---|---|
| Encrypted residency | age (X25519) encrypted store at rest | Plaintext on disk; even a leaked context is harmless (blobs are ciphertext) |
| Masked views | resources/tools return sk******ij form |
Credentials entering agent context |
| Handle-passing | put reads the value from a file in the store inbox, not from the transcript |
Plaintext in tool-call transcripts |
| Self-healing rotation | scan --rotate detects leaks, kills the leaked value |
Stale leaked credentials keep working |
| Short-TTL (Vault) | dynamic DB creds expire in 1h | Leaked credentials become worthless |
| Redemption | keysmith run substitutes a token locally, into the child's environment |
An agent that must use a credential being tempted to print it; plaintext in argv, transcripts, or logs |
| Target binding | --allow-host / --allow-path / --allow-header at issue time, checked against run --target |
A token being redeemed into a command aimed at an attacker's endpoint |
Install
go install github.com/sscodeai/keysmith/cmd/keysmith@latest
# or build from source
go build -o bin/keysmith ./cmd/keysmith
Usage
Run the server on stdio transport (the standard MCP server mode):
keysmith -store ~/.keysmith
# or via env:
KEYSMITH_STORE=/path/to/store keysmith
Serve over HTTP/SSE for remote agents:
keysmith -store ~/.keysmith -http 127.0.0.1:8080
# endpoint: http://localhost:8080/sse
Serve MCP 2025 Streamable HTTP (single POST endpoint, stateless):
keysmith -store ~/.keysmith -http 127.0.0.1:8080 -streamable
# endpoint: http://localhost:8080/mcp
An HTTP listener has no authentication of its own, so keysmith refuses to bind
a non-loopback address unless -http-token is set. With a token, every request
must carry Authorization: Bearer <token>:
keysmith -store ~/.keysmith -http 192.168.1.10:8080 -http-token "$(openssl rand -hex 16)" -streamable
Use HashiCorp Vault as the backend (dynamic short-TTL secrets):
export VAULT_TOKEN=<token>
keysmith -store ~/.keysmith -vault http://127.0.0.1:8200
Configure it in your MCP client (Claude Code, Cursor, etc.):
{
"mcpServers": {
"keysmith": {
"command": "keysmith",
"args": ["-store", "~/.keysmith"]
}
}
}
The store directory is created on first run with 0600 permissions, holding:
key.txt— your age private key (NEVER share; keep0600)secrets.enc— armored age-encrypted secrets blob
CLI
In addition to the MCP server, keysmith works as a standalone CLI sharing the same store:
keysmith list # all keys, masked values
keysmith get API_KEY # masked value
keysmith get API_KEY --unsafe # plaintext (last resort)
keysmith set API_KEY < value.txt # value from stdin, no shell-history leak
keysmith rotate API_KEY 32 # generate + store new strong secret
keysmith delete API_KEY # remove a key
keysmith scan [--rotate] [repo-dir] # scan git history for leaked secrets
keysmith inbox # directory the MCP put tool accepts files from
keysmith token API_KEY # issue a session-bound placeholder token
keysmith token API_KEY --allow-host api.example.test --allow-path /v1/
# ...bound to a destination (see below)
keysmith run --target https://api.example.test/v1/me --env AUTH="Bearer <token>" -- sh -c 'curl -H "Authorization: $AUTH" https://api.example.test/v1/me'
Use a credential without reading it
The agent never needs the plaintext to use a credential:
TOKEN=$(keysmith token API_KEY) # token on stdout, session info on stderr
keysmith run --env AUTH="Bearer $TOKEN" -- sh -c 'curl -s -H "Authorization: $AUTH" https://api.example.test/me'
TOKENis a reference, not a secret:[[keysmith:v1:API_KEY:8f3a2b1c]]. It only resolves locally, only while the issuing session is alive, and only for the names issued in it.- The real value is substituted on this machine and placed in the child's
environment. It never enters a model request, a transcript, or
argv. - A token in the command arguments is refused, because
argvis readable by every user viaps. Put it in--envand let the child's shell expand it. - A token issued with
--allow-host/--allow-path/--allow-headeris bound to a destination:runthen refuses to redeem it unless--targetdeclares a matching URL (https, or loopback http). Unbound tokens still work, with a warning. - Redemption fails closed: unknown or expired session, a name not issued in that session, a missing value, a malformed token, or an unwritable audit log all abort before the command starts. No fallback ever forwards a literal token or a plaintext value.
<store>/audit.logrecords the key names, the command basename and the argument count — never a value and never a full argument list.
Full details, including the token grammar and the fail-closed table: docs/REDEEM.md.
Vault-backed commands (with -vault):
keysmith -vault http://127.0.0.1:8200 vault-kv-set API_KEY < value.txt
keysmith -vault http://127.0.0.1:8200 vault-kv-get API_KEY # masked
keysmith -vault http://127.0.0.1:8200 vault-kv-list
keysmith -vault http://127.0.0.1:8200 vault-db-creds app-role # dynamic short-TTL DB creds
Tools
| Tool | Description | Security property |
|---|---|---|
list |
All keys with masked values | Values never plaintext |
get |
Single key, masked value | Values never plaintext |
put |
Store a secret | Reads value_file from the store inbox only, then deletes it |
rotate |
Generate + store a new strong random secret | Returns masked value only |
delete |
Remove a key | — |
Resources
| URI | Description |
|---|---|
secret://secrets |
Masked view of all secrets (safe to read into context) |
Agent skills
The bundled SKILL.md (in skill/) teaches agents to route ALL secret
operations through this server — never cat a .env, never echo a token.
The AGENTS.md at the repo root encodes the same rules for agents working
on this codebase itself.
Capability map
How the pieces relate — core primitives vs the automation/transport layers built on top of them:
flowchart TB
subgraph Core["Core primitives"]
STORE[age encrypted store<br/>internal/store]
MASK[masking rules<br/>internal/mask]
SCAN[leak-scan + self-healing<br/>keysmith scan --rotate]
VAULT[Vault short-TTL creds<br/>internal/vault]
REDEEM[local redemption<br/>internal/redeem]
end
subgraph Auto["Automation"]
CRON[scheduled leak-scan<br/>scripts/scan-cron.sh]
end
subgraph Access["Access"]
STDIO[stdio]
SSE[SSE -http]
STREAM[Streamable -streamable]
end
SCAN -->|scheduled| CRON
STORE --> SCAN
MASK --> STORE
VAULT -.->|optional backend| STORE
STDIO -.-> SSE
SSE -.-> STREAM
| Layer | Capability | Relationship |
|---|---|---|
| Core | age store + mask + rotate + scan + redeem | foundational primitives |
| Automation | scripts/scan-cron.sh |
schedules scan --rotate |
| Access | stdio / SSE / Streamable | three transports, one server |
One line: core primitives provide the power, automation makes it run by itself, transports decide how agents connect.
Security model
- At rest: always age-encrypted (X25519), armor format. A plaintext file
never exists on disk. Atomic writes (temp + rename),
0600perms. - In transcripts:
putnever takes the plaintext as an argument — it reads a file path, and only inside the store inbox (keysmith inbox); the file is deleted after it is read. A path outside the inbox is refused, so the tool cannot be used as an arbitrary-file read or unlink. - In context: masked values only. Masking keeps first/last 2 chars
(
sk******ij) so credentials are distinguishable without being revealed. - At use time:
keysmith runredeems a session-bound token locally and places the value in the child's environment. Values never reachargv, the audit log, or a model request; every failure aborts before the command starts (no plaintext fallback, no literal-token fallback). A bound token also has to satisfy--target: the declared destination must match the binding, and the target is recorded in the audit line. - Masking rules: key-name markers (SECRET/TOKEN/PASSWORD/API_KEY/DSN...), known value prefixes (sk-, ghp_, glpat-, xoxb-, JWT...), and high-entropy alphanumeric runs (≥20 chars mixing letters+digits, Shannon entropy ≥3.5). A sensitive key name forces masking even when the value does not match a value heuristic — a passphrase without digits is still a secret. Plain configuration under a non-sensitive key (DEBUG, PORT) stays readable. URL-shaped values are masked per-segment: userinfo password always masked, high-entropy path/query runs masked, host/port stay clear. Pure-numeric values (timeouts, retries) are never masked.
Development
go test ./... # unit tests (mask + store + vault + leakscan + redeem)
go vet ./... # static checks
python3 e2e_test.py # full MCP protocol round-trip
python3 verify_redeem.py # redemption: child env vs /proc, fail-closed cases, audit log
Boundaries
keysmith narrows the paths a credential can take; it does not make an untrusted machine safe. Specifically:
- Any process running as your user can read
key.txtand decrypt the store.0600/0700permissions do not isolate same-UID processes. - The bundled agent skill is guidance, not access control: nothing stops an
agent from
cat-ing a file that was never in the store. The enforced paths are the store API, the masked views, and the redemption layer. - Masking discloses the first and last two characters of a value
(
sk******ij) so credentials stay distinguishable — a deliberate, small disclosure. - Masked views and the leak-scanner are best-effort detection, not proof: a value that is never matched is never masked.
The full adversary list, including what is explicitly out of scope, is in docs/THREAT-MODEL.md.
Scheduled leak-scan (cron self-healing)
The bundled scripts/scan-cron.sh runs keysmith scan --rotate on one or
more repos, printing one line only when leaks are found (and rotated) —
silent when clean. Wire it into any cron:
# every 6 hours, scan two repos; only alerts when leaks found+rotated
0 */6 * * * /path/to/keysmith/scripts/scan-cron.sh ~/.keysmith /repo1 /repo2
Roadmap
- Vault backend (dynamic short-TTL secrets — leaked credentials expire)
- HTTP/SSE transport (for remote agent scenarios)
- CLI subcommands (add/get/rotate/scan without MCP)
- Streamable HTTP transport (MCP 2025 standard, single POST endpoint)
- Scheduled leak-scan watchdog script (cron-driven self-healing)
- Local redemption layer (session-bound tokens resolved locally; fail-closed, value-free audit log)
- Multi-tenant / team mode (share store across agents with audit log)
- Cloud credentials (AWS STS / GCP short-lived)
License
Apache-2.0
keysmith MCP 질문
keysmith MCP는 어떤 도구를 제공하나요?
5개 도구를 제공합니다. 예: list, get, put, rotate, delete.