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
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 —
Rapg
Local-first secret manager for the AI-agent era — keep API keys out of .env files and out of your agent transc
Token Proxy
Local AI API gateway for OpenAI / Gemini / Anthropic. Runs on your machine, keeps tokens counted (SQLite), off
Deterministic Agent Control Protocol
Governance gateway for AI agents — bounded, auditable, session-aware control with MCP proxy, shell proxy & HTT
1password Skill
A Claude Code skill for securing API keys with 1Password CLI. Stop hardcoding secrets where your AI tools can
Anthropic Proxy Rs
A proxy server that intercepts Anthropic API requests and converts them to OpenAI-compatible format, enabling
Related Agents
Kb Reader
Read and summarize relevant Claude Code engineering pattern files from the local knowledge base. Keeps raw fil
Ava PR Reviewer
Reviews open and stalled pull requests — reads the actual diff for correctness and isolation bugs, works out w
Secret Purist
The paranoid sentinel of credential security. Use this agent to scan codebases and git history for leaked secr