Metadata-Version: 2.4
Name: riciplay-cli
Version: 1.9.5
Summary: Riciplay Security Platform — Autonomous AI-driven bug-bounty CLI
Author: Zaidux
License-Expression: MIT
Project-URL: Homepage, https://riciplay.xyz
Project-URL: Documentation, https://riciplay.xyz/docs
Project-URL: Repository, https://github.com/Zaidux/Riciplay
Project-URL: Issues, https://github.com/Zaidux/Riciplay/issues
Keywords: security,bug-bounty,dast,sast,pentest,vulnerability-scanner,ai-security,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: typer<1,>=0.27.1
Requires-Dist: httpx<1,>=0.28.1
Requires-Dist: rich<16,>=15.0.0
Requires-Dist: keyring<26,>=25.7.0
Requires-Dist: tiktoken<1,>=0.14.0
Requires-Dist: packaging<27,>=26.3
Requires-Dist: prompt-toolkit<4,>=3.0.53
Requires-Dist: ricibrowser<0.3,>=0.2.28
Requires-Dist: riciplay-miniproxy<2,>=0.9.7
Requires-Dist: tornado<7,>=6.6
Requires-Dist: riciplay-mitmproxy==12.3.1.1
Provides-Extra: browser
Requires-Dist: ricibrowser<0.3,>=0.2.28; extra == "browser"
Provides-Extra: dev
Requires-Dist: pytest<10,>=9.1.1; extra == "dev"
Requires-Dist: pytest-asyncio<2,>=1.4.0; extra == "dev"
Requires-Dist: pytest-timeout<3,>=2.4.0; extra == "dev"
Requires-Dist: pyte<1,>=0.8.2; extra == "dev"

# riciplay-cli

**Riciplay Security Platform — Command-line Interface**

An autonomous AI-driven bug bounty hunting agent for web applications and
codebases. Runs local investigations with an LLM-in-a-loop leader that
orchestrates specialists, probes endpoints, verifies findings, and chains
vulnerabilities.

## Features

- **Full-screen terminal chat** — An OpenCode-inspired dark layout with a
  pinned composer, scrollable transcript, compact tool blocks and an adaptive
  session sidebar. New and resumed sessions use the same interface.

- **Autonomous DAST (Dynamic Application Security Testing)** — Web app
  vulnerability scanning with automatic attack-surface enumeration, multi-class
  injection probing (XSS / SQLi / IDOR / open-redirect / SSRF), and
  interception-driven recon through miniproxy + headless browser.

- **Autonomous SAST (Static Application Security Testing)** — Code audit with
  semgrep, code search, and AI-guided data-flow tracing. Finds injection sinks,
  hardcoded secrets, weak crypto, and path traversal.

- **Manual-analysis mode** — Human-pentester-style workflow: observe through
  browser, take notebook notes, register accounts, test cross-account, reason
  and iterate.

- **Specialist orchestration** — Parallel execution of domain specialists
  (Recon, Web, API, Auth, Cloud, Business Logic) with shared findings,
  cross-specialist corroboration, and compound attack chaining.

- **Coverage gates** — Deterministic finish-time enforcement ensures every
  discovered endpoint×parameter×attack-class combination is attempted before
  the investigation concludes.

- **Two-identity IDOR testing** — Automatic account registration/login and
  cross-account replay for authorization bypass detection.

- **Phase-separated investigation** — DISCOVER (breadth-first surface mapping
  and probing) followed by REPORT (impact verification, chaining, and quality
  gating).

## Installation

```bash
pip install riciplay-cli
```

Requires Python 3.12+, `mitmdump` (for proxy capture), and optionally Chromium
(via Playwright) for browser-based discoveries.

The 1.9.3 release candidate raises the Python minimum to match the current
mitmproxy line and requires Tornado 6.6+. It depends on MiniProxy 0.9.7+ and
`riciplay-mitmproxy==12.3.1.1`, a temporary maintained distribution based on exact
upstream mitmproxy 12.3.1. Publication remains held until this complete chain is
validated and publicly available; do not bypass resolution with `--no-deps`.

**Do not install upstream `mitmproxy` beside the fork**: they share imports and
console scripts. The npm launcher rejects overlapping distribution metadata and
will not automatically uninstall shared packages. Migrate an existing install
to a fresh Python 3.12+ virtual environment, preserving all session, capture,
CA and credential directories:

```bash
python3.12 -m venv ~/.venvs/riciplay-1.9.3
~/.venvs/riciplay-1.9.3/bin/python -m pip install riciplay-cli==1.9.3
~/.venvs/riciplay-1.9.3/bin/python -m pip check
~/.venvs/riciplay-1.9.3/bin/riciplay launcher-info
export PATH="$HOME/.venvs/riciplay-1.9.3/bin:$PATH"
```

