Catalog PyPI
PACKAGE EXPLORERView in registry

0pirate

PyPI

Zero-Knowledge AI Security Middleware for Agents and IDEs

Versions collected1
Direct dependencies11From release 0.2.1
Last observed20 Oct, 15:02 UTC

README

Version 0.2.1 documentation
0Pirate Logo

0Pirate

Local redaction proxy and zero-knowledge middleware for AI-assisted coding

License: MIT


Overview

0Pirate is a local proxy that sits between your development environment and frontier AI models. It removes credentials, replaces proprietary business logic with structural placeholders, sends the sanitized code to the AI provider, and restores the original code locally when the response arrives.

The Problem

Engineering teams face a direct trade-off between AI coding performance and code privacy:

1. Local models fall short on complex code

Running local open-weight models through tools like Ollama keeps data on your machine, but smaller models (7B to 70B) cannot match the reasoning, context tracking, and multi-file refactoring abilities of frontier cloud models. For complex system design and hard bugs, local models often slow developers down.

2. Cloud models expose sensitive assets

Sending unredacted code to third-party endpoints creates exposure risks across three areas:

  • Credentials and secrets: API keys, database connection strings, SSH keys, authentication tokens.
  • Personal and infrastructure data: Internal hostnames, private IP addresses, employee emails, customer data in test fixtures.
  • Intellectual property: Proprietary algorithms, financial formulas, patented logic, and domain-specific business rules.

3. Traditional masking tools break code

Standard data loss prevention filters and regex rules treat code like plain text:

  • Regex replacements break Abstract Syntax Tree (AST) structures, scope boundaries, and language typing.
  • Simple masks do not hide the semantics of proprietary logic.
  • Text filters are one-way. When an AI returns a code patch, regex tools cannot automatically restore the original identifiers into working code.

How 0Pirate Works

0Pirate runs entirely on your local machine or private network:

  1. AST-level abstraction: Rather than using naive text replacement, 0Pirate parses the syntax tree. Proprietary functions, internal classes, and business variables are mapped to structurally valid placeholder tokens.
  2. Secret redaction: High-entropy strings, credential formats, and sensitive constants are detected and removed before any payload is sent.
  3. Model-agnostic routing: 0Pirate does not depend on a specific AI model. It works with any modern provider:
    • Anthropic: Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude Opus
    • OpenAI: GPT-4o, o1, o3-mini
    • DeepSeek: DeepSeek-R1, DeepSeek-V3
    • Google: Gemini 2.0 Flash, Gemini 1.5 Pro
    • Meta, Mistral, and custom endpoints via OpenRouter or OpenAI-compatible APIs
  4. Local rehydration: When the model returns generated code or a diff, 0Pirate maps all placeholders back to your original variable names, functions, and secrets in local memory. The remote provider never receives the raw IP.

Using with Agentic IDEs (Cursor and Claude Code)

0Pirate runs as a local Model Context Protocol (MCP) server. When an agent in Cursor or Claude Code requests project context, 0Pirate intercepts the file read, redacts the contents, and returns the safe version.

MCP Configuration

Add 0Pirate to your Cursor or Claude Desktop configuration file:

{
  "mcpServers": {
    "0pirate-secure-proxy": {
      "command": "python3",
      "args": ["/path/to/0pirate/cli/mcp_server.py"]
    }
  }
}

Once configured, the agent reads and writes code through the proxy without exposing your underlying secrets or proprietary identifiers.

Quickstart

Run the local stack:

Prerequisites

  • Docker and Docker Compose
  • Python 3.10 or newer

Setup

# Clone the repository
git clone https://github.com/Arunmadhavan28/0pirate.git
cd 0pirate

# Set up environment variables
cp .env.example .env

# Start local services
docker-compose up -d

# Install CLI and pre-commit hook
cd cli
pip install -r requirements.txt
python main.py install-hook

Services:

Documentation

Community

License

This project is licensed under the MIT License.

Downloads & popularity

