Keyfence — AI skill for Claude Code
Local proxy that keeps your API keys and secrets out of LLM requests.
How to install Keyfence
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open aminueza/Keyfence and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Keyfence does
Local proxy that keeps your API keys and secrets out of LLM requests. Works with Claude Code, Cursor, Codex and any tool.
Alternatives in AI
- Dsh Plugin Subscriptions — Use ChatGPT (Codex), Claude, and Grok (X Premium) subscriptions as DeepSeek Harness LLM providers — OAuth logi 283 ★
- Kru — Local-first MCP password and credential manager for AI agents 125 ★
- Copilot Tunnel Proxy — GitHub Copilot as Local AI API Bridge for Claude Code 2026 119 ★
README
keyfence
[](https://github.com/aminueza/keyfence/actions/workflows/ci.yml) [](https://github.com/aminueza/keyfence/blob/main/LICENSE) 
A local proxy that stops secrets from reaching LLM APIs. It checks every request to an AI provider before it leaves your machine and blocks, redacts or placeholder-swaps API keys, passwords and other secrets. Works with Claude Code, Cursor, Codex, Aider, curl and anything else that speaks HTTP.

Install
pip install keyfence
Python 3.12 or newer. mitmproxy comes as a dependency.
Use
keyfence import # register your secrets from .env and credential files (hashes only)
keyfence exec -- claude # run a tool through the proxy
keyfence canary .env # plant a fake secret; if a tool ever sends it, you will know
keyfence install-hooks claude-code # stop Claude Code from reading secret files at all
On first run mitmproxy creates a CA certificate in `~/.mitmproxy/`. Trust it once so HTTPS can be inspected (macOS shown, other systems in the [setup guide](https://github.com/aminueza/keyfence/blob/main/docs/setup.md)):
sudo security add-trusted-cert -d -p ssl \
-k /Library/Keychains/System.keychain ~/.mitmproxy/mitmproxy-ca-cert.pem
Modes
| mode | behaviour |
|---|---|
block |
request gets a 403 and is not sent |
redact (default) |
secret becomes [REDACTED:] |
placeholder |
secret becomes < and the real value is restored in the response, streaming included |
Documentation
- Setup: CA certificate, manual proxy setup,
Related Skills
Phantom Secrets
Stop AI coding agents from leaking your API keys. Local proxy + MCP that swaps real secrets for phm_ tokens —
LLM Rate Limit Proxy
Self-hosted LLM proxy that pools and rotates your API keys, queues requests instead of returning 429 Too Many
PrivAiTe
Self-hosted PII redaction proxy for LLM APIs and agent CLIs. Scrubs names, emails and secrets from Claude Code
Safe Keys
Paste an API key into Claude Code. Nothing keeps it. A Claude Code mod that keeps credentials out of the chat,
Claude Code Secret Guard
Claude Code mod that keeps API keys, tokens and passwords out of the model's context: gitleaks scans every too
Sugt
SUGT - local AI gateway & skills console. Centralize LLM API keys, one OpenAI/Anthropic-compatible proxy for C
Related Agents
Model Runner
Deterministic wrapper that runs a prompt on a non-Claude model (OpenAI via Codex, Cursor's composer/grok/glm,
Dev Inbox Planner
Use this agent when handling feature requests, bug reports, vague product requests, issue triage, requirement
Kb Reader
Read and summarize relevant Claude Code engineering pattern files from the local knowledge base. Keeps raw fil