0pirate 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: 0pirate
3
+ Version: 0.1.4
4
+ Summary: Zero-Knowledge AI Security Middleware for Agents and IDEs
5
+ Author: 0Pirate Team
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: typer>=0.9.0
8
+ Requires-Dist: requests>=2.31.0
9
+ Requires-Dist: rich>=13.0.0
10
+ Requires-Dist: pyyaml>=6.0.0
11
+ Requires-Dist: spacy>=3.7.0
12
+ Requires-Dist: mcp>=0.1.0
13
+ Requires-Dist: regex>=2023.10.3
14
+ Dynamic: author
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: requires-dist
18
+ Dynamic: summary
19
+
20
+ <div align="center">
21
+ <img src="https://raw.githubusercontent.com/Arunmadhavan28/0pirate/main/logo.png" alt="0Pirate Logo" width="200" />
22
+ <h1>0Pirate</h1>
23
+ <p>Local redaction proxy and zero-knowledge middleware for AI-assisted coding</p>
24
+
25
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
26
+ </div>
27
+
28
+ ---
29
+
30
+ ## Overview
31
+
32
+ 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.
33
+
34
+ ## The Problem
35
+
36
+ Engineering teams face a direct trade-off between AI coding performance and code privacy:
37
+
38
+ ### 1. Local models fall short on complex code
39
+ 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.
40
+
41
+ ### 2. Cloud models expose sensitive assets
42
+ Sending unredacted code to third-party endpoints creates exposure risks across three areas:
43
+ - Credentials and secrets: API keys, database connection strings, SSH keys, authentication tokens.
44
+ - Personal and infrastructure data: Internal hostnames, private IP addresses, employee emails, customer data in test fixtures.
45
+ - Intellectual property: Proprietary algorithms, financial formulas, patented logic, and domain-specific business rules.
46
+
47
+ ### 3. Traditional masking tools break code
48
+ Standard data loss prevention filters and regex rules treat code like plain text:
49
+ - Regex replacements break Abstract Syntax Tree (AST) structures, scope boundaries, and language typing.
50
+ - Simple masks do not hide the semantics of proprietary logic.
51
+ - Text filters are one-way. When an AI returns a code patch, regex tools cannot automatically restore the original identifiers into working code.
52
+
53
+ ## How 0Pirate Works
54
+
55
+ 0Pirate runs entirely on your local machine or private network:
56
+
57
+ 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.
58
+ 2. **Secret redaction**: High-entropy strings, credential formats, and sensitive constants are detected and removed before any payload is sent.
59
+ 3. **Model-agnostic routing**: 0Pirate does not depend on a specific AI model. It works with any modern provider:
60
+ - Anthropic: Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude Opus
61
+ - OpenAI: GPT-4o, o1, o3-mini
62
+ - DeepSeek: DeepSeek-R1, DeepSeek-V3
63
+ - Google: Gemini 2.0 Flash, Gemini 1.5 Pro
64
+ - Meta, Mistral, and custom endpoints via OpenRouter or OpenAI-compatible APIs
65
+ 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.
66
+
67
+ ## Using with Agentic IDEs (Cursor and Claude Code)
68
+
69
+ 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.
70
+
71
+ ### MCP Configuration
72
+
73
+ Add 0Pirate to your Cursor or Claude Desktop configuration file:
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "0pirate-secure-proxy": {
79
+ "command": "python3",
80
+ "args": ["/path/to/0pirate/cli/mcp_server.py"]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ Once configured, the agent reads and writes code through the proxy without exposing your underlying secrets or proprietary identifiers.
87
+
88
+ ## Quickstart
89
+
90
+ Run the local stack:
91
+
92
+ ### Prerequisites
93
+ - Docker and Docker Compose
94
+ - Python 3.10 or newer
95
+
96
+ ### Setup
97
+
98
+ ```bash
99
+ # Clone the repository
100
+ git clone https://github.com/Arunmadhavan28/0pirate.git
101
+ cd 0pirate
102
+
103
+ # Set up environment variables
104
+ cp .env.example .env
105
+
106
+ # Start local services
107
+ docker-compose up -d
108
+
109
+ # Install CLI and pre-commit hook
110
+ cd cli
111
+ pip install -r requirements.txt
112
+ python main.py install-hook
113
+ ```
114
+
115
+ Services:
116
+ - Backend proxy: http://localhost:5001
117
+ - Frontend dashboard: http://localhost:3000
118
+ - Pre-commit hook: checks git commits for accidental secret leakage
119
+
120
+ ## Documentation
121
+
122
+ - [ARCHITECTURE.md](./ARCHITECTURE.md): Technical details on the AST parser, token mapping, and local storage.
123
+ - [CONTRIBUTING.md](./CONTRIBUTING.md): Contribution guidelines and local testing setup.
124
+ - [0Pirate GitHub Action](./0pirate-action/README.md): CI workflow for scanning pull requests.
125
+
126
+ ## Community
127
+
128
+ - Issue tracker: [GitHub Issues](https://github.com/Arunmadhavan28/0pirate/issues)
129
+
130
+ ## License
131
+
132
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ 0pirate.egg-info/PKG-INFO
4
+ 0pirate.egg-info/SOURCES.txt
5
+ 0pirate.egg-info/dependency_links.txt
6
+ 0pirate.egg-info/entry_points.txt
7
+ 0pirate.egg-info/requires.txt
8
+ 0pirate.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ 0pirate = main:app
@@ -0,0 +1,7 @@
1
+ typer>=0.9.0
2
+ requests>=2.31.0
3
+ rich>=13.0.0
4
+ pyyaml>=6.0.0
5
+ spacy>=3.7.0
6
+ mcp>=0.1.0
7
+ regex>=2023.10.3
0pirate-0.1.4/PKG-INFO ADDED
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: 0pirate
3
+ Version: 0.1.4
4
+ Summary: Zero-Knowledge AI Security Middleware for Agents and IDEs
5
+ Author: 0Pirate Team
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: typer>=0.9.0
8
+ Requires-Dist: requests>=2.31.0
9
+ Requires-Dist: rich>=13.0.0
10
+ Requires-Dist: pyyaml>=6.0.0
11
+ Requires-Dist: spacy>=3.7.0
12
+ Requires-Dist: mcp>=0.1.0
13
+ Requires-Dist: regex>=2023.10.3
14
+ Dynamic: author
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: requires-dist
18
+ Dynamic: summary
19
+
20
+ <div align="center">
21
+ <img src="https://raw.githubusercontent.com/Arunmadhavan28/0pirate/main/logo.png" alt="0Pirate Logo" width="200" />
22
+ <h1>0Pirate</h1>
23
+ <p>Local redaction proxy and zero-knowledge middleware for AI-assisted coding</p>
24
+
25
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
26
+ </div>
27
+
28
+ ---
29
+
30
+ ## Overview
31
+
32
+ 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.
33
+
34
+ ## The Problem
35
+
36
+ Engineering teams face a direct trade-off between AI coding performance and code privacy:
37
+
38
+ ### 1. Local models fall short on complex code
39
+ 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.
40
+
41
+ ### 2. Cloud models expose sensitive assets
42
+ Sending unredacted code to third-party endpoints creates exposure risks across three areas:
43
+ - Credentials and secrets: API keys, database connection strings, SSH keys, authentication tokens.
44
+ - Personal and infrastructure data: Internal hostnames, private IP addresses, employee emails, customer data in test fixtures.
45
+ - Intellectual property: Proprietary algorithms, financial formulas, patented logic, and domain-specific business rules.
46
+
47
+ ### 3. Traditional masking tools break code
48
+ Standard data loss prevention filters and regex rules treat code like plain text:
49
+ - Regex replacements break Abstract Syntax Tree (AST) structures, scope boundaries, and language typing.
50
+ - Simple masks do not hide the semantics of proprietary logic.
51
+ - Text filters are one-way. When an AI returns a code patch, regex tools cannot automatically restore the original identifiers into working code.
52
+
53
+ ## How 0Pirate Works
54
+
55
+ 0Pirate runs entirely on your local machine or private network:
56
+
57
+ 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.
58
+ 2. **Secret redaction**: High-entropy strings, credential formats, and sensitive constants are detected and removed before any payload is sent.
59
+ 3. **Model-agnostic routing**: 0Pirate does not depend on a specific AI model. It works with any modern provider:
60
+ - Anthropic: Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude Opus
61
+ - OpenAI: GPT-4o, o1, o3-mini
62
+ - DeepSeek: DeepSeek-R1, DeepSeek-V3
63
+ - Google: Gemini 2.0 Flash, Gemini 1.5 Pro
64
+ - Meta, Mistral, and custom endpoints via OpenRouter or OpenAI-compatible APIs
65
+ 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.
66
+
67
+ ## Using with Agentic IDEs (Cursor and Claude Code)
68
+
69
+ 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.
70
+
71
+ ### MCP Configuration
72
+
73
+ Add 0Pirate to your Cursor or Claude Desktop configuration file:
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "0pirate-secure-proxy": {
79
+ "command": "python3",
80
+ "args": ["/path/to/0pirate/cli/mcp_server.py"]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ Once configured, the agent reads and writes code through the proxy without exposing your underlying secrets or proprietary identifiers.
87
+
88
+ ## Quickstart
89
+
90
+ Run the local stack:
91
+
92
+ ### Prerequisites
93
+ - Docker and Docker Compose
94
+ - Python 3.10 or newer
95
+
96
+ ### Setup
97
+
98
+ ```bash
99
+ # Clone the repository
100
+ git clone https://github.com/Arunmadhavan28/0pirate.git
101
+ cd 0pirate
102
+
103
+ # Set up environment variables
104
+ cp .env.example .env
105
+
106
+ # Start local services
107
+ docker-compose up -d
108
+
109
+ # Install CLI and pre-commit hook
110
+ cd cli
111
+ pip install -r requirements.txt
112
+ python main.py install-hook
113
+ ```
114
+
115
+ Services:
116
+ - Backend proxy: http://localhost:5001
117
+ - Frontend dashboard: http://localhost:3000
118
+ - Pre-commit hook: checks git commits for accidental secret leakage
119
+
120
+ ## Documentation
121
+
122
+ - [ARCHITECTURE.md](./ARCHITECTURE.md): Technical details on the AST parser, token mapping, and local storage.
123
+ - [CONTRIBUTING.md](./CONTRIBUTING.md): Contribution guidelines and local testing setup.
124
+ - [0Pirate GitHub Action](./0pirate-action/README.md): CI workflow for scanning pull requests.
125
+
126
+ ## Community
127
+
128
+ - Issue tracker: [GitHub Issues](https://github.com/Arunmadhavan28/0pirate/issues)
129
+
130
+ ## License
131
+
132
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,113 @@
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/Arunmadhavan28/0pirate/main/logo.png" alt="0Pirate Logo" width="200" />
3
+ <h1>0Pirate</h1>
4
+ <p>Local redaction proxy and zero-knowledge middleware for AI-assisted coding</p>
5
+
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ </div>
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ 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.
14
+
15
+ ## The Problem
16
+
17
+ Engineering teams face a direct trade-off between AI coding performance and code privacy:
18
+
19
+ ### 1. Local models fall short on complex code
20
+ 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.
21
+
22
+ ### 2. Cloud models expose sensitive assets
23
+ Sending unredacted code to third-party endpoints creates exposure risks across three areas:
24
+ - Credentials and secrets: API keys, database connection strings, SSH keys, authentication tokens.
25
+ - Personal and infrastructure data: Internal hostnames, private IP addresses, employee emails, customer data in test fixtures.
26
+ - Intellectual property: Proprietary algorithms, financial formulas, patented logic, and domain-specific business rules.
27
+
28
+ ### 3. Traditional masking tools break code
29
+ Standard data loss prevention filters and regex rules treat code like plain text:
30
+ - Regex replacements break Abstract Syntax Tree (AST) structures, scope boundaries, and language typing.
31
+ - Simple masks do not hide the semantics of proprietary logic.
32
+ - Text filters are one-way. When an AI returns a code patch, regex tools cannot automatically restore the original identifiers into working code.
33
+
34
+ ## How 0Pirate Works
35
+
36
+ 0Pirate runs entirely on your local machine or private network:
37
+
38
+ 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.
39
+ 2. **Secret redaction**: High-entropy strings, credential formats, and sensitive constants are detected and removed before any payload is sent.
40
+ 3. **Model-agnostic routing**: 0Pirate does not depend on a specific AI model. It works with any modern provider:
41
+ - Anthropic: Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude Opus
42
+ - OpenAI: GPT-4o, o1, o3-mini
43
+ - DeepSeek: DeepSeek-R1, DeepSeek-V3
44
+ - Google: Gemini 2.0 Flash, Gemini 1.5 Pro
45
+ - Meta, Mistral, and custom endpoints via OpenRouter or OpenAI-compatible APIs
46
+ 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.
47
+
48
+ ## Using with Agentic IDEs (Cursor and Claude Code)
49
+
50
+ 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.
51
+
52
+ ### MCP Configuration
53
+
54
+ Add 0Pirate to your Cursor or Claude Desktop configuration file:
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "0pirate-secure-proxy": {
60
+ "command": "python3",
61
+ "args": ["/path/to/0pirate/cli/mcp_server.py"]
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ Once configured, the agent reads and writes code through the proxy without exposing your underlying secrets or proprietary identifiers.
68
+
69
+ ## Quickstart
70
+
71
+ Run the local stack:
72
+
73
+ ### Prerequisites
74
+ - Docker and Docker Compose
75
+ - Python 3.10 or newer
76
+
77
+ ### Setup
78
+
79
+ ```bash
80
+ # Clone the repository
81
+ git clone https://github.com/Arunmadhavan28/0pirate.git
82
+ cd 0pirate
83
+
84
+ # Set up environment variables
85
+ cp .env.example .env
86
+
87
+ # Start local services
88
+ docker-compose up -d
89
+
90
+ # Install CLI and pre-commit hook
91
+ cd cli
92
+ pip install -r requirements.txt
93
+ python main.py install-hook
94
+ ```
95
+
96
+ Services:
97
+ - Backend proxy: http://localhost:5001
98
+ - Frontend dashboard: http://localhost:3000
99
+ - Pre-commit hook: checks git commits for accidental secret leakage
100
+
101
+ ## Documentation
102
+
103
+ - [ARCHITECTURE.md](./ARCHITECTURE.md): Technical details on the AST parser, token mapping, and local storage.
104
+ - [CONTRIBUTING.md](./CONTRIBUTING.md): Contribution guidelines and local testing setup.
105
+ - [0Pirate GitHub Action](./0pirate-action/README.md): CI workflow for scanning pull requests.
106
+
107
+ ## Community
108
+
109
+ - Issue tracker: [GitHub Issues](https://github.com/Arunmadhavan28/0pirate/issues)
110
+
111
+ ## License
112
+
113
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
0pirate-0.1.4/setup.py ADDED
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+ import os
3
+
4
+ with open("README.md", "r", encoding="utf-8") as fh:
5
+ long_description = fh.read()
6
+
7
+ setup(
8
+ name="0pirate",
9
+ version="0.1.4",
10
+ description="Zero-Knowledge AI Security Middleware for Agents and IDEs",
11
+ long_description=long_description,
12
+ long_description_content_type="text/markdown",
13
+ author="0Pirate Team",
14
+ packages=find_packages(),
15
+ install_requires=[
16
+ "typer>=0.9.0",
17
+ "requests>=2.31.0",
18
+ "rich>=13.0.0",
19
+ "pyyaml>=6.0.0",
20
+ "spacy>=3.7.0",
21
+ "mcp>=0.1.0",
22
+ "regex>=2023.10.3"
23
+ ],
24
+ entry_points={
25
+ "console_scripts": [
26
+ "0pirate=main:app",
27
+ ],
28
+ },
29
+ )