aminueza

Keyfence — AI skill for Claude Code

AI community

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

  • Opencodex — Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama… 12.3k ★
  • Cindy — Consider it done 2.3k ★
  • Rb Setup — First-time setup 1.3k ★

README

keyfence

[![CI](https://github.com/aminueza/keyfence/actions/workflows/ci.yml/badge.svg)](https://github.com/aminueza/keyfence/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/aminueza/keyfence/blob/main/LICENSE) ![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue.svg)

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.

![How keyfence sits between your tools and the provider](https://raw.githubusercontent.com/aminueza/keyfence/main/docs/keyfence-flow.png)

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,