5downloads
1-day window · source-reported counts19 Oct 2026
511255.50
2026-09-08: 511 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-08–2026-09-082026-09-09: 34 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-09–2026-09-092026-09-10: 12 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-10–2026-09-102026-09-11: 3 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-11–2026-09-112026-09-12: 8 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-12–2026-09-122026-09-13: 1 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-13–2026-09-132026-09-14: 6 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-14–2026-09-142026-09-15: 27 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-15–2026-09-152026-09-16: 14 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-16–2026-09-162026-09-17: 3 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-17–2026-09-172026-09-18: 22 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-18–2026-09-182026-09-19: 4 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-19–2026-09-192026-09-20: 12 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-20–2026-09-202026-09-21: 16 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-21–2026-09-212026-09-22: 3 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-22–2026-09-222026-09-23: 11 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-23–2026-09-232026-09-24: 7 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-24–2026-09-242026-09-25: 8 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-25–2026-09-252026-09-26: 9 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-26–2026-09-262026-09-27: 2 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-27–2026-09-272026-09-28: 9 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-28–2026-09-282026-09-29: 3 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-29–2026-09-292026-09-30: 4 · observed 2026-10-20T18:30:17.4214253Z · period 2026-09-30–2026-09-302026-10-01: 2 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-01–2026-10-012026-10-02: 1 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-02–2026-10-022026-10-03: 1 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-03–2026-10-032026-10-04: 1 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-04–2026-10-042026-10-05: 10 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-05–2026-10-052026-10-06: 1 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-06–2026-10-062026-10-07: 3 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-07–2026-10-072026-10-08: 1 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-08–2026-10-082026-10-09: 5 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-09–2026-10-092026-10-10: 160 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-10–2026-10-102026-10-11: 28 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-11–2026-10-112026-10-12: 12 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-12–2026-10-122026-10-13: 4 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-13–2026-10-132026-10-14: 6 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-14–2026-10-142026-10-15: 11 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-15–2026-10-152026-10-16: 5 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-16–2026-10-162026-10-17: 40 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-17–2026-10-172026-10-18: 2 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-18–2026-10-182026-10-19: 5 · observed 2026-10-20T18:30:17.4214253Z · period 2026-10-19–2026-10-19
8 Sept19 Oct

pypistats · 42 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1952026-10-20T18:30:17.4214253Z
2026-10-18 – 2026-10-1822026-10-20T18:30:17.4214253Z
2026-10-17 – 2026-10-17402026-10-20T18:30:17.4214253Z
2026-10-16 – 2026-10-1652026-10-20T18:30:17.4214253Z
2026-10-15 – 2026-10-15112026-10-20T18:30:17.4214253Z
2026-10-14 – 2026-10-1462026-10-20T18:30:17.4214253Z
2026-10-13 – 2026-10-1342026-10-20T18:30:17.4214253Z
2026-10-12 – 2026-10-12122026-10-20T18:30:17.4214253Z
2026-10-11 – 2026-10-11282026-10-20T18:30:17.4214253Z
2026-10-10 – 2026-10-101602026-10-20T18:30:17.4214253Z
2026-10-09 – 2026-10-0952026-10-20T18:30:17.4214253Z
2026-10-08 – 2026-10-0812026-10-20T18:30:17.4214253Z
2026-10-07 – 2026-10-0732026-10-20T18:30:17.4214253Z
2026-10-06 – 2026-10-0612026-10-20T18:30:17.4214253Z
2026-10-05 – 2026-10-05102026-10-20T18:30:17.4214253Z
2026-10-04 – 2026-10-0412026-10-20T18:30:17.4214253Z
2026-10-03 – 2026-10-0312026-10-20T18:30:17.4214253Z
2026-10-02 – 2026-10-0212026-10-20T18:30:17.4214253Z
2026-10-01 – 2026-10-0122026-10-20T18:30:17.4214253Z
2026-09-30 – 2026-09-3042026-10-20T18:30:17.4214253Z
2026-09-29 – 2026-09-2932026-10-20T18:30:17.4214253Z
2026-09-28 – 2026-09-2892026-10-20T18:30:17.4214253Z
2026-09-27 – 2026-09-2722026-10-20T18:30:17.4214253Z
2026-09-26 – 2026-09-2692026-10-20T18:30:17.4214253Z
2026-09-25 – 2026-09-2582026-10-20T18:30:17.4214253Z
2026-09-24 – 2026-09-2472026-10-20T18:30:17.4214253Z
2026-09-23 – 2026-09-23112026-10-20T18:30:17.4214253Z
2026-09-22 – 2026-09-2232026-10-20T18:30:17.4214253Z
2026-09-21 – 2026-09-21162026-10-20T18:30:17.4214253Z
2026-09-20 – 2026-09-20122026-10-20T18:30:17.4214253Z
2026-09-19 – 2026-09-1942026-10-20T18:30:17.4214253Z
2026-09-18 – 2026-09-18222026-10-20T18:30:17.4214253Z
2026-09-17 – 2026-09-1732026-10-20T18:30:17.4214253Z
2026-09-16 – 2026-09-16142026-10-20T18:30:17.4214253Z
2026-09-15 – 2026-09-15272026-10-20T18:30:17.4214253Z
2026-09-14 – 2026-09-1462026-10-20T18:30:17.4214253Z
2026-09-13 – 2026-09-1312026-10-20T18:30:17.4214253Z
2026-09-12 – 2026-09-1282026-10-20T18:30:17.4214253Z
2026-09-11 – 2026-09-1132026-10-20T18:30:17.4214253Z
2026-09-10 – 2026-09-10122026-10-20T18:30:17.4214253Z
2026-09-09 – 2026-09-09342026-10-20T18:30:17.4214253Z
2026-09-08 – 2026-09-085112026-10-20T18:30:17.4214253Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.110 Oct 202611

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 15:02 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:1eab768d00ad7ca217f28346db942221fd27e93f771731f39322b50ea961fad4