Metadata-Version: 2.4
Name: cyfendo
Version: 2.0.10
Summary: Lightweight CLI scanner and Private Scan engine with zero source code egress for the Cyfendo Autonomous Security Platform
Author-email: Cyfendo Security Team <contact@cyfendo.com>
License-Expression: LicenseRef-Cyfendo-Proprietary
Project-URL: Homepage, https://cyfendo.com
Project-URL: Documentation, https://cyfendo.com/docs
Project-URL: Developer Settings, https://cyfendo.com/settings/developer
Keywords: security,sast,vulnerability-scanner,appsec,cyfendo,patching,private-scan
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: certifi>=2024.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: google-genai>=0.1.1
Requires-Dist: openai>=1.0.0
Requires-Dist: anthropic<1,>=0.78.0
Provides-Extra: private
Requires-Dist: google-genai>=0.1.1; extra == "private"
Requires-Dist: openai>=1.0.0; extra == "private"
Requires-Dist: anthropic<1,>=0.78.0; extra == "private"
Provides-Extra: byom
Requires-Dist: google-genai>=0.1.1; extra == "byom"
Requires-Dist: openai>=1.0.0; extra == "byom"
Requires-Dist: anthropic<1,>=0.78.0; extra == "byom"
Provides-Extra: gemini
Requires-Dist: google-genai>=0.1.1; extra == "gemini"
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic<1,>=0.78.0; extra == "anthropic"
Dynamic: license-file

# Cyfendo CLI 🛡️

