Skip to main content

Pisces Banner

PISCES

AI-Assisted · Self-Healing · Human-Governed Python Security Remediation Patcher

PyPI Version Python Versions CI Status License: MIT Build: Hatchling Linter: Ruff Type Checked: mypy

Overview

Pisces is a Python security CLI that detects common vulnerabilities, explains findings with an LLM, proposes minimal patches, validates them with your test suite, and rolls them back when validation fails. Source changes remain human-approved by default.

Key Features

  • AST-first and regex-fallback security scanning.
  • Seven built-in rules for secrets, command injection, unsafe subprocesses, unsafe deserialization, disabled TLS verification, code injection, and dangerous filesystem operations.
  • Excludes .venv, __pycache__, and other irrelevant directories.
  • LLM explanations with source snippets and AST context.
  • Human-in-the-loop patch approval.
  • Atomic patching, checkpoints, rollback, and self-healing retries.
  • Local repair history and a debounced watch mode.
  • OpenAI, Anthropic, Gemini, Groq, Ollama, and LM Studio support.

⚙️ How it Works

How Pisces Works — Scan to History

⚙️ The Repair State Machine

How Pisces Works — Scan to History

Installation

Pisces requires Python 3.10 or newer.

pip install pisces-cli

Quick Usage

pisces init
pisces config
pisces scan .
pisces explain path/to/file.py:42
pisces fix path/to/file.py:42
pisces history

Set the API key for the provider configured in pisces.toml, for example:

export GROQ_API_KEY="your-key"

On Windows PowerShell:

$env:GROQ_API_KEY = "your-key"

Ollama and LM Studio use local endpoints and do not require an API key.

Configuration

Run pisces init to create a project configuration:

[llm]
provider = "groq"
model = "llama-3.3-70b-versatile"

[repair]
max_attempts = 3
require_approval = true

[validation]
test_command = "pytest"

[scan]
exclude = [
    ".git",
    ".venv",
    "venv",
    "__pycache__",
    "node_modules",
    ".pisces",
    "dist",
    "build",
]

Do not put API keys in this file. Use environment variables instead.

CLI Reference

Command Purpose
pisces init [PATH] Initialize pisces.toml and .pisces/.
pisces config [PATH] --show Configure or display project settings.
pisces scan [TARGET] -o FILE -s LEVEL Scan a directory or Python file.
pisces explain FILE:LINE Explain a cached finding with an LLM.
pisces fix FILE:LINE Generate, approve, apply, and validate a patch.
pisces watch [PATH] Update project context as files change.
pisces history [PATH] Browse repair records and diffs.
pisces --version Show the installed version.

pisces fix also supports --dry-run, --no-judge, and --max-attempts N. pisces scan returns exit code 1 when findings meet the selected severity threshold.

Built-in Security Rules

Rule ID Severity Detects
Hardcoded Secret S001 HIGH API keys, passwords, and tokens
Command Injection S002 CRITICAL Dynamic shell=True subprocess calls
Unsafe Subprocess S003 HIGH shell=True subprocess calls
Unsafe Deserialization S004 HIGH Unsafe pickle, marshal, or YAML loading
TLS Verify Disabled S005 MEDIUM Network calls using verify=False
Code Injection S006 CRITICAL Dynamic eval() or exec()
Dangerous Filesystem S007 MEDIUM Destructive operations on variable paths

Architecture and Workflow

Pisces Security Remediation Workflow

The workflow covers project initialization, deterministic security scanning, LLM-powered explanations and patch generation, human approval, checkpointing, test validation, rollback, and self-healing retries.

The deterministic scanner does not call an LLM. LLMs are used for explanations, patch generation, and optional patch judging. Source changes require human approval by default.

The deterministic scanner does not call an LLM. LLMs are used for explanations, patch generation, and optional patch judging.

License

MIT © Mrinmoy Matilal

Metadata

Release files for pisces-cli 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pisces-cli 0.1.4
File Size Uploaded Provenance Actions
pisces_cli-0.1.4.tar.gz 242.5 kB Without provenance Details for pisces_cli-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pisces-cli 0.1.4
File Interpreter ABI Platform Actions
pisces_cli-0.1.4-py3-none-any.whl Python 3 none any Details for pisces_cli-0.1.4-py3-none-any.whl

Total release size: 304.6 kB

Release files / pisces_cli-0.1.4.tar.gz

Download URL pisces_cli-0.1.4.tar.gz
Size 242.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2a2ab8e86c40d7282056a308d5de518df9c440ef5db93aafbe044c48b1036259
BLAKE2b-256 checksum
How to use checksums
f8f349a7cb7fd6d66271cfd8bff715c9117c44520ad894500f2cd594a416953d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pisces_cli-0.1.4-py3-none-any.whl

Download URL pisces_cli-0.1.4-py3-none-any.whl
Size 62.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5287d7f015f3e69c8b297f10c07500dd42c192f0f2be356bbb5440850c36e05
BLAKE2b-256 checksum
How to use checksums
5a4d97e0e3be4d1093c5318598fe860e715f05e4433e8dcd545f0b55d66f529c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pisces-cli 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page