Keep the old environment until capture/readback checks pass; these commands do
not delete investigation data. If both distributions already coexist, migrate
rather than assuming uninstalling one repairs shared files. The maintained
[fork policy](https://github.com/Zaidux/mitmproxy/blob/releases/riciplay-12.3.1.1/RICIPLAY_FORK.md)
defines provenance, security maintenance and retirement once an official safe
upstream release passes the same compatibility/audit gates.

Proxy startup validates that imports and `mitmdump` belong to the fork in the
active environment; an unrelated custom executable is not accepted based on a
version banner. The updater also refuses upstream-to-fork mutation and verifies
dependencies after installation. It passes `--break-system-packages` only when
the operator explicitly requests that OS-protection override.

Proxy shutdown also verifies the persisted process creation identity and its
owned process group. Legacy proxy state without that identity is not enough to
authorize a kill (even with `force`); retire a verified legacy process manually
before starting the candidate in its fresh environment. Captures are preserved.

## Quick Start

```bash
# Authenticate against the Riciplay backend
riciplay auth set-key <your-api-key>

# Run a DAST investigation against a target
riciplay scan investigate https://example.com --budget 12

# SAST code audit — point it at a path and name a focus skill
riciplay scan investigate ./my-project --focus sast-audit --budget 8

# Headless: natural-language instruction, JSON to stdout
riciplay scan investigate https://example.com --prompt "find IDOR in /api/orders" --budget 15

# Named session so an interrupted run can be resumed
riciplay scan investigate https://example.com --session audit-1 --budget 12
```

Options: `--budget/-b` · `--focus/-f` · `--prompt/-p` · `--authorized/-a`
(lab/CTF, skips prompts) · `--session/-s` · `--output/-o` · `--plan-mode`.
There is no `--mode` flag — DAST and SAST are the same command pointed at a URL
or a path.

## Configuration

- `riciplay auth status` — Check authentication and tier
- `riciplay auth whoami` — Show current account info
- `riciplay review <path>` — Code review with markdown output
- `riciplay --help` — Full command reference

## Interactive chat

```bash
riciplay chat                   # Full-screen terminal interface
riciplay resume <session-id>    # Restore history into the same interface
riciplay chat --inline          # Traditional terminal scrollback
```

- **Ctrl+P** searches commands. A selection fills the composer; submit it to
  use normal command dispatch. Dismissing the palette preserves your draft.
- **/sessions** searches saved and open sessions. Switching saves the current
  investigation first; a failed save cancels the switch.
- **PageUp / PageDown** scroll the transcript; **End** with an empty composer
  returns to the latest output. The composer stays visible after a resize.
- **Shift+Tab** cycles Hunt / Plan / Triage; **Ctrl+S** opens specialists;
  **Ctrl+K** opens investigation workflows; **Ctrl+E** opens the external editor.
- **Ctrl+O** opens session tool logs; **Ctrl+T** opens the operator terminal;
  **Ctrl+\\** toggles the contextual sidebar (automatically hidden in small panes).
- During a turn, **Esc** stops cooperatively and typed follow-ups remain queued.
  **Ctrl+P** shows the read-only command reference while the turn owns input.
- **Ctrl+X** opens the live, scrollable Agents view both idle and during a turn.
  It shows foreground specialists, this session's background jobs and two-way
  messages. Closing the view preserves your draft; viewing notes does not
  acknowledge delivery to an agent.

The redesign does not grant permissions. Each sensitive disclosure and active
action still goes through the existing scope and approval checks. Working
directory and authorization workspace remain separate and are labeled separately.
Non-TTY output and `TERM=dumb` use the inline path. Display-only history is
bounded for long sessions; stored history is not shortened by the UI.

### Background work and agent coordination

- `bash(background=true, ...)` returns a task handle immediately after the normal
  per-call approval and scope checks. At most eight shell jobs run concurrently;
  each has a bounded output tail and a timeout (300 seconds by default, 600 max).
  Shell jobs belong to the current CLI and stop on exit. Redacted partial output
  and exit status remain available after cancellation or timeout.
- `sub_agent(background=true, ...)` or `background_task(action='start', ...)`
  launches independent specialist work in a detached worker that survives CLI
  exit. Other generic tools are still synchronous. Use background work only
  when the parent can continue without its result.
- Every foreground or detached specialist requires its own target-bound approval,
  including green/red modes. Blanket approval does not authorize specialist spending.
- `/background <new instruction>` copies the current context into a separately owned
  child session. It never removes completed tool results or replays the previous
  request. Bare `/background` shows guidance; use `/background list` to monitor.
  Resume the child after completion; foreground saves cannot overwrite a live worker.
- `background_task` supports `list`, `status`, `result` and `cancel`. Cancelling
  a specialist retains its local metadata and partial report. It stops the local
  worker, **not necessarily an in-flight backend request or remote spending**.
  `/background remove` is a separate, explicit metadata-removal operation.
- Failed browser retirement retains the child writer and task. The owning worker
  retries cleanup at exit; `/background list` also reconciles recorded groups and
  profiles after worker exit. Ownership is released only when every recorded
  resource is confirmed gone. Legacy tasks without verification anchors stay held.
- Proxy capture and manual interception share the canonical `RULES.md` matcher:
  bare hosts are exact, `*.host` admits subdomains, and URL scheme/port/path and
  exclusions remain enforced. Explicit `scope_hosts` can narrow but never widen
  declared scope; malformed scope fails closed instead of disabling the guard.
- `agent_message(action='post', recipient=task_id, kind='question', message=...)`
  sends coordination notes; `agent_message(action='read')` collects the parent's
  inbox in bounded batches. Session/sender identities are runtime-assigned.
  Private transactional local inboxes bridge to authenticated, per-user backend
  channels with retry-safe delivery and acknowledgments. Delivery failures appear
  on the board and in specialist results rather than silently losing notes.
- A completion/message notice contains metadata only. Message bodies enter the
  model as ordinary tool results or user-role coordination data. They do not
  grant scope, credentials, permissions, approval or spending authority. Sensitive
  capture-derived asynchronous results still require individual disclosure consent.

Chat closes owned browser runtimes before executor shutdown, including error and
exhausted-credit exits; interpreter shutdown no longer schedules browser cleanup
on an already-shut-down executor.