[![PyPI version](https://img.shields.io/pypi/v/cyfendo.svg)](https://pypi.org/project/cyfendo/)
[![Python Version](https://img.shields.io/pypi/pyversions/cyfendo.svg)](https://pypi.org/project/cyfendo/)
[![License: Proprietary](https://img.shields.io/badge/License-Proprietary-red.svg)](https://cyfendo.com/terms)

> **Autonomous Application Security Scanner, AST-Bounded Taint Analyzer & Dual-Oracle Remediation Engine.**  
> Find verified vulnerabilities, eliminate false positives through multi-agent consensus, and apply Dual-Oracle verified code patches in seconds.

---

## ⚡ Key Capabilities

* 🔒 **Cyfendo Private Scan (Zero Source Code Egress)**: Run 100% locally using your own LLM provider keys (Anthropic Claude, OpenAI, Google Gemini, GCP Vertex AI, Azure OpenAI, or local Ollama/vLLM). **Zero source code leaves your machine.**
* 🤖 **Multi-Agent SAIF Pipeline**: Five specialized agents (Researcher, Prosecutor, Defender, Critic, and Dual-Oracle Judge) collaboratively audit code, discover taint paths, and synthesize dynamic PoC exploits to mathematically verify reachability.
* 🧪 **Dual-Oracle Verified Patches**: Synthesizes surgical code fixes and validates them against both static AST syntax checks and dynamic exploit neutralizers before presenting them to you.
* 🛠️ **Interactive Patch Manager**: Review colorized unified diffs and apply fixes directly to your repository with a single command (`cyfendo patch <id> --apply`).
* 🎯 **Fine-Grained Deduplication & Benchmarking**: Supports `root_cause`, `file` (per-file isolation), and `none` deduplication scopes, plus a dedicated `--benchmark-mode` for OWASP Benchmark / Juliet suites.
* 📱 **Mobile APK & Dalvik Bytecode Analysis**: Autonomous Dual-Tier decompilation engine converts Android APKs and compiled Dalvik (`.dex`) binaries into indexable Java source trees, unmasking hidden C2 communication, dynamic dropper payloads (CWE-506), and rogue network interception services (CWE-250).
* 🚦 **CI/CD Quality Gates**: Native OASIS SARIF 2.1.0 export and configurable severity threshold gates (`--fail-on=high`) for GitHub Actions, GitLab CI, and CircleCI.

---

## 🚀 Installation

### Option A: Install via pip (Recommended)
```bash
pip install --upgrade cyfendo
```

Or isolate dependencies with `pipx`:
```bash
pipx install cyfendo
```

### Option B: One-Line Installer (macOS & Linux)
```bash
curl -sSL https://cyfendo.com/install.sh | bash
```
This installs the same PyPI package, with `pipx` if available or `pip --user` otherwise (Python 3.9+).

The CLI is distributed only through PyPI; the standalone binary is no longer published. If you installed the binary earlier, run the installer again (it removes the old binary), or delete `~/.local/bin/cyfendo` and install with pip or pipx.

---

## 🔒 1. Cyfendo Private Scan (Zero Source Code Egress)

Cyfendo Private Scan is engineered for defense, healthcare, fintech, and enterprise teams with strict zero-trust data custody requirements:
* **100% Local Pipeline Execution**: AST parsing, cross-file taint analysis, call graphs, exploit verification, and patch synthesis execute directly on your local workstation.
* **Direct LLM Connection**: Your machine communicates directly with your chosen provider. Cyfendo servers never proxy your code or model prompts.
* **Local Storage in `.cyfendo/`**: All findings, exploit traces, Markdown reports, SARIF files, and individual `.patch` diffs are stored exclusively in your local workspace.
* **Minimal Entitlement Sync**: No source code, file contents, or findings are sent to Cyfendo. To meter quota, the CLI sends scan metadata (project name, file and LOC counts, provider and model, git branch, commit SHA, and remote URL), stage progress updates, and, on completion, severity counts, risk score, and patch count (or the error message if the scan fails). A Cyfendo server must be reachable: `cyfendo.com`, or your on-premises server via `--server`.

### Step-by-Step Setup:

#### Step 1: Authenticate Workspace (Required)
Private Scan verifies plan entitlements with Cyfendo before every scan. Generate an API Key from **User Menu → Developer & CLI Access** on [https://cyfendo.com](https://cyfendo.com) and log in:
```bash
cyfendo login --key cy_live_xxxxxxxxxxxxxxxxxxxxxxxx
cyfendo status
```

#### Step 2: Configure Provider Credentials
Export your provider API key or credentials as environment variables:

```bash
# OpenAI (GPT-4o, GPT-4.5, O3-Mini, O1):
export OPENAI_API_KEY="sk-proj-xxxxxxxxxxxxxxxxxxxxxxxx"

# Anthropic Claude (Claude Sonnet 5.5, Claude Opus 5.5):
export ANTHROPIC_API_KEY="sk-ant-xxxxxxxxxxxxxxxxxxxxxxxx"

# Google Gemini Developer API:
export GEMINI_API_KEY="AIzaSyxxxxxxxxxxxxxxxxxxxx"

# Google Cloud Vertex AI (with enterprise ADC):
gcloud auth application-default login
export GCP_PROJECT="my-enterprise-gcp-project"
export VERTEX_AI_LOCATION="us-central1"

# Microsoft Azure OpenAI Service:
export AZURE_OPENAI_ENDPOINT="https://my-resource.openai.azure.com/"
export AZURE_OPENAI_KEY="xxxxxxxxxxxxxxxxxxxxxxxx"
export AZURE_OPENAI_DEPLOYMENT="my-gpt4o-deployment"
```

#### Step 3: Set Persistent Defaults (Optional)
Save your preferred provider and model defaults in `~/.cyfendo/config.json` so you don't need to pass flags each time:
```bash
cyfendo config --set-provider anthropic
cyfendo config --set-model claude-sonnet-5-5
cyfendo config --set-thinking high
cyfendo config --show
```

#### Step 4: Execute the Private Local Scan
Run `cyfendo scan --private .` on your target directory:

```bash
# 1. Private scan with OpenAI GPT-4o and patch generation:
cyfendo scan --private \
    --provider openai \
    --model gpt-4o \
    --generate-patch \
    .

# 2. Private scan with Anthropic Claude Sonnet 5.5 and extended reasoning:
cyfendo scan --private \
    --provider anthropic \
    --model claude-sonnet-5-5 \
    --thinking high \
    --generate-patch \
    .

# 3. Private scan with Google Gemini 3.6 Flash (the default Gemini model):
cyfendo scan --private \
    --provider gemini \
    --model gemini-3.6-flash \
    --generate-patch \
    .

# 4. Private scan with GCP Vertex AI:
cyfendo scan --private \
    --provider vertex \
    --model gemini-3.6-flash \
    --generate-patch \
    .

# 5. Private scan with Microsoft Azure OpenAI:
cyfendo scan --private \
    --provider azure \
    --generate-patch \
    .

# 6. Custom OpenAI-compatible proxy gateway (corporate LiteLLM proxy):
cyfendo scan --private \
    --provider openai \
    --endpoint "https://ai-proxy.corp.internal/v1" \
    --model gpt-4o \
    .

# 7. Local models via Ollama (model traffic never leaves your machine).
#    The CLI still verifies entitlements with a Cyfendo server; on a network with no
#    internet access, add --server <your on-premises Cyfendo server>.
#    Local models can be slow: each request may take up to CYFENDO_LLM_TIMEOUT seconds
#    (default 900 for ollama, 120 for hosted providers).
# Pull model: ollama pull deepseek-r1:32b
cyfendo scan --private \
    --provider ollama \
    --model deepseek-r1:32b \
    --generate-patch \
    .

# 8. Private scan with self-hosted vLLM cluster:
cyfendo scan --private \
    --provider ollama \
    --endpoint "http://vllm-cluster.internal:8000/v1" \
    --model deepseek-ai/DeepSeek-R1 \
    .
```

---

## ☁️ 2. Managed Cloud Platform Scanning

For centralized team reporting, automated periodic Git schedules, and cloud dashboard triage:

```bash
# 1. Authenticate with your Cyfendo API Key
cyfendo login --key cy_live_xxxxxxxxxxxxxxxx

# 2. Run a vulnerability scan in current directory
cyfendo scan .

# 3. Associate scan with an existing protected project
cyfendo scan /path/to/source --project "payment-gateway"

# 4. View account and workspace status
cyfendo whoami
cyfendo status
cyfendo projects
```

**What gets uploaded:** the CLI follows `.gitignore` and `.cyfendoignore` files at every folder level and always leaves out `.env` files (templates such as `.env.example` are kept), SSH and TLS private keys, keystores, and config files that contain a private key. Symlinks that point outside the project are skipped, and so are `.sarif` files and any report the CLI wrote into the project on an earlier run (`--sarif`, `-o`, `--patch-bundle`, recorded in `.cyfendo/outputs.json`), so they are never uploaded or counted as Protected LOC. The CLI lists the credential files it excluded, and stops with an error if the archive would exceed 250 MB.

---

## ⚙️ 3. Scan Settings & Advanced Options

### A. Deduplication Scopes (`--dedup-scope`)
Controls how raw taint traces and candidate findings across call graphs and AST scopes are clustered:
* **`root_cause` (Default)**: Universal multi-factor AST clustering across functions and routes. Consolidates redundant alerts into single root-cause findings for developer triage.
* **`file` (Per-File Isolation)**: Prevents findings in separate files from merging. Crucial for synthetic test suites and granular file-by-file audits.
* **`none` (Raw Traces)**: Disables deduplication clustering entirely. Outputs every verified candidate finding trace directly.

```bash
# Run with per-file deduplication and full AI patch generation
cyfendo scan . --dedup-scope=file --generate-patch

# Run raw audit without any deduplication
cyfendo scan . --dedup-scope=none
```

### B. Benchmark Evaluation Mode (`--benchmark-mode`)
Designed for automated evaluation benchmarks (such as OWASP Benchmark, Juliet, and custom synthetic suites). Enforces **Per-File Isolation** (`--dedup-scope=file`) and disables initial patch generation for maximum evaluation throughput and exact groundtruth comparison:
```bash
cyfendo scan . --benchmark-mode
```

### C. Developer Steering Directives (`--directive`)
Guide the multi-agent researcher to focus its audit on specific architecture layers or threat vectors:
```bash
cyfendo scan --private \
    --provider openai \
    --model gpt-4o \
    --directive "Focus audit on authentication bypass, BOLA, and SSRF in payment endpoints" \
    .
```

### D. Fresh Scan Without Checkpoint Cache (`--clean`)
Clears all cached analysis stage checkpoints and forces a fresh scan from scratch:
```bash
cyfendo scan --private --clean .
```

### E. Mobile APK & Dalvik Bytecode Security Analysis
Scan Android application packages (`.apk`), multi-DEX zip archives, or directories containing compiled Dalvik (`.dex`) executables. The CLI's autonomous dual-tier decompiler automatically extracts and disassembles bytecodes into a high-fidelity Java source tree (`decompiled_src/`) before launching multi-agent AST taint analysis:
```bash
# Scan unpacked Android APK or DEX binary directory with zero source code egress:
cyfendo scan --private \
    --provider anthropic \
    --model claude-sonnet-5-5 \
    --thinking high \
    ./unpacked_apk/
```
* **Tier 1 (JADX)**: Automatically leverages local JADX if installed (`brew install jadx`) for full decompilation.
* **Tier 2 (Pure-Python Fail-Safe)**: Built-in zero-dependency disassembler that parses DEX binaries directly if JADX is not installed.
* **Mobile Threat Sinks Detected**: Dynamically detects Trojan droppers (CWE-506 / `PackageInstaller`), dynamic payload loaders (`DexClassLoader`), hardcoded C2 credentials (CWE-798), rogue network tunnels (CWE-250 / `VpnService`), and insecure FileProvider traversal paths (CWE-22).

---

## 🩹 4. Inspecting & Applying Remediation Patches
 
All generated artifacts are saved to `.cyfendo/` in your project root. Cyfendo generates verified, production-ready unified `.patch` files:
 
```bash
# 1. List and export individual .patch files into .cyfendo/patches/
cyfendo patches

# 2. Inspect a colorized diff preview for a specific finding
cyfendo patch fnd_91a4 --show

# 3. Apply patch directly to local source code (git apply, falling back to patch -p1).
#    Applying a patch that is already applied reports it and changes nothing.
cyfendo patch fnd_91a4 --apply

# 4. Or apply manually with standard git tooling
git apply .cyfendo/patches/01_sql_injection.patch

# 5. Export an aggregated unified patch bundle during scan
cyfendo scan . --generate-patch --patch-bundle fixes.patch
git apply fixes.patch

# 6. Regenerate a cloud finding's patch on the server, optionally steered by a directive
#    (saved as .cyfendo/patches/regen_<finding>_*.patch; add --scan <SCAN_ID> if needed)
cyfendo patch fnd_91a4 --regenerate --directive "Use the shared db.query() helper"

# 7. Read full Markdown audit report
cat .cyfendo/report.md
```

### 🧠 Google Antigravity SDK Hybrid Remediation Engine

Under the hood, patch synthesis is powered by a **Hybrid Agentic Patch Engine** combining the autonomous reasoning of the **Google Antigravity SDK** with the deterministic validation of the **Mantis gVisor Dual-Oracle Gatekeeper**:

1. **Universal Polyglot Coverage (13+ Languages)**:
   - Evaluates, lints, and validates fixes across **Python, TypeScript, JavaScript, Go, Java, Kotlin, Rust, C, C++, C#, PHP, Ruby, Swift, Scala, and Bash**.
   - Includes full manifest and dependency inspection (`package.json`, `pom.xml`, `go.mod`, `requirements.txt`, `Cargo.toml`, `Package.swift`, `build.sbt`, `*.csproj`).
2. **Support for All SWE Archetypes**:
   - `WIRE_PROTOCOL`: Autonomous background service provisioning, readiness polling, and multi-threaded HTTP/wire reproducers.
   - `IN_PROCESS_ROUTE`: In-memory controller and web route unit invocation.
   - `STANDALONE_CLI`: Command-line interface and direct function harness verification.
3. **Dual-Oracle Security Gatekeeper**:
   - **Oracle 1 (Static AST Invariant Gate)**: Enforces AST structural preservation, ensuring error-handling is never neutered (e.g. blanket `except Exception: pass` is rejected) and core logic is intact.
   - **Oracle 2 (Dynamic Sandbox Gate)**: Executes the reproducer PoC inside an ephemeral gVisor sandbox. The patch is verified if and only if the exploit is mathematically neutralized ($\text{exit} \ne 0$) while benign baseline behavior passes ($\text{exit} = 0$).
4. **Isolated Ephemeral Shadow Workspaces**:
   - The primary workspace is read-only. Fixes are staged, linted, and tested inside isolated shadow workspaces with atomic multi-file rollbacks on failure.
5. **Safety Refusal Rewriting & Telemetry Defanging**:
   - Upstream LLM safety filters are safeguarded with universal telemetry defanging (`defang_diagnostic_telemetry`), neutralizing false refusal triggers on SQLi, SSRF, path traversal, or command injection strings during automated repair.


---

## 🚦 5. CI/CD Quality Gates & Automation

Enforce shift-left security on every pull request. Automatically block PR merges with failing quality gates, upload standard SARIF reports, or execute 100% Cyfendo Private Scans with zero source code egress.

### CLI Gate Flags:
* `--fail-on=<critical|high|medium|low>`: Exits with code `1` if findings at or above the threshold exist.
* `--sarif=<path>`: Exports findings in OASIS SARIF 2.1.0 format for GitHub Code Scanning / GitLab.
* `--no-interactive`: Disables animated spinners and progress bars for clean CI log output.

---

### GitHub Actions Workflow (Cyfendo Private Scan — Zero Source Code Egress)
```yaml
name: Cyfendo Private Security Audit

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  cyfendo-security-audit:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      security-events: write
      actions: read
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Install Cyfendo CLI & Provider SDK
        run: pip install --upgrade cyfendo anthropic

      - name: Execute Private Security Scan
        env:
          CYFENDO_API_KEY: ${{ secrets.CYFENDO_API_KEY }}
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: >
          cyfendo scan .
          --private
          --provider anthropic
          --model claude-sonnet-5-5
          --thinking high
          --sarif results.sarif
          --fail-on high
          --no-interactive

      - name: Upload SARIF to GitHub Code Scanning
        uses: github/codeql-action/upload-sarif@v4
        if: always() && hashFiles('results.sarif') != ''
        continue-on-error: true
        with:
          sarif_file: results.sarif
```

---

### GitHub Actions Workflow (Managed Cloud)
```yaml
name: Cyfendo Cloud Audit

on:
  pull_request:
    branches: [main]

jobs:
  security-gate:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      security-events: write
      actions: read
    steps:
      - uses: actions/checkout@v4

      - name: Install Cyfendo CLI
        run: pip install --upgrade cyfendo

      - name: Run Cloud Security Gate
        env:
          CYFENDO_API_KEY: ${{ secrets.CYFENDO_API_KEY }}
        run: >
          cyfendo scan .
          --fail-on high
          --sarif results.sarif
          --no-interactive
          --yes

      - name: Upload SARIF Report
        uses: github/codeql-action/upload-sarif@v4
        if: always() && hashFiles('results.sarif') != ''
        continue-on-error: true
        with:
          sarif_file: results.sarif
```

---

### GitLab CI Workflow (`.gitlab-ci.yml`)
```yaml
cyfendo_security_scan:
  stage: test
  image: python:3.12-slim
  variables:
    CYFENDO_API_KEY: "$CYFENDO_API_KEY"
    OPENAI_API_KEY: "$OPENAI_API_KEY"
  script:
    - pip install --upgrade cyfendo openai
    - >
      cyfendo scan .
      --private
      --provider openai
      --model gpt-4o
      --sarif gl-sast-report.sarif
      --fail-on high
      --no-interactive
  artifacts:
    reports:
      sast: gl-sast-report.sarif
    when: always
```

---

## 📖 Complete CLI Command Reference

| Command / Flag | Description | Example |
| :--- | :--- | :--- |
| `cyfendo login` | Authenticates CLI and stores credentials in `~/.cyfendo/config.json`. | `cyfendo login --key cy_live_...` |
| `cyfendo whoami` | Displays active user account, role, organization, and quota usage. | `cyfendo whoami` |
| `cyfendo status` | Alias of `whoami`: shows Protected LOC balance, plan limit, and grace period status. | `cyfendo status` |
| `cyfendo projects` | Lists active protected projects in your workspace with LOC counts. | `cyfendo projects` |
| `cyfendo scan <path>` | Packages the directory (honoring `.gitignore` / `.cyfendoignore` at every level, never `.env` files or private keys), uploads it to the Cyfendo cloud sandbox, and streams live audit telemetry. | `cyfendo scan .` |
| `cyfendo scan --private <path>` | **Cyfendo Private Scan:** analysis, verification, and patching run on this machine with zero source code egress, using your own LLM keys or local models. Only scan metadata and finding counts sync to Cyfendo, which must be reachable. | `cyfendo scan --private .` |
| `--provider <name>` | Specifies AI provider for Private Scan: `openai`, `anthropic`, `gemini`, `vertex`, `azure`, or `ollama`. | `--provider openai` |
| `--model <name>` | Target LLM model (`gpt-4o`, `claude-sonnet-5-5`, `gemini-3.6-flash`, `deepseek-r1:32b`). | `--model claude-sonnet-5-5` |
| `--llm-key <key>` | Direct API key for chosen provider (or via `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.). | `--llm-key sk-ant-...` |
| `--endpoint <url>` | Custom OpenAI-compatible base URL for corporate proxies, vLLM, or self-hosted Ollama. | `--endpoint http://localhost:11434/v1` |
| `CYFENDO_LLM_TIMEOUT` | Per-request model timeout in seconds for OpenAI-compatible providers (default 900 for `ollama`, 120 for `openai`). Raise it for large local models. | `CYFENDO_LLM_TIMEOUT=1800` |
| `--thinking <level>` | Sets reasoning effort level for thinking models (`off`, `none`, `low`, `medium`, `high`). | `--thinking high` |
| `--directive <text>` | Developer steering directive to focus vulnerability research on specific areas. | `--directive "Focus on BOLA & auth"` |
| `cyfendo config` | Inspects or configures persistent CLI defaults (`--set-provider`, `--set-model`, `--set-thinking`, `--set-llm-key`, `--set-endpoint`, `--show`). | `cyfendo config --set-provider anthropic` |
| `--workspace, -w <id>` | Global flag: run any command in a specific workspace (also `CYFENDO_WORKSPACE_ID`). Works before or after the subcommand. | `cyfendo -w ws_acme_corp scan .` |
| `--key <key>` | Global flag: Cyfendo API key for this command (overrides `CYFENDO_API_KEY` and the saved key). | `cyfendo --key cy_live_... whoami` |
| `--server <url>` | Global flag: Cyfendo server URL for a self-hosted or local server (overrides `CYFENDO_SERVER_URL` and the saved server). | `--server http://127.0.0.1:8080` |
| `cyfendo workspaces` / `cyfendo workspace switch <id>` | Lists accessible workspaces, or switches the saved default workspace. | `cyfendo workspace switch ws_acme_corp` |
| `--project, -p` | Binds scan run to an existing Protected Project name or ID. | `--project "backend-api"` |
| `--dedup-scope <scope>` | Sets vulnerability deduplication scope: `root_cause` (default), `file` (per-file isolation), or `none` (raw traces). | `--dedup-scope=file` |
| `--benchmark-mode` | Runs in benchmark evaluation mode (overrides `--dedup-scope=file` and disables patch generation). | `--benchmark-mode` |
| `--generate-patch` | Synthesizes and sandbox-verifies AI remediation patches during scan. | `--generate-patch` |
| `--no-patch` | Explicitly skips remediation patch generation (default fast PoC mode). | `--no-patch` |
| `--patch-bundle <path>` | Exports aggregated unified remediation diff bundle file. | `--patch-bundle fixes.patch` |
| `--fail-on <level>` | Exits with code 1 if findings at or above threshold exist (`critical`, `high`, `medium`, `low`). | `--fail-on=high` |
| `--output, -o <path>` | Writes an extra copy of the scan results JSON to this path (always saved to `.cyfendo/scan-results.json`). | `--output results.json` |
| `--sarif <path>` | Exports findings in OASIS SARIF 2.1.0 JSON format for GitHub / IDE integration. | `--sarif=results.sarif` |
| `--clean` | Clears all cached analysis stage checkpoints and forces a fresh scan from scratch. | `--clean` |
| `--no-interactive` | Disables animated spinners and progress bars for clean CI/CD log output. | `--no-interactive` |
| `--yes, -y` | Skips the cloud upload confirmation prompt. | `cyfendo scan . --yes` |
| `--open` | Opens the scan in the web dashboard when it finishes. | `--open` |
| `--separate` | Registers a cloud scan as a new project instead of matching an existing one. | `--separate` |
| `--profile <name>` | Cloud scan profile: `deep_agentic` (default), `standard`, or `quick`. | `--profile quick` |
| `-v, --verbose` | Enables verbose diagnostic traces and model communication logs. | `cyfendo scan --private -v .` |
| `cyfendo patches [id]` | Lists local `.patch` files, or, given a scan ID, downloads and exports that cloud scan's patches (`--out-dir` sets the folder; default `.cyfendo/patches/`). Each scan's export replaces the previous scan's numbered patches; regenerated `regen_*` patches are kept. | `cyfendo patches scan-2026-xyz` |
| `cyfendo patch <target>` | Inspects (`--show`) or applies (`--apply`) a vulnerability patch to local files. Re-applying an applied patch reports it and changes nothing. | `cyfendo patch fnd_91a4 --show` |
| `cyfendo patch <id> --regenerate` | Re-synthesizes a cloud finding's patch on the server as a new `regen_*.patch`. `--directive` steers it (and implies `--regenerate`); `--scan` sets the scan ID when it isn't in `.cyfendo/scan-results.json`. Private Scan patches regenerate with `cyfendo scan --private --generate-patch --clean`. | `cyfendo patch fnd_91a4 --directive "Use db helper"` |
| `cyfendo logout` | Clears the stored Cyfendo API key, server, and workspace. Private Scan settings and LLM keys are kept; `--all` deletes `~/.cyfendo/config.json` entirely. | `cyfendo logout --all` |
| `--version, -V` | Prints the installed CLI version. | `cyfendo --version` |

---

## 📄 License & Links

* **License**: Proprietary. © Cyfendo Inc. The Cyfendo CLI License ships with the package (`LICENSE` in the wheel's `.dist-info/licenses/`) and permits use with your Cyfendo account under the [Terms of Service](https://cyfendo.com/terms); copying, redistribution and reverse engineering are not permitted.
* **Homepage**: [https://cyfendo.com](https://cyfendo.com)
* **Documentation**: [https://cyfendo.com/docs](https://cyfendo.com/docs)
* **Issues & Feedback**: [contact@cyfendo.com](mailto:contact@cyfendo.com